Locking USB Serial Device to Specific Com port

dweimer dweimer at dweimer.net
Sat Jan 26 21:46:03 UTC 2013


I have two USB Serial adapters I use on my web server, ones always 
connected, to allow NUT to monitor my UPS.  The other I use to view the 
console of my pfSense firewall, however I sometimes disconnect this one 
to use it with my laptop to configure switches.

Because this one is unplugged and plugged back in, sometimes on reboot 
it ends up switching its com port with the UPS, so NUT fails to start 
and the UPS is unmonitored.

I would like to lock down the USB serial port adapter used on the UPS 
to /dev/cuaU0, to make sure the UPS is always monitored and I will get a 
clean shutdown in event of a power failure.

I believe that this requires setting a hint line of some sort in the 
/boot/loader.conf file, but I am having trouble tracking down what this 
should be, or maybe I am on the wrong track.  Here is the current 
information from the adpapters, the UPS adapter was connected at boot, 
is on /dev/cuaU0, the other one was plugged in after boot, and is on 
/dev/cuaU1.


dmesg output:
ugen0.2: <Prolific Technology Inc.> at usbus0
uplcom0: <Prolific Technology Inc. USB-Serial Controller, class 0/0, 
rev 1.10/3.00, addr 2> on usbus0
ugen0.3: <Prolific Technology Inc.> at usbus0
uplcom1: <Prolific Technology Inc. USB-Serial Controller, class 0/0, 
rev 1.10/3.00, addr 3> on usbus0

sysctl -a | grep uplmon:
device  uplcom
hw.usb.uplcom.debug: 0
dev.uplcom.0.%desc: Prolific Technology Inc. USB-Serial Controller, 
class 0/0, rev 1.10/3.00, addr 2
dev.uplcom.0.%driver: uplcom
dev.uplcom.0.%location: bus=1 hubaddr=3 port=0 devaddr=2 interface=0
dev.uplcom.0.%pnpinfo: vendor=0x067b product=0x2303 devclass=0x00 
devsubclass=0x00 sernum="" release=0x0300 mode=host intclass=0xff 
intsubclass=0x00 intprotocol=0x00  ttyname=U0 ttyports=1
dev.uplcom.0.%parent: uhub0
dev.uplcom.0.ttyname: U0
dev.uplcom.0.ttyports: 1
dev.uplcom.1.%desc: Prolific Technology Inc. USB-Serial Controller, 
class 0/0, rev 1.10/3.00, addr 3
dev.uplcom.1.%driver: uplcom
dev.uplcom.1.%location: bus=1 hubaddr=1 port=0 devaddr=3 interface=0
dev.uplcom.1.%pnpinfo: vendor=0x067b product=0x2303 devclass=0x00 
devsubclass=0x00 sernum="" release=0x0300 mode=host intclass=0xff 
intsubclass=0x00 intprotocol=0x00  ttyname=U1 ttyports=1
dev.uplcom.1.%parent: uhub0
dev.uplcom.1.ttyname: U1
dev.uplcom.1.ttyports: 1

Does anyone have any suggestions on how to do this?

-- 
Thanks,
    Dean E. Weimer
    http://www.dweimer.net/


More information about the freebsd-questions mailing list