Determine serial port based on USB description (bash)
by Wim Sturkenboom from LinuxQuestions.org on (#6NKV3)
Hi all,
Not sure if this is the correct section to ask; moderators feel free to move it.
I have a scenario where I need to identify the serial port (/dev/ttyACMx) of a USB device based on USB description. There are a number of these devices connected to a computer; they have the same VID and PID but differ in USB description.
Is there a single bash command that I can use?
Without that, the process that I visualise is to use lsusb to find the connected devices by VID/PID to see if they are connected, use a filter on the output of dmesg (probably read /var/log/dmesg using tac) and find the usb description and associated device (/dev/ttyACMx). The sequence can be reversed, not sure what's better but I will figure that out in time.
Not sure if this is the correct section to ask; moderators feel free to move it.
I have a scenario where I need to identify the serial port (/dev/ttyACMx) of a USB device based on USB description. There are a number of these devices connected to a computer; they have the same VID and PID but differ in USB description.
Is there a single bash command that I can use?
Without that, the process that I visualise is to use lsusb to find the connected devices by VID/PID to see if they are connected, use a filter on the output of dmesg (probably read /var/log/dmesg using tac) and find the usb description and associated device (/dev/ttyACMx). The sequence can be reversed, not sure what's better but I will figure that out in time.