[ale] USB port identification

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


Ok, then use lsusb or the system log to find the serial number for each
device and add that as an additional uniqueness parameter in a udev
rule.  Barring that, look at the kernel device tree which will show the
physical layout as something like:

/devices/pci0000:00/0000:00:1d.7/usb1/1-4/1-4.5

Which would be port five on a hub attached to bus 1, port 4.


On 2015-11-19 08:04, Chris Fowler wrote:
>> From: "Alex Carver" <agcarver+ale at acarver.net>
>> To: ale at ale.org
>> Sent: Thursday, November 19, 2015 10:26:11 AM
>> Subject: Re: [ale] USB port identification
> 
>> 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.
> 
> I have 500 USB->Serial adapters in boxes in my garage. Same vendor id and same product id. 
> They are not unique at all. All the same. 
> 
> Here is the problem. Look at the Ralink device 
> 
> [root at localhost]# lsusb 
> Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
> Bus 003 Device 003: ID 0572:1340 Conexant Systems (Rockwell), Inc. 
> Bus 003 Device 002: ID 15d9:0a37 Trust International B.V. Mouse 
> Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub 
> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub 
> Bus 001 Device 004 : ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter 
> Bus 001 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub 
> Bus 001 Device 002: ID 8087:07e6 Intel Corp. 
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
> 
> Now, I'll unplug and plug it back in the SAME USB port. 
> 
> [root at localhost]# lsusb 
> Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
> Bus 003 Device 003: ID 0572:1340 Conexant Systems (Rockwell), Inc. 
> Bus 003 Device 002: ID 15d9:0a37 Trust International B.V. Mouse 
> Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub 
> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub 
> Bus 001 Device 005 : ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter 
> Bus 001 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub 
> Bus 001 Device 002: ID 8087:07e6 Intel Corp. 
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
> 




More information about the Ale mailing list