Plug and pray Linux USB serial ports

Finicky USB ports in Linux system

After adding the new 30m radio and SCS Tracker to the Linux system, after a while we find these entries in the syslog file…

Nov 18 12:59:12 vapn kernel: [395548.125563] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22
Nov 18 12:59:13 vapn kernel: [395548.628419] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22
Nov 18 12:59:13 vapn kernel: [395549.131396] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22
Nov 18 12:59:14 vapn kernel: [395549.634326] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22
Nov 18 12:59:15 vapn kernel: [395550.137195] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22
Nov 18 12:59:15 vapn kernel: [395550.640148] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22
Nov 18 12:59:16 vapn kernel: [395551.143034] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22
Nov 18 12:59:16 vapn kernel: [395551.646006] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22
Nov 18 12:59:17 vapn kernel: [395552.148926] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22
Nov 18 12:59:17 vapn kernel: [395552.651771] ftdi_sio ttyUSB0: usb_serial_generic_write_start - error submitting urb: -22

The 30m port becomes no longer responsive and only a reboot returns things to normal.

Searching for the terms “Linux” and “USB” and “problems” on Google reveals we are not alone in our troubles with USB connection reliability.

How we got it working

This section highlights a solution that seems to be addressing the problem with the failing USB port connection to the VAPN 30m port TNC. We simply swapped the USB cable of the 30m SCS Tracker and the system keyboard and now it appears to work. Here are some details of the device names before the switch…

nodeu@vapn:~$ ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Nov 14 14:26 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Nov 18 13:01 /dev/ttyUSB1
nodeu@vapn:~$ ls -l /dev/tnc*
lrwxrwxrwx 1 root root 7 Nov 13 23:12 /dev/tnc-02m -> ttyUSB1
lrwxrwxrwx 1 root root 7 Nov 13 23:12 /dev/tnc-30m -> ttyUSB0

…and after…

nodeu@vapn:~$ ls -l /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Nov 18 13:26 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Nov 18 13:26 /dev/ttyUSB1
nodeu@vapn:~$ ls -l /dev/tnc*
lrwxrwxrwx 1 root root 7 Nov 18 13:06 /dev/tnc-02m -> ttyUSB0
lrwxrwxrwx 1 root root 7 Nov 18 13:06 /dev/tnc-30m -> ttyUSB1

As you can see the boot order changed, but the udev links followed correctly based on TNC serial number… confirmed by manually beaconing each port. This is all interesting, but the following is more so. Here is lsusb before…

nodeu@vapn:~$ lsusb
Bus 001 Device 006: ID 0557:2419 ATEN International Co., Ltd
Bus 001 Device 005: ID 0557:7000 ATEN International Co., Ltd Hub
Bus 001 Device 004: ID 046d:c317 Logitech, Inc. Wave Corded Keyboard
Bus 001 Device 003: ID 0403:d011 Future Technology Devices International, Ltd SCS Position-Tracker/TNC
Bus 001 Device 002: ID 8087:07db Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 0403:d011 Future Technology Devices International, Ltd SCS Position-Tracker/TNC
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

…and after…

nodeu@vapn:~$ lsusb
Bus 001 Device 006: ID 0557:2419 ATEN International Co., Ltd
Bus 001 Device 005: ID 0557:7000 ATEN International Co., Ltd Hub
Bus 001 Device 004: ID 0403:d011 Future Technology Devices International, Ltd SCS Position-Tracker/TNC
Bus 001 Device 003: ID 0403:d011 Future Technology Devices International, Ltd SCS Position-Tracker/TNC
Bus 001 Device 002: ID 8087:07db Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 046d:c317 Logitech, Inc. Wave Corded Keyboard
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The big difference is both SCS Trackers are now under Bus 001 while the keyboard is now under Bus 002. We have not the first clue why this should change reliability, but so far the latter scenario has been rock solid.

Conclusion

No conclusion yet. One significant selling point of USB is its almost hands off plug and play capabilities. The scorecard with Linux is still pretty fantastic, but USB management appears to be a weak point making USB on Linux a plug and pray affair. We sure wish we knew why the above later USB port switcheroo works and the former doesn’t but now we can at least move forward while wearing expressions of concern.

Not quite a match made in heaven yet.
Not quite a match made in heaven yet.

Image courtesy Wikipedia and SevenBits.