[ale] USB port identification

Chris Fowler cfowler at outpostsentinel.com
Thu Nov 19 13:01:09 EST 2015


> From: "Alex Carver" <agcarver+ale at acarver.net>
> To: ale at ale.org
> Sent: Thursday, November 19, 2015 12:42:17 PM
> Subject: Re: [ale] USB port identification

> On 2015-11-19 09:23, Chris Fowler wrote:
> >> From: "Alex Carver" <agcarver+ale at acarver.net>
> >> To: ale at ale.org
> >> Sent: Thursday, November 19, 2015 11:51:03 AM
> >> Subject: Re: [ale] USB port identification

> >> /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.

>> It seems we have a winner. That path never changed. The device # did. At this
>> point I can not remember if I used that in my original script or if I used the
>> device # as shown in lsusb. I'll look into that. I'm pretty sure I can tell
>> udev to send me the above path. I can then grok the values out as required and
> > refer to a table of assignments.

> > If vendorId = X and productID = Y and USB Port = Z
> > then ln -sf real kernel device /dev/us2

> You only need to feed the last part of the path to udev.:

> KERNELS=="1-1.4.2",NAME="namehere"

> For example, I have two serial adapters on one machine. They sometimes
> get out of order on boot without udev rules so I have these rules:

> ACTION=="add",KERNEL=="ttyUSB*",SUBSYSTEMS=="usb",KERNELS=="1-1.3.1.4:1.0",SYMLINK+="dymo"
> ACTION=="add",KERNEL=="ttyUSB*",SUBSYSTEMS=="usb",KERNELS=="1-1.3.1.3:1.0",SYMLINK+="supra"

> This ensures the symlinks follow the appropriate physical device (a
> modem and a printer) no matter how they decide to get loaded. In this
> case the dymo printer is located at Bus 1, Root 1, Hub Port 3, Hub Port
> 1, Hub Port 4 (it's a raspberry pi with several on-board hub chips)

> The :1.0 is configuration 1, interface 0 (some devices can have more
> than one for things like full speed versus high speed).
> _
The udev doc is so much more confusing then just writing a program to do what I need to do when certain supported devices are plugged in. My device simply calls specific scripts for types of dongles or specific wireless chip 
sets and then that program sets everything up. 

If you plug in a USB->Ser dongle and there is no config that uses than it starts a getty at 9600,n,8,1 on it. A tech could use this and a null-modem back to their Windows laptop to get command line and then configure the device. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20151119/f7c73474/attachment.html>


More information about the Ale mailing list