HOME ESR EXPERIMENTS LABS etc
overview Control System beam optics AP-network Vacuum NORTH ARC SOUTH ARC COOLER LINE TARGET LINE INJECTION
  AP/ESR internal privat network  Not logged in ELOG logo
Message ID: 6     Entry time: Thu Jan 28 10:12:21 2021
Author: Jan 
Category: General 
Subject: debain10: static name for USB device 
When using USB/serial ports for slow control, it is advisable to manually bind a certain device to a certain device name.
This is the procedure:

1. connect the device and check the current assignment:
sudo dmesg
the device might be connected as /dev/ttyUSB0 or similar

2. check the device attributes:
udevadm info --name=/dev/ttyUSB0 --attribute-walk
note unique attributes, e.g., ATTRS{idVendor}=="XXXX" and ATTRS{idProduct}=="YYYY" or ATTRS{serial}=="ZZZZ" and others

3. add a new local rule:
sudo nano /etc/udev/rules.d/10-local.rules
add the a line as:
ACTION=="add", ATTRS{idVendor}=="XXXX", ATTRS{idProduct}=="YYYY", SYMLINK+="my_device_name"

4. reload the rules:
sudo udevadm trigger

5. check and reset usb:
lsusb
check again your device, look for PRODUCT_ID:VENDOR_ID, then reset:
usbreset PRODUCT_ID:VENDOR_ID

5. verify
udevadm info /dev/ttyUSB0
this should show at the end:
E: DEVLINKS=/dev/my_device_name
and probably some more DEVLINKS in the same line
so
udevadm info /dev/my_device_name
should also work
ELOG V3.1.5-fc6679b