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
try sudo apt-get remove brltty
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With