APC UPS control system Power Supply User Manual


 
Finally, check that appropriate USB devices exist. On a Red Hat system
you can do this:
esr@grelber$ ls /dev/usb/h*
/dev/usb/hiddev0 /dev/usb/hiddev12 /dev/usb/hiddev2 /dev/usb/hiddev6
/dev/usb/hiddev1 /dev/usb/hiddev13 /dev/usb/hiddev3 /dev/usb/hiddev7
/dev/usb/hiddev10 /dev/usb/hiddev14 /dev/usb/hiddev4 /dev/usb/hiddev8
/dev/usb/hiddev11 /dev/usb/hiddev15 /dev/usb/hiddev5 /dev/usb/hiddev9
This will tell you that the Human Interface Device nodes, one of which
apcupsd will use to talk with the UPS, exist. On other Linuxes the lay-
out will be slightly different; the hiddev devices will usually live in a
/dev/usb/hid/ subdirectory. If these devices don’t exist, you may need
to run <apcupsd-source>/examples/make-hiddev to create them.
Now build and run the hid-ups test program. You do not have to configure
and build the rest of apcupsd to do this. To build hid-ups enter:
cd <apcupsd-source>/examples
make hid-ups
There should be no errors. Now assuming that everything has gone well to
this point and that you have connected your USB UPS, enter:
./hid-ups
It should print a sample report of the information that it has obtained from
your UPS. CAUTION! if you have a 2.4.x Linux kernel do not run two
copies of this program at the same time, or your kernel will freeze. The
report that is printed should look very similar to the report in <apcupsd-
source>/examples/hid-ups.rpt. If the program reports that the device was
not found ensure that all the appropriate modules are loaded (as described
earlier), then unplug your UPS and plug it back in. This should permit the
kernel to recognize the UPS.
If ./hid-ups tells you “No permission, try this as root”, you know what to
try. If it says “Couldn’t find USB UPS device, check your /dev.”, then it is
very unlikely that apcupsd will work. You probably need to run the script
“make-hiddev” before continuing.
27