[ale] USB port identification

Alex Carver agcarver+ale at acarver.net
Thu Nov 19 10:26:11 EST 2015


On 2015-11-19 06:45, Chris Fowler wrote:
>> From: "Sergio Chaves" <sergio.chaves at gmail.com>
>> To: "Atlanta Linux Enthusiasts" <ale at ale.org>
>> Sent: Thursday, November 19, 2015 7:49:48 AM
>> Subject: Re: [ale] USB port identification
> 
>> You may need a udev rule to accomplish what you want.
>> Something like 7.12.12 in this page
>> http://www.linuxfromscratch.org/lfs/view/6.2/chapter07/symlinks.html
> 
> I only wish.. 
> 
> The problem is that The Bus 00X Device 00X is changing. Unplug the modem and plug it right back in and you'll get N+1 where N was what is was before. This makes identification of the port on the hardware nearly impossible. 
> 
> I need to identify the port on the hardware being used. Udev rules run a script where I take the Device/Bus value and determine what port it is attached. I then symlink a name in /dev to what the kernel assigned it. On the older hardware if you plugged this modem on the front port then /dev/usbmodem2 would be created. On back /dev/usbmodem0 
> 
> The real port you use dictates what programs will run on that tty. The people that use this system almost no nothing about computers. If any, it would be Windows. I've automated everything so they can hop on a train in NYC, go to a site, plug it up, and leave. 
> 

Write the udev rules to look at the vendor and product ID fields and
then perhaps the bus/sevice fields too.  Use a unique combination of all
four fields to identify a single device.  If the devices always come up
in the same order no matter which physical port they are using then all
four fields should stay unique during each boot.

Also double check what happens in the different configurations with
lsusb and see if there are any other udev rules in place already that
might be interfering.



More information about the Ale mailing list