This information HAS errors and is made available WITHOUT ANY WARRANTY OF ANY KIND and without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. It is not permissible to be read by anyone who has ever met a lawyer or attorney. Use is confined to Engineers with more than 370 course hours of engineering.
If you see an error contact:
+1(785) 841 3089
inform@xtronics.com
$ ll /dev crw-rw---- 1 root nut 188, 0 2017-05-18 21:21 ttyUSB0So first we run this command
$ udevadm info -a -n /dev/ttyUSB0Mixed in with the output is
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-8':Most of it we don't need, but if we grab:
KERNELS=="1-8"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{authorized}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{bMaxPower}=="90mA"
ATTRS{bNumConfigurations}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bcdDevice}=="0600"
ATTRS{bmAttributes}=="a0"
ATTRS{busnum}=="1"
ATTRS{configuration}==""
ATTRS{devnum}=="17"
ATTRS{devpath}=="8"
ATTRS{idProduct}=="6001"
ATTRS{idVendor}=="0403"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="FTDI"
ATTRS{maxchild}=="0"
ATTRS{product}=="FT232R USB UART"
ATTRS{quirks}=="0x0"
ATTRS{removable}=="removable"
ATTRS{serial}=="AJV9MKOY"
ATTRS{speed}=="12"
ATTRS{urbnum}=="87835"
ATTRS{version}==" 2.00"
ATTRS{idVendor}=="0403"We have everything needed to make our own custom udev rule. The last fields - SYMLINK+ creates our persistant name - and while we are here we set the group.
ATTRS{idProduct}=="6001"
ATTRS{serial}=="AJV9MKOY"
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AJV9MKOY", SYMLINK+="ttyUSB-nut",GROUP = "nut"We save it in /etc/udev/rules.d/52_nut-serialups.rules ( or something similar in name - the number matters - controls the order they are run ). A gentel nudge to reload may be needed..
#this device is refered to by /etc/nut/ups.conf
$ udevadm control --reloadSo now we get:
$ ll /dev |grep nutCorrect group and a persistant symlink.
crw-rw---- 1 root nut 188, 0 2017-05-18 21:38 ttyUSB0
lrwxrwxrwx 1 root root 7 2017-05-18 21:04 ttyUSB-nut -> ttyUSB0
Top Page | wiki Index |
(C) Copyright 1994-2019
All trademarks are the property of their respective owners.