title: "FTDI USB Serial Device converter now disconnected" issue with docker and arm
body: <p>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).</p>
  
  <p>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.</p>
  
  <p>uname -a gives me:</p>
  
  <pre><code>Linux host-test 4.14.15-sunxi #28 SMP Mon Jan 29 07:24:48 CET 2018 armv7l GNU/Linux
  </code></pre>
  
  <p>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):</p>
  
  <pre><code>[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
  </code></pre>
  
  <p>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 <em>rmmod</em> both "ftdi_sio" and "usbserial" and <em>modprobe</em> them again, but nothing changes. The only way to fix it is to reboot the board.</p>
  
  <ul>
  <li><p>I am experimenting a lot with modules like pylibftdi, vpc drivers vs d2xx ones, etc...without luck.</p></li>
  <li><p>I also use the same SW on a Nanopi NEO PLUS2 (emmc, armv8 64bit, <em>Linux host-test 4.14.0 #82 SMP Fri Dec 8 14:33:14 CST 2017 aarch64 aarch64 aarch64 GNU/Linux</em>) and I have an identical issues...all ok without docker, similar issue happens when using docker (slightly different dmesg).</p></li>
  <li><p>My docker-compose is nothing special, it just maps the serial port with "devices: - /dev/ttyUSB0:/dev/ttyUSB0"</p></li>
  </ul>
  
  <p><strong>Question</strong></p>
  
  <p>Does anyone have a clue on how to solve this big problem that is completely stalling my work?</p>
  
  <p><strong>Extra (quick and dirty)</strong></p>
  
  <p>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?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>For the sake of completeness, here is the error (dmesg) in the Nanopi:</p>
  
  <pre><code>[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
  </code></pre>