Skip to content

Instantly share code, notes, and snippets.

@sven-bock
Last active February 28, 2019 16:00
Show Gist options
  • Save sven-bock/56f4e6548a9d9d24312bf573a1056b91 to your computer and use it in GitHub Desktop.
Save sven-bock/56f4e6548a9d9d24312bf573a1056b91 to your computer and use it in GitHub Desktop.
Setting a fixed port (with a simlink) to a USB device (udev/rules)
#Example:
#get some info with:
udevadm info -a -n /dev/ttyUSB0 | grep serial
udevadm info -a -n /dev/ttyUSB0 | grep idProduct
udevadm info -a -n /dev/ttyUSB0 | grep idVendor
#or
udevadm info -a -n /dev/ttyUSB0 | grep -E 'idVendor|idProduct|serial'
#setup a udev rule in /etc/udev/rules.d/99-usb.rules
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="12345", SYMLINK+="ttyLaser"
#reload udev rules
udevadm control --reload-rules && udevadm trigger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment