Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 960 Bytes

usb-and-udev.md

File metadata and controls

47 lines (32 loc) · 960 Bytes

usb and udev

get info from usb device

lsbusb -t

retrieve all variables belonging a device, ie /dev/ttyUSB0 to build a rule

udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0)

and

udevadm -n /dev/ttyUSB --attribute-walk

example rule

KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="ttyUSB-$attr{devpath}"

generates two different by usb path ( physical port ) devices for the same vid, pid

lrwxrwxrwx 1 root root         7 gen 15 00:23 /dev/ttyUSB-4 -> ttyUSB0
lrwxrwxrwx 1 root root         7 gen 15 00:23 /dev/ttyUSB-5 -> ttyUSB1

reload udev

udevadm control --reload-rules ; udevadm trigger

other refs