How to permanently map USB serial devices to specific device nodes

I have 5 or so USB serial devices and they all work fine, but I am sometimes seeing different devices wind up mapped to different device nodes during boot. I've been searching a bit, but having a hard time finding examples of device.hints (or whatever mechanism) used to configure USB serial devices to show up on predictable device nodes. Can someone point me to a suitable example?
 
The top level answer is "devd"
I think you should be able to create a config file, but the matching clauses may be interesting.
You need to verify that each device has something unique:
vendor and product may or may not be the same, look for a serial number that is different.
I think usbconfig or usbdump may let you probe the devices.

Here's a simple config file I use to change permissions when I connect a Nikon D610 so I can import pictures. It just changes permissions, but should give you an idea:
notify 100 {
match "vendor" "0x04B0";
match "product" "0x0434";
action "chgrp wheel /dev/$cdev && chmod 660 /dev/$cdev";
};
 
Thanks. I hadn't messed with devd configs. I'm used to using devfs.conf to set permissions which is okay for me since I'm mainly interested in units that are permanently connect and therefore appear at boot. I will try to figure out how to get a devd rule to pick out my devices. It's tricky when they appear to be essentially identical, except that I have them in different hubs, which is how I am currently dealing with the predictability issue. I would like to stick them all in a single powered hub, but then there's no telling which is which at power up, it seems. I'd have to write code to probe each one and figure out which instrument is which and configure all the symlinks so that software can start correctly.
 
Thanks. I hadn't messed with devd configs. I'm used to using devfs.conf to set permissions which is okay for me since I'm mainly interested in units that are permanently connect and therefore appear at boot. I will try to figure out how to get a devd rule to pick out my devices. It's tricky when they appear to be essentially identical, except that I have them in different hubs, which is how I am currently dealing with the predictability issue. I would like to stick them all in a single powered hub, but then there's no telling which is which at power up, it seems. I'd have to write code to probe each one and figure out which instrument is which and configure all the symlinks so that software can start correctly.
Most of the time devd is used to tweak permissions or create the symlinks for things like say "ln -sf /dev/usb/genericdevice /dev/cdrom" the trick is "what information is available at devd to uniquely identify things".
I'm not a devd expert but there should be good information on it.

So roughly same device across different hubs? I ran into something similar "@WORK" (on linux) that we wound up mapping the usb address/tree to specific device with udev rules. USB stuff typically is presented as a tree:
"start at root controller, then physical port X off that which leads to device or another hub which adds a layer then device off port of that hub".
kludgey, but as long as physical connectivity did not change it worked. Sounds similar to what you are looking at, and maybe there is enough hints to get a similar result.
 
Back
Top