sjjh
Posts: 11
Joined: Thu Aug 30, 2018 2:32 pm

How to debug unstable USB connection?

Fri Jul 26, 2019 10:32 am

Hi, looking for help. We're using a raspi running weewx to collect weather data from a weather station connected via a serial-usb data logger cable. We keep losing the USB connection to the weather station (sometimes even the LAN connection breaks). We can find many lines like these in /var/log/syslog:

Code: Select all

Jul 26 07:28:49 hostname kernel: [53857.553399] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 07:28:49 hostname kernel: [53857.553512] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 07:28:53 hostname kernel: [53861.110423] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:28:57 hostname kernel: [53865.115286] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:01 hostname kernel: [53869.120031] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:05 hostname kernel: [53873.124908] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:09 hostname kernel: [53877.129798] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:13 hostname kernel: [53881.134782] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:17 hostname kernel: [53885.139410] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:21 hostname kernel: [53889.144038] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:25 hostname kernel: [53893.149551] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:29 hostname kernel: [53897.154162] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:33 hostname kernel: [53901.158784] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:37 hostname kernel: [53905.163410] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:29:41 hostname kernel: [53909.190914] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Jul 26 07:30:12 hostname kernel: [53939.749300] ftdi_sio ttyUSB0: failed to get modem status: -32
Jul 26 07:30:12 hostname kernel: [53939.749521] ftdi_sio ttyUSB0: error from flowcontrol urb
Jul 26 07:31:12 hostname kernel: [53999.885413] ftdi_sio ttyUSB0: ftdi_set_termios FAILED to set databits/stopbits/parity
Jul 26 07:31:12 hostname kernel: [53999.885651] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
Jul 26 07:31:12 hostname kernel: [53999.885781] ftdi_sio ttyUSB0: failed to set flow control: -32
Jul 26 07:31:12 hostname kernel: [53999.885900] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 07:31:12 hostname kernel: [53999.886021] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 07:31:12 hostname kernel: [53999.886667] ftdi_sio ttyUSB0: failed to set flow control: -32
Jul 26 07:31:12 hostname kernel: [53999.887533] ftdi_sio ttyUSB0: failed to get modem status: -32
Jul 26 07:31:12 hostname kernel: [53999.887773] ftdi_sio ttyUSB0: error from flowcontrol urb

Code: Select all

Jul 26 10:33:35 hostname kernel: [64943.238415] ftdi_sio ttyUSB0: ftdi_set_termios FAILED to set databits/stopbits/parity
Jul 26 10:33:35 hostname kernel: [64943.238530] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
Jul 26 10:33:35 hostname kernel: [64943.238655] ftdi_sio ttyUSB0: failed to set flow control: -32
Jul 26 10:33:35 hostname kernel: [64943.238782] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 10:33:35 hostname kernel: [64943.238902] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 10:33:35 hostname kernel: [64943.239156] ftdi_sio ttyUSB0: failed to set flow control: -32
Jul 26 10:33:35 hostname kernel: [64943.239792] ftdi_sio ttyUSB0: failed to get modem status: -32
Jul 26 10:33:35 hostname kernel: [64943.239906] ftdi_sio ttyUSB0: error from flowcontrol urb
Jul 26 10:33:51 hostname kernel: [64959.006540] ftdi_sio ttyUSB0: ftdi_set_termios FAILED to set databits/stopbits/parity
Jul 26 10:33:51 hostname kernel: [64959.006655] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
Jul 26 10:33:51 hostname kernel: [64959.006780] ftdi_sio ttyUSB0: failed to set flow control: -32
Jul 26 10:33:51 hostname kernel: [64959.006906] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 10:33:51 hostname kernel: [64959.007031] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 10:33:51 hostname kernel: [64959.007293] ftdi_sio ttyUSB0: failed to set flow control: -32
Jul 26 10:33:51 hostname kernel: [64959.036331] ftdi_sio ttyUSB0: failed to get modem status: -32
Jul 26 10:33:51 hostname kernel: [64959.036531] ftdi_sio ttyUSB0: error from flowcontrol urb
Jul 26 10:33:53 hostname kernel: [64961.433167] ftdi_sio ttyUSB0: ftdi_set_termios FAILED to set databits/stopbits/parity
Jul 26 10:33:53 hostname kernel: [64961.433280] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
Jul 26 10:33:53 hostname kernel: [64961.433405] ftdi_sio ttyUSB0: failed to set flow control: -32
Jul 26 10:33:53 hostname kernel: [64961.433532] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 10:33:53 hostname kernel: [64961.433653] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Jul 26 10:33:53 hostname kernel: [64961.434444] ftdi_sio ttyUSB0: failed to set flow control: -32
Jul 26 10:33:53 hostname kernel: [64961.450585] ftdi_sio ttyUSB0: failed to get modem status: -32
Jul 26 10:33:53 hostname kernel: [64961.450782] ftdi_sio ttyUSB0: error from flowcontrol urb
Beside the massive instability, the connection works and lsusb recognices the device:

Code: Select all

pi@hostname:~ $ lsusb 
Bus 001 Device 004: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
Bus 001 Device 005: ID 0424:7800 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
We're using an 2.1A power supply.
Any idea how to find the root cause? Thx for help!
Simon

PS: If the topic fits better into the projects or HW & peripherals category feel free to move it. :)

sjjh
Posts: 11
Joined: Thu Aug 30, 2018 2:32 pm

Re: How to debug unstable USB connection?

Tue Aug 06, 2019 6:54 pm

We exchanged the RasPi with another one, which first seemed to work more stable, but today failed again with the same/similar error messages:

Code: Select all

Aug  6 17:24:00 hostname kernel: [501425.574816] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Aug  6 17:24:04 hostname kernel: [501429.579661] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Aug  6 17:24:08 hostname kernel: [501433.584409] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Aug  6 17:24:12 hostname kernel: [501437.589162] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Aug  6 17:24:16 hostname kernel: [501441.625560] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Aug  6 17:24:46 hostname kernel: [501471.769801] ftdi_sio ttyUSB0: failed to get modem status: -32
Aug  6 17:24:46 hostname kernel: [501471.770025] ftdi_sio ttyUSB0: error from flowcontrol urb
Aug  6 17:25:46 hostname kernel: [501531.906303] ftdi_sio ttyUSB0: ftdi_set_termios FAILED to set databits/stopbits/parity
Aug  6 17:25:46 hostname kernel: [501531.906532] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
Aug  6 17:25:46 hostname kernel: [501531.906659] ftdi_sio ttyUSB0: failed to set flow control: -32
Aug  6 17:25:46 hostname kernel: [501531.906806] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Aug  6 17:25:46 hostname kernel: [501531.907015] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Aug  6 17:25:46 hostname kernel: [501531.907410] ftdi_sio ttyUSB0: failed to set flow control: -32
Aug  6 17:25:46 hostname kernel: [501531.908162] ftdi_sio ttyUSB0: failed to get modem status: -32
Aug  6 17:25:46 hostname kernel: [501531.908401] ftdi_sio ttyUSB0: error from flowcontrol urb
Does anybody have an idea?

sjjh
Posts: 11
Joined: Thu Aug 30, 2018 2:32 pm

Re: How to debug unstable USB connection?

Mon Aug 12, 2019 5:49 am

With an older Raspberry Pi 1 Model B the problem seems to be very similar (only difference appears to be that it looses the connection even more to than recognise the device as a new one):

Code: Select all

Aug 11 21:25:15 hostname kernel: [122765.260665] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Aug 11 21:25:15 hostname kernel: [122765.260740] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Aug 11 21:25:16 hostname kernel: [122765.452215] usb 1-1.3: USB disconnect, device number 5
Aug 11 21:25:16 hostname kernel: [122765.452670] ftdi_sio ttyUSB0: error from flowcontrol urb
Aug 11 21:25:16 hostname kernel: [122765.462042] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
Aug 11 21:25:16 hostname kernel: [122765.462244] ftdi_sio 1-1.3:1.0: device disconnected
Aug 11 21:25:16 hostname kernel: [122765.765374] usb 1-1.3: new full-speed USB device number 6 using dwc_otg
Aug 11 21:25:16 hostname kernel: [122765.924610] usb 1-1.3: New USB device found, idVendor=0403, idProduct=6015, bcdDevice=10.00
Aug 11 21:25:16 hostname kernel: [122765.924637] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 11 21:25:16 hostname kernel: [122765.924652] usb 1-1.3: Product: FT231X USB UART
Aug 11 21:25:16 hostname kernel: [122765.924664] usb 1-1.3: Manufacturer: FTDI
Aug 11 21:25:16 hostname kernel: [122765.924675] usb 1-1.3: SerialNumber: DN04ZJ83
Aug 11 21:25:16 hostname kernel: [122765.938545] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
Aug 11 21:25:16 hostname kernel: [122765.938866] usb 1-1.3: Detected FT-X
Aug 11 21:25:16 hostname kernel: [122765.940297] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB1
Still any help appreciated. :)

sjjh
Posts: 11
Joined: Thu Aug 30, 2018 2:32 pm

Re: How to debug unstable USB connection?

Sun Nov 10, 2019 10:53 pm

Just to exclude power issues as a root cause, we now tried with a powered USB hub. That worked for about a day, then it failed again. See error messages below:

Code: Select all

Nov 10 19:56:33 hostname kernel: [117339.062853] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Nov 10 19:56:33 hostname kernel: [117339.063051] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Nov 10 19:56:37 hostname kernel: [117342.660231] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:56:41 hostname kernel: [117346.664991] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:56:45 hostname kernel: [117350.670874] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:56:49 hostname kernel: [117354.676763] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:56:53 hostname kernel: [117358.688530] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:56:57 hostname kernel: [117362.694336] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:57:01 hostname kernel: [117366.700164] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:57:05 hostname kernel: [117370.706029] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:57:09 hostname kernel: [117374.712563] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:57:13 hostname kernel: [117378.718453] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:57:17 hostname kernel: [117382.724207] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:57:21 hostname kernel: [117386.729964] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:57:25 hostname kernel: [117390.811610] ftdi_sio ttyUSB0: usb_serial_generic_write_bulk_callback - urb stopped: -32
Nov 10 19:57:25 hostname kernel: [117390.812661] ftdi_sio ttyUSB0: failed to get modem status: -32
Nov 10 19:57:25 hostname kernel: [117390.812988] ftdi_sio ttyUSB0: error from flowcontrol urb
Nov 10 19:58:26 hostname kernel: [117451.387649] ftdi_sio ttyUSB0: ftdi_set_termios FAILED to set databits/stopbits/parity
Nov 10 19:58:26 hostname kernel: [117451.387987] ftdi_sio ttyUSB0: ftdi_set_termios urb failed to set baudrate
Nov 10 19:58:26 hostname kernel: [117451.388353] ftdi_sio ttyUSB0: failed to set flow control: -32
Nov 10 19:58:26 hostname kernel: [117451.388604] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Nov 10 19:58:26 hostname kernel: [117451.388689] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
Nov 10 19:58:26 hostname kernel: [117451.389912] ftdi_sio ttyUSB0: failed to set flow control: -32
Nov 10 19:58:26 hostname kernel: [117451.396432] ftdi_sio ttyUSB0: failed to get modem status: -32
Nov 10 19:58:26 hostname kernel: [117451.396731] ftdi_sio ttyUSB0: error from flowcontrol urb
Nov 10 20:43:35 hostname kernel: [120161.038944] usb 1-1.3-port3: disabled by hub (EMI?), re-enabling...
Nov 10 20:43:35 hostname kernel: [120161.039369] usb 1-1.3.3: USB disconnect, device number 11
Nov 10 20:43:35 hostname kernel: [120161.052812] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
Nov 10 20:43:35 hostname kernel: [120161.053084] ftdi_sio 1-1.3.3:1.0: device disconnected
Nov 10 20:43:36 hostname kernel: [120161.352675] usb 1-1.3.3: new full-speed USB device number 12 using dwc_otg
Nov 10 20:43:36 hostname kernel: [120161.452695] usb 1-1.3.3: device descriptor read/64, error -32
Nov 10 20:43:36 hostname kernel: [120161.672679] usb 1-1.3.3: device descriptor read/64, error -32
Nov 10 20:43:36 hostname kernel: [120161.892693] usb 1-1.3.3: new full-speed USB device number 13 using dwc_otg
Nov 10 20:43:36 hostname kernel: [120161.992695] usb 1-1.3.3: device descriptor read/64, error -32
Nov 10 20:43:36 hostname kernel: [120162.212728] usb 1-1.3.3: device descriptor read/64, error -32
Nov 10 20:43:36 hostname kernel: [120162.333108] usb 1-1.3-port3: attempt power cycle
Nov 10 20:43:37 hostname kernel: [120162.992731] usb 1-1.3.3: new full-speed USB device number 14 using dwc_otg
Nov 10 20:43:38 hostname kernel: [120163.432769] usb 1-1.3.3: device not accepting address 14, error -32
Nov 10 20:43:38 hostname kernel: [120163.532772] usb 1-1.3.3: new full-speed USB device number 15 using dwc_otg
Nov 10 20:43:38 hostname kernel: [120163.972787] usb 1-1.3.3: device not accepting address 15, error -32
Nov 10 20:43:38 hostname kernel: [120163.973227] usb 1-1.3-port3: unable to enumerate USB device
Still looking for any help! :roll: thx in advance!

User avatar
HawaiianPi
Posts: 4750
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: How to debug unstable USB connection?

Sun Nov 10, 2019 11:23 pm

sjjh wrote:
Fri Jul 26, 2019 10:32 am
We're using an 2.1A power supply.
Which model Raspberry Pi?

What else is connected to it?

What kind of "power supply" is that (is it a phone charger)?

More information about how your system is interconnected might be helpful...
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

sjjh
Posts: 11
Joined: Thu Aug 30, 2018 2:32 pm

Re: How to debug unstable USB connection?

Mon Nov 11, 2019 10:20 pm

Thanks for your reply!
HawaiianPi wrote:
Sun Nov 10, 2019 11:23 pm
Which model Raspberry Pi?
At the beginning two different Raspberry Pi 3 Model B+. Currently as stated a Raspberry Pi 1 Model B.
HawaiianPi wrote:
Sun Nov 10, 2019 11:23 pm
What else is connected to it?
Nothing except an ethernet cable.
HawaiianPi wrote:
Sun Nov 10, 2019 11:23 pm
What kind of "power supply" is that (is it a phone charger)?
It should actually be a OTB-R07-0525 by OTB Onni-Tec GmbH, rated as 5V DC 2.5A. Not sure what additional information I can deliver.
HawaiianPi wrote:
Sun Nov 10, 2019 11:23 pm
More information about how your system is interconnected might be helpful...
There's actually not much more. :) Just the Raspberry Pi, connected to power, ethernet and the USB data logger which is connected to the weather station (Davis Vantage Pro 2). At the moment, as written in my last post, the data logger is connected to a powered USB hub which itself is connected to the Raspberry Pi. Feel free to ask for more information, and thanks for your help.

Return to “Troubleshooting”