[Nut-upsuser] APC SmartUPS 2200XL + UDEV + USB = tcgetattr : Invalid argument
Richard
richard-nut at rain4us.net
Wed Jul 28 22:28:39 UTC 2010
I need direction. I don't know what to google for anymore. I am unable
to get my SmartUPS 2200XL to be recognized. My suspicions are that it's
UDEV or Kernel related. I've updated the kernel to the highest version
I feel comfortable with due to other things that run on the server, and
I've updated UDEV a bit too.
When I plug in the USB cable from the UPS into the server, I see the usb
driver recognizing the UPS, but I don't see it assigning a device name.
I added in a manually created udev rule and now the device appears, but
it seems like the wrong driver is attached to the device. As this is my
first time setting up NUT, I'm unsure if I'm configuring NUT incorrectly
or if I have a USB/UDEV/Kernel issue.
Does anyone have any suggestions or hints as to what I can search for
next to solve this issue? I'm going to try the latest build from svn.
-----------------------------
Here is what I have and what I've seen so far. I thought about
pastebin'ing this but figured it might help the next person who is
goggle'ing.
Server OS: Slackware 12.0
Kernel Version: 2.6.25.20
UDEV version: 135
NUT version: 2.4.3
The following output is from
===== Log file output =====
==> /var/log/messages <==
Jul 28 12:26:09 swmweb kernel: usb 4-2: configuration #1 chosen from 1
choice
==> /var/log/syslog <==
Jul 28 12:26:09 swmweb kernel: hub 1-0:1.0: unable to enumerate USB
device on port 6
==> /var/log/messages <==
Jul 28 12:26:11 swmweb kernel: hiddev96: USB HID v1.10 Device [American
Power Conversion Smart-UPS 2200 XL FW:690.19.D USB FW:7.4] on
usb-0000:00:1d.2-2
===== What I see in /proc ======
/proc/bus/usb/devices {lines 43-51}
T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=051d ProdID=0002 Rev= 0.06
S: Manufacturer=American Power Conversion
S: Product=Smart-UPS 2200 XL FW:690.19.D USB FW:7.4
S: SerialNumber=JS1005032730
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 30mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 6 Ivl=100ms
===== what I see in /sys/block ======
# ls /sys/block
hda/ loop2/ loop6/ ram1/ ram13/ ram3/ ram7/ sdb/ sdf/
hdb/ loop3/ loop7/ ram10/ ram14/ ram4/ ram8/ sdc/
loop0/ loop4/ md0/ ram11/ ram15/ ram5/ ram9/ sdd/
loop1/ loop5/ ram0/ ram12/ ram2/ ram6/ sda/ sde/
===== What udevadm (udevinfo) sees =====
# udevadm info -a -p /sys/devices/pci0000:00/0000:00:1d.2 /usb4/4-2
Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.2/usb4/4-2':
KERNEL=="4-2"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{configuration}=="1"
ATTR{bNumInterfaces}==" 1"
ATTR{bConfigurationValue}=="1"
ATTR{bmAttributes}=="e0"
ATTR{bMaxPower}==" 30mA"
ATTR{urbnum}=="3668"
ATTR{idVendor}=="051d"
ATTR{idProduct}=="0002"
ATTR{bcdDevice}=="0006"
ATTR{bDeviceClass}=="00"
ATTR{bDeviceSubClass}=="00"
ATTR{bDeviceProtocol}=="00"
ATTR{bNumConfigurations}=="1"
ATTR{bMaxPacketSize0}=="8"
ATTR{speed}=="1.5"
ATTR{busnum}=="4"
ATTR{devnum}=="2"
ATTR{version}==" 1.10"
ATTR{maxchild}=="0"
ATTR{quirks}=="0x0"
ATTR{authorized}=="1"
ATTR{manufacturer}=="American Power Conversion"
ATTR{product}=="Smart-UPS 2200 XL FW:690.19.D USB FW:7.4"
ATTR{serial}=="JS1005032730"
<snip the rest of the udevinfo tree walk>
===== The rule I made since no /dev/device was being created =====
# cat /etc/udev/rules.d/90-local-udev.rules
#/dev/smartups UPS
SUBSYSTEMS=="usb", ATTRS{manufacturer}=="American Power Conversion",
ATTRS{product}=="Smart-UPS 2200 XL FW:690.19.D USB FW:7.4",
ATTRS{serial}=="JS1005032730", NAME="apcusb", SYMLINK+="smartups",
MODE="0660", GROUP="nut"
===== ups.conf =====
# cat /etc/nut/ups.conf
[2200XL]
driver = apcsmart
port = /dev/apcusb
desc = "Main 2200 XP with battery pack"
===== This is what happens when apcsmart is executed =====
# cd /usr/libexec/nut/
# ./apcsmart -a 2200XL
Network UPS Tools - APC Smart protocol driver 2.03 (2.4.3)
APC command table version 2.1
tcgetattr(/dev/apcusb): Invalid argument
More information about the Nut-upsuser
mailing list