Sample Header Ad - 728x90

udev rules for USB serial 'by path' not working

2 votes
1 answer
13331 views
I have more than 2 serial devices enumerated by FTDI driver as /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2 etc. On reboot, these may get jumbled up in any other order. Also, I may replace/swap these devices physically among these or with some other similar device. Now, I want a persistent enumeration for these. I want the device names to be enumerated according to the physical USB port (I may connect to the USB ports on the motherboard of the PC directly or use a USB hub) that the device is connected to - say if the devices are connected to the USB hub, port 1 should be reserved to named as ttyUSB0, port 2 as ttyUSB1 and so on. After some basic reading, I figured (as mentioned [here](https://unix.stackexchange.com/questions/68588/fixed-udev-rules-for-usb-modems)) that /dev/serial/by-path/ lists the devices as sort of a symlink. So, I created a file /etc/udev/rules.d/101-usb-serial.rules with the following: KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", DRIVERS=="ftdi_sio", PATH=="pci-0000:00:14.0-usb-0:10.1:1.0", SYMLINK+="ttyUSB000" KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", DRIVERS=="ftdi_sio", PATH=="pci-0000:00:14.0-usb-0:10.2:1.0", SYMLINK+="ttyUSB001" KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", DRIVERS=="ftdi_sio", PATH=="pci-0000:00:14.0-usb-0:10.3:1.0", SYMLINK+="ttyUSB002" But this doesn't work. On doing ls /dev/ttyUSB* I'm unable to see the new symlinks I have created. What could possibly be going wrong?
Asked by skrowten_hermit (791 rep)
Sep 11, 2019, 11:52 AM
Last activity: Jul 12, 2023, 09:52 AM