11

I am using an Orange Pi PC PLUS2 (emmc memory, arv7l 32bit) for controlling another device through a serial connection (RS485) with a serial converter that uses FTDI chips (sparkfun bob 09822).

I am using docker containers and docker-compose to embed my application and easily deploy/share it. It doesn't do anything too complex, just reads continuously (1 per half second) values from sensors through the rs485, stores it in a local db and sends data to my server.

uname -a gives me:

Linux host-test 4.14.15-sunxi #28 SMP Mon Jan 29 07:24:48 CET 2018 armv7l GNU/Linux

If I run my SW outside docker, everything is working fine, I don't experience any crash after weeks. Problem is that if I use docker, within a couple of days I get the following error (dmesg):

[135431.500807] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
[137213.011801] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
[138650.664850] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
[140559.020691] ohci-platform 1c1b400.usb: frame counter not updating; disabled
[140559.020972] ohci-platform 1c1b400.usb: HC died; cleaning up
[140559.025797] usb 6-1: USB disconnect, device number 2
[140560.099001] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
[140560.099018] ftdi_sio ttyUSB0: urb failed to clear flow control
[140560.099652] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[140560.099738] ftdi_sio 6-1:1.0: device disconnected

After that I can't use the serial converter anymore. It does not appear on ttyUSB0 and I don't manage to make it work again. I tried to rmmod both "ftdi_sio" and "usbserial" and modprobe them again, but nothing changes. The only way to fix it is to reboot the board.

  • I am experimenting a lot with modules like pylibftdi, vpc drivers vs d2xx ones, etc...without luck.

  • I also use the same SW on a Nanopi NEO PLUS2 (emmc, armv8 64bit, Linux host-test 4.14.0 #82 SMP Fri Dec 8 14:33:14 CST 2017 aarch64 aarch64 aarch64 GNU/Linux) and I have an identical issues...all ok without docker, similar issue happens when using docker (slightly different dmesg).

  • My docker-compose is nothing special, it just maps the serial port with "devices: - /dev/ttyUSB0:/dev/ttyUSB0"

Question

Does anyone have a clue on how to solve this big problem that is completely stalling my work?

Extra (quick and dirty)

At least, just as a temporary patch, does anyone have any idea how to restore the serial line without rebooting and wants to provide me a hint on the comments?

Edit

For the sake of completeness, here is the error (dmesg) in the Nanopi:

[159155.585672] ohci-platform 1c1d400.usb: frame counter not updating; disabled
[159155.593147] ohci-platform 1c1d400.usb: HC died; cleaning up
[159155.600959] usb 8-1: USB disconnect, device number 2
[159156.608522] ftdi_sio ttyUSB0: ftdi_set_termios FAILED to set databits/stopbits/parity
[159156.616559] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
[159156.623461] ftdi_sio ttyUSB0: urb failed to clear flow control
[159156.629832] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[159156.629907] ftdi_sio 8-1:1.0: device disconnected
Bertone
  • 756
  • 2
  • 9
  • 23
  • May be your tty port is busy. Check it (command `ps -ef | grep tty` will display for all tty ports), if needed port is busy, try to kill appropriate process, or use another port: e.g `devices: - /dev/ttyUSB1:/dev/ttyUSB0`. After changes don't miss to rebuild containers e.g. `docker-compose up -d --build` – Taron Saribekyan Feb 15 '18 at 06:44
  • Unfortunately that is not the case. I already tried that approach and the really frustrating part is that the port itself gets disconnected and cannot be seen anymore unless I perform a reboot! Changing port has no effect either. – Bertone Feb 17 '18 at 16:53
  • Does the device appears again if being plugged/unplugged on host running docker? Not necessary ttyUSB0 - maybe ttyUSB1... etc? – Maquefel Feb 20 '18 at 10:02
  • Any solution to this problem? I have same problem with the ftdi device on ubuntu 18.04.4 – user3862410 May 11 '20 at 13:55

1 Answers1

18

try sudo apt-get remove brltty

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
4eax4m
  • 189
  • 1
  • 5
  • 2
    Please add some explanation to the answer about what this will do and how it will solve this problem. – Jason Aller May 25 '20 at 02:48
  • @Jason Sorry I was too hasty, I am mainly an observer and learner here so I probably should not have posted this. I was having the same problem, as described above, with my Debian Buster setup. I found a discussion of this issue in a Debian bug report, #667616, dating back to 2012. Removing the brltty package, installed by default on my setup, seems to have corrected the problem. I gather the Orange Pi runs a Debian distribution, I was only trying to suggest the problem discussed above might be fixed by removing the brltty package if it's part of the default Orange Pi setup. – 4eax4m May 29 '20 at 11:55
  • 1
    Worked for me: `ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0` regarding this issue – Yvan Pearson Jul 21 '22 at 18:11
  • what does this have to do with the question? – Shōgun8 Mar 10 '23 at 00:00