Thanks for the reply and for the pointer to
udevdm. I do not think that I need to modify rules; I also find it a little risky as I don't have experience with them (if that is what you suggested)
I however found a way. What I know about the devices is that they are always /dev/ttyACMx. So for starters I came up with the below which basically gives me all required info
Code:
for device in /dev/ttyACM*; do udevadm info --name $device; done
The output for ttyACM1
Code:
P: /devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5.4/1-5.4.2/1-5.4.2:1.0/tty/ttyACM1
N: ttyACM1
S: serial/by-id/usb-SparkFun_SparkFun_Pro_Micro22-if00
S: serial/by-path/pci-0000:00:1d.7-usb-0:5.4.2:1.0
E: DEVLINKS=/dev/serial/by-id/usb-SparkFun_SparkFun_Pro_Micro22-if00 /dev/serial/by-path/pci-0000:00:1d.7-usb-0:5.4.2:1.0
E: DEVNAME=/dev/ttyACM1
E: DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb1/1-5/1-5.4/1-5.4.2/1-5.4.2:1.0/tty/ttyACM1
E: ID_BUS=usb
E: ID_MODEL=SparkFun_Pro_Micro22
E: ID_MODEL_ENC=SparkFun\x20Pro\x20Micro22
E: ID_MODEL_FROM_DATABASE=NM10/ICH7 Family USB2 EHCI Controller
E: ID_MODEL_ID=9204
E: ID_PATH=pci-0000:00:1d.7-usb-0:5.4.2:1.0
E: ID_PATH_TAG=pci-0000_00_1d_7-usb-0_5_4_2_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0100
E: ID_SERIAL=SparkFun_SparkFun_Pro_Micro22
E: ID_TYPE=generic
E: ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
E: ID_USB_DRIVER=cdc_acm
E: ID_USB_INTERFACES=:020200:0a0000:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
E: ID_VENDOR=SparkFun
E: ID_VENDOR_ENC=SparkFun
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_VENDOR_ID=1b4f
E: MAJOR=166
E: MINOR=1
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=19858834082
I now need to puzzle how to extract the correct info; I did not find a direct way in the
udevadm man page. It's basically the ID_MODEL and/or ID_MODEL_ENC.
grep and
awk come to mind although it's ages ago that I used *awk* ( the book is already dusted of
![Wink](https://www.linuxquestions.org/questions/images/smilies/wink.gif)
)
Note
I can modify the MODEL_ID with the code that I program in the USB device. So each USB device has its own model.