Close

Restart ttyUSB* on Linux

The below seems to solve problem, but not always.

Find the driver associated to your ttyUSBx device.

user@host:/# sudo cat /proc/tty/drivers
 /dev/tty             /dev/tty        5       0 system:/dev/tty
 /dev/console         /dev/console    5       1 system:console
 /dev/ptmx            /dev/ptmx       5       2 system
 /dev/vc/0            /dev/vc/0       4       0 system:vtmaster
 usbserial            /dev/ttyUSB   188 0-511 serial
 ttyAMA               /dev/ttyAMA   204 64-77 serial
 ttyprintk            /dev/ttyprintk   5       3 console
 pty_slave            /dev/pts      136 0-1048575 pty:slave
 pty_master           /dev/ptm      128 0-1048575 pty:master
 unknown              /dev/tty        4 1-63 console

/dev/ttyUSB uses usbserial. Now dig a little further:

user@host:/# sudo lsmod | grep usbserial
usbserial              40960  1 ftdi_sio   (USB-to-serial converter is a Prolific FTDI)

or

usbserial              37173  1 pl2303   (USB-to-serial converter is a Prolific PL2303) 

Find the identity of USB device:

user@host:/# sud ls -l /sys/bus/usb/drivers/ftdi_sio/
 total 0
 lrwxrwxrwx 1 root root    0 Dec  6 13:07 1-1.5:1.0 -> ../../../../devices/platform/soc/20980000.usb/usb1/1-1/1-1.5/1-1.5:1.0
 --w------- 1 root root 4096 Dec  6 13:07 bind
 lrwxrwxrwx 1 root root    0 Dec  6 13:07 module -> ../../../../module/usbserial
 --w------- 1 root root 4096 Dec  6 13:07 uevent
 --w------- 1 root root 4096 Dec  6 13:07 unbind

So  1-1.5:1.0 is the identifier of ttyUSB0

Disconnect the device:

user@host:/# sudo echo -n "1-1.5:1.0" > /sys/bus/usb/drivers/ftdi_sio/unbind

or

user@host:/# sudo echo -n "1-1:1.1" > /sys/bus/usb/drivers/cp210x/unbind

Unload the driver:

user@host:/#  sudo modprobe -r ftdi_sio  # or pl2303
user@host:/#  sudo modprobe -r usbserial

Re-load the driver:

user@host:/# sudo modprobe  ftdi_sio #or pl2303

Reconnect it:

user@host:/# sudo echo -n " 1-1.5:1.0 " > /sys/bus/usb/drivers/ftdi_sio/bind

or

user@host:/# echo -n "1-1:1.1" > /sys/bus/usb/drivers/cp210x/bind

scroll to top