3 Replies Latest reply on Apr 3, 2018 2:51 AM by FerryT

    Edison doesn't mount ttyUSB0 and ttyUSB1

    FocaaBR

      Hello everyone,

       

      I'm having some troubles with my Intel Edison boot. I'm using the Edison as a Gateway for my project to communicate with another board through XBee but right now the application is not working because I'm getting a message "Boot Error". When I searched the codes I found this:

       

      def check_ftdi():

           SER = serial.Serial('/dev/ttyUSB0', 9600)

           SER.close()

           SER = serial.Serial('/dev/ttyUSB1', 9600)

           SER.close()

             

      try:

          # main()

       

       

          print "Init check Hardware and Application... "          

          qnt = POINTER_READ('tentativas_boot.txt')

          print 'Tentativa: ' + ' ' + str(qnt)

         

          #Checks for 'x' boot attempts

          #if had, the system has identified an unhandled error

          # So, it will not try to upload the application any more

          if qnt >= 5:

             print 'Estourou as tentativas'

             os.system('killall -15 python')

          else:

             # Checks if FTDI's are working properly

             print 'check FTDIs'

             check_ftdi()

             print "FTDIs - OK"

       

             # Checks if API and DB are working correctly

             print 'check API e DB'

             GET_CONFIG_DATABASE( ip_url, gateway_addr )

             print "API, MongoDB e Redis - OK"

       

             # Starts Gateway application

             os.system('python /python_gateway/ZigBee/main_hub.py &')

             # Clears the boot control variable

             POINTER_SAVE('tentativas_boot.txt',0)

             # os.system('python /service_drfarm/blinkLed.py &')

      except:

          print "Boot Error !"

          print "The board will restart."

         

          #os.system('killall -15 python')

          qnt = POINTER_READ('tentativas_boot.txt')

          print 'incrementa o boot'

          qnt = qnt + 1

          POINTER_SAVE('tentativas_boot.txt',qnt)

          #os.system('reboot')

       

      So, What I think it's happening is that the function "check_ftdi()" is not mounting the ttyUSB0 and ttyUSB1, wich is the pinout for the XBee, and the application is not starting. If anyone could at least help me HOW to find a correction for this issue would be amazing!

        • 1. Re: Edison doesn't mount ttyUSB0 and ttyUSB1
          FerryT

          Maybe you can tell us a bit more on what you are connecting exactly?

           

          But I guess if you login into the Edison and type `ls /dev/ttyUSB*` there is nothing?

           

          Afaik the ftdi driver is not built into the Edison factory kernel. You need to build a new kernel and replace the existing, or rebuild the whole image.

           

          I have a Yocto meta-intel-edison layer GitHub - htot/meta-intel-edison at dizzy-uptodate  that should build a new image similar to what you have.

           

          Also the Master branch (currently Rocko) would allow you to run newer kernel and rootfs and already has built ftdi driver built-in. But I think you are running sketches? I haven't tried all that, so that probably needs work. But you can try Rocko by installing on a sd card or usb stick.

          • 2. Re: Edison doesn't mount ttyUSB0 and ttyUSB1
            FocaaBR

            Hi FerryT,

            I am connecting a XBee antenna to communicate with another mcu throug zigbee protocol.

             

            I tried it in another office and the usb0 and usb1 was showed but when I get into my office this is not working.

             

            When I ran "ls /dev/tty" it shows:

             

            tty      tty17    tty26    tty35    tty44    tty53    tty62    ttyMFD1

            tty0     tty18    tty27    tty36    tty45    tty54    tty63    ttyMFD2

            tty1     tty19    tty28    tty37    tty46    tty55    tty7     ttyPTI0

            tty10    tty2     tty29    tty38    tty47    tty56    tty8     ttyPTI1

            tty11    tty20    tty3     tty39    tty48    tty57    tty9

            tty12    tty21    tty30    tty4     tty49    tty58    ttyGS0

            tty13    tty22    tty31    tty40    tty5     tty59    ttymcu0

            tty14    tty23    tty32    tty41    tty50    tty6     ttymcu1

            tty15    tty24    tty33    tty42    tty51    tty60    ttymcu2

            tty16    tty25    tty34    tty43    tty52    tty61    ttyMFD0

             

            When I ran "ls /dev" it shows:

             

            autofs           loop7               ram0       tty12  tty41    ttyMFD0

            block            loop-control        ram1       tty13  tty42    ttyMFD1

            char             MAKEDEV             ram10      tty14  tty43    ttyMFD2

            console          mcelog              ram11      tty15  tty44    ttyPTI0

            cpu              mem                 ram12      tty16  tty45    ttyPTI1

            cpu_dma_latency  mid_ipc             ram13      tty17  tty46    uhid

            disk             mmcblk0             ram14      tty18  tty47    uinput

            fd               mmcblk0boot0        ram15      tty19  tty48    urandom

            full             mmcblk0boot1        ram2       tty2   tty49    usbmon0

            fuse             mmcblk0p1           ram3       tty20  tty5     vcs

            i2c-1            mmcblk0p10          ram4       tty21  tty50    vcs1

            i2c-2            mmcblk0p2           ram5       tty22  tty51    vcs2

            i2c-3            mmcblk0p3           ram6       tty23  tty52    vcs3

            i2c-4            mmcblk0p4           ram7       tty24  tty53    vcs4

            i2c-5            mmcblk0p5           ram8       tty25  tty54    vcs5

            i2c-6            mmcblk0p6           ram9       tty26  tty55    vcs6

            i2c-7            mmcblk0p7           random     tty27  tty56    vcsa

            i2c-8            mmcblk0p8           rfkill     tty28  tty57    vcsa1

            iio:device0      mmcblk0p9           root       tty29  tty58    vcsa2

            iio:device1      mmcblk0rpmb         rtc        tty3   tty59    vcsa3

            input            mmcblk1             rtc0       tty30  tty6     vcsa4

            intel_sst_ctrl   mmcblk1p1           shm        tty31  tty60    vcsa5

            kmem             net                 snd        tty32  tty61    vcsa6

            kmsg             network_latency     spidev5.1  tty33  tty62    vga_arbiter

            log              network_throughput  stderr     tty34  tty63    watchdog

            loop0            null                stdin      tty35  tty7     xconsole

            loop1            nvram               stdout     tty36  tty8     zero

            loop2            port                tty        tty37  tty9

            loop3            ppp                 tty0       tty38  ttyGS0

            loop4            pti                 tty1       tty39  ttymcu0

            loop5            ptmx                tty10      tty4   ttymcu1

            loop6            pts                 tty11      tty40  ttymcu2

             

            I need the USB0 and USB1 to be listed to correctly boot my OS and run my application.

            • 3. Re: Edison doesn't mount ttyUSB0 and ttyUSB1
              FerryT

              Yeah, I get that.

               

              Afaik the XBee modules have a TTL serial port. The Edison has a host USB port (if that's how you interconnect them). In between is probably a usb to serial converter, possible a ftdi (guessing from your code).

               

              Like any PC, Edison requires a driver for anything connected to the usb port. For linux in general the driver needs to be compiled into the kernel (or built as a module while building the kernel).

               

              In Ubuntu the ftdi driver is already built-in, on Edison not.

               

              To be sure which driver you need, try `lsusb`

               

              (but most likely, you will need to build a kernel to get this working, which is not as hard as it sounds)