Apcupsd is a UPS control system that permits orderly
shutdown of your computer in the event of a power failure.
Kern Sibbald
April 3, 2005
This manual documents apcupsd version 3.10.17
Copyright (C) 1999-2005 Kern Sibbald
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the name Apcupsd, the
copyright notice, and this notice are preserved.
Apcupsd source code is released under the GNU General Public License
version 2. Please see the file COPYING in the main source directory.
For more information on the project, please visit the main web site at
http://www.apcupsd.com
This release contains a good number of cleanups and bug fixes to prior 3.10.x
versions, and is intended to be the official release. See the ChangeLog below
for more details.
New Features
- Implement USB on all *BSD systems. Note, the kernel
drivers on most of these systems are still fragile.
There are known problems, for example, on FreeBSD.
- Fix killpower on USB UPSes to properly turn off UPS.
- More killpower fixes for BackUPS Pros.
- Fix killpower sequence for serial UPSes.
Change Log for current version
----> Release 3.10.17 xxMar05
- Update default apcupsd.conf to recommend a blank DEVICE setting for USB
driver.
- Add /dev/hiddev? to Linux USB driver device node search path.
- Add Mac OS X startup script
- Add new *BSD USB driver to support USB UPSes on FreeBSD, OpenBSD, and NetBSD.
THIS DRIVER IS BETA SOFTWARE AND HAS A KNOWN LOCKUP ISSUE ON FREEBSD. Please
keep this in mind when deciding whether or not to deploy it. PLEASE READ THE
"CHECKING OUT YOUR USB SUBSYSTEM (BSD)" SECTION OF THE MANUAL as it contains
crucial details on how to configure your system for the new driver.
- Add BackUPS Pro shutdown code to USB driver
- Prefer BackUPS style shutdown over SmartUPS in USB driver to resolve shutdown
issues on BackUPS CS models
- Restructure USB driver to share common code
- Fix slave mode segfault bug introduced by --killpower fixes in 3.10.16.
- Commit kernstodo
- Added an anonymous patch to powerflute.c and to the slack-apcupsd.in file.
- Add Whitebox to detected systems.
- Minor tweak to RedHat spec.in
- Apply Carl Lindbergs patch
for apcaction.c to fix the network management card
shutdown.
- Fix typo in targets.mak that prevents uninstall from working.
- Change name of thread_terminate to apc_thread_terminate to avoid
conflict on AIX.
- Put configure found SHUTDOWN in apccontrol.in
- Figured out how to scale the pdf images, so re-did them.
- Some minor updates to the manual, particularly the title
11
page.
Change Log for older versions
----> Release 3.10.16 04Nov04
- Adam has fixed the killpower problem for USB so that the
USB now properly turns off the power. Nice job.
- Converted manual from docbook to texinfo format. There is some
cleanup to be done, but we get an index.
- Thanks to Adam for converting the .png images to .pdf
- Apply patch to fix aastr... supplied by Manfred Schwarb.
- Changed Solaris to use mailx by default at the suggestion of
Neil Brookins.
- Added Adam’s snoopdecode.c to examples that allows viewing
USB events.
- A number of typos fixed in apccontrol files.
- Adam fixed a race condition in killpower with --kill-on-powerfail.
- --kill-on-powerfail disallowed for dumb UPSes since the
kill power will always occur before the system has been halted.
- Lots of doc updates.
- Add proper platform code so that configure will create
the 4 platform specific apccontrol files (some were missing).
- Apply fix from user to correct one of the shutdown
sequences for the Smart UPS. During the conversion to drivers
this was apparently mangled.
- Added code to close all file descriptors before becoming
daemon unless debug turned on.
- Add APCBATTCapBeforeRestore found by Adam to hid-ups.c
- Update copyright in apc_struct.h
- Take Adam’s new apc_defines.h with minor modification.
- Correct a bug reported by a user (he also had the fix) to
the snmp driver where Sensitivity was incorrectly reported.
- Add astrncpy() to snmp driver.
- Fix apcstatus.c to report Unknown for the sensitivity rather than
High if the sense word cannot be read or is incorrect.
----> Release 3.10.15 07Aug04
- Document Mandrake USB kernel problems.
- Fix HID_MAX_USAGES in the examples directory
- Apply David Walser’s patch for missing colors in multimon. Reads
the apcupsd.css file from the sysconf directory.
- Add EEPROM fix from Giuseppe Ghibo passed on by David Walser
----> Release 3.10.14 28Jul04
- Add workaround from Adam for linux/hiddev.h missing define.
- Updates to manual.
- Integrate patch for Mandrake apcupsd.in forwarded by David Walser.
- Found another store into the ups buffer so ifdefed it. Cannot
store into the ups buffer on non-pthreads systems.
- Fiddle with apcconfig.c to correct astrncpy() problem noted by
Adam.
12
- ifdef code in apcaccess that tries to write in the shared memory
buffer.
- Applied Adam’s patch for fixing the pthreads dependencies in asys.c
- Tweak the patch a bit hopefully so that OpenBSD will work.
- Made a sweep through quite a few files updating the copyright,
eliminating the disclaimer (now in DISCLAIMER), and adding as many
astrncpy() and astrncat()s as I could find. There still remain some
drivers and the cgi code to do.
- Implemented true/false and bool. Started implementing it in many of
the files I touched.
- Updated the net driver and did a fairly good testing of it.
- Made apcupsd remain in the foreground when doing a kill power.
- Eliminated some of the error messages during kill power by not
doing useless things.
- Added back code to print what is happening during kill power
in the USB code.
- Corrected a few of the USB error messages that could have been
missleading or confusing.
- Eliminated some inappropriate usages of size_t.
- Integrated a number of updates into the manual, particularly from
Adam.
- If the IP address is 0.0.0.0 force it to localhost in apcaccess.
- Integrat Thomas Habets’ changes to keep connect() from blocking
in apcnet.c so that apcupsd can service more slaves.
- Ensure that stdin/out/err are allocated in daemon_start() of apcuspd.c
- Update snmp.c with bug fix from Bacula.
- Bill has made numerous changes to improve the code such as adding
consts where appropriate.
----> Release 3.10.13 20Apr04
- Added code to support net snmp configured with --enable-net-snmp
based on patch sent by Sander Siemonsma.
- Build smtp on Unix systems.
- Update to most current smtp and make it easier to configure
for apcupsd or Bacula
- Start implementing native Win32 version.
- Rename cmd - ups_event and cmd_msg - event_msg
- Add user supplied code to make apcaccess read the conf file and
self configure to proper port. Thanks to Martin Flack for this
patch.
- Start simplifying the Copyright and making the dates current.
- Rework the net driver. It was really in poor shape.
- Replace sprintf with asnprint. Replace strcpy with astrncpy
- Apply a fix supplied by Jim Pick where syslog releases the
usb port and then re-attaches it to /dev/log.
- I finally took a careful look at the old master/slave networking
code as well as ran it here, and it was sadly broken. Hopefully
this commit fixes the problems.
- Fix a few string functions using the new routines.
- Added asys.c imported from Bacula, which contains a number of
simple system routines such as astrncpy(), ...
13
How To Use This Manual
This is the manual for apcupsd, a daemon for communicating with UPSes
(Uninterruptible Power Supplies) made by American Power Corporation
(APC). If you have an APC-made UPS, whether sold under the APC nameplate or OEMed (The HP PowerTrust 2997A UPS has been tested as a
“smartups” with cable Hewlett Packard part number 5061-2575 equivalent
to a custom-smart cable), and you want you get it working with a computer
running Linux, Unix, or Windows NT, you are reading the right document.
This manual is divided into parts which increase in technical depth as they
go. If you have just bought a state-of-the-art smart UPS with a USB or
Ethernet interface, and you are running a current version of Red Hat or
SUSE Linux (8.0 or later), then apcupsd is very nearly plug-and-play and
you will have to read only the Basic User’s Guide (see Basic User’s Guide).
If your operating system is older, or if you have an old-fashioned
serial-line UPS, you’ll have to read about serial installation (see
Installation on Serial-Line UPSes). If you need more details about administration for unusual situations (such as a master/slave or multi-UPS setup)
you’ll need to read the section on advanced topics (see Advanced topics). Finally, there is a Technical Reference (see Technical Reference) section which
gives full details on things like configuration file directives and event-logging
formats.
You should begin by reading the Quick Start (see Quick Start for Beginners)
instructions.
Basic User’s Guide
Planning Your Installation
Quick Start for Beginners
apcupsd is a complex piece of software, but most of its complexities are
meant for dealing with older hardware and operating systems. On current
hardware and software getting it running should not be very complicated.
The following is a help guide to the steps needed to get apcupsd set up and
running as painlessly as possible.
14
1. First, check to see if apcupsd supports your UPS and operating system
(see Supported Operating Systems; UPSes and Cables).
2. Second,planyourconfigurationtype(see
Choosing a Configuration Type).If you have just one UPS and
one computer, this is easy. If you have more than one machine being
served by the same UPS, or more than one UPS supplying power to
computers that are on the same local network, you have more choices
to make.
3. Third, figure out if you have one of the easy setups. If you have a USB
UPS, and a USB-capable recent Linux such as Red Hat or SuSE at
version 8.0, and you want to use one UPS with one computer, that’s an
easy setup. APC supplies the cable needed to talk with that UPS along
with the UPS. All you need to do is check that your USB subsystem
is working (see Checking Out Your USB Subsystem); if so, you can go
to the build and install step.
4. If you have a UPS designed to communicate via SNMP over Ethernet,
that is also a relatively easy installation. It’s in Advanced Topics (see
Advanced topics) mainly because it’s an unusual situation.
5. If you have a UPS that communicates via an RS232C serial interface
and it is a SmartUPS, then things are relatively simple, otherwise,
your life is about to get interesting.
(a) If you have a vendor-supplied cable, find out what cable type you
have by looking on the flat ends of the cable for a number, such
as 940-0020A, stamped in the plastic. Check the cables column
of the table of types (see type
type.
(b) If you don’t have a vendor-supplied cable, or your type is not
supported, you may have to build one yourself (see Cables). Here
is hoping you are good with a soldering iron!
6. Now you are ready to read the Building and Installing (see
Building and Installing apcupsd) section of the manual and follow
those directions. If you are installing from an RPM or some other
form of binary package, this step will probably consist of executing a
single command.
7. Tweak your /etc/apcupsd/apcupd.conf file as necessary. Often it will
not be.
8. Change the BIOS settings (see Arranging for Reboot on Power-Up)
on your computer so that boots up every time it gets power. (This is
not the default on most systems.)
15
table) to see if it’s a supported
9. To verify that your UPS is communicating with your computer and
will do the right thing when the power goes out, read and follow the
instructions in the Testing (see Testing Apcupsd) section.
10. Ifyourunintoproblems,readtheTroubleshooting(see
Troubleshooting Your Installation) section of this manual.
11. If you still need help, send a message to the developer’s email list
apcupsd-users at lists.sourceforge.net describing your problem, what
version of apcupsd you are using, what operating system you are using,
and anything else you think might be helpful.
12. Read the manual sections on monitoring and maintaining your UPS.
Supported Operating Systems, UPSes and Cables
Please note that due to the lack of Unix USB API standards, the USB code
in apcupsd works only on Linux and *BSD systems. In addition, at the
current release (3.10.17) the USB support for *BSD systems can at best be
considered BETA due to fragile kernel drivers. Drivers for other OSes can
be written, but it requires someone with a knowledge of the OS and the
USB to do so. (This lack of a Unix USB API interface is one of the big
failings of Unix. It occurs in other areas such as the GUI. Many people tout
the diversity as an advantage, but it is in fact a weakness.)
The apcupsd maintainers develop it under Fedora (Red Hat); that port is,
accordingly, the most up to date and best tested. There are enough Debian
Linux users that that port is also generally pretty fresh. Slackware Linux is
also fully supported.
apcupsd has also been ported to FreeBSD, NetBSD, OpenBSD, HP/UX,
Solaris, Alpha Unix and the Cygwin Unix emulation under Windows. It is
quite likely to work on those systems, though the port may occasionally get
stale and require minor tweaking.
In Operating System Specifics you’ll find operating-system-specific tips for
building and configuring apcupsd.
You can generally count on your UPS being supported if it has either
an Ethernet-connected SNMP interface or a USB interface with an APCsupplied cable.
The “UPSTYPE Keyword” field is the value you will put in your
/etc/apcupsd/apcupd.conf file to tell apcupsd what type of UPS you have.
16
We’ll describe the possible values here, because they’re a good way to explain your UPS’s single most important interface property – the kind of
protocol it uses to talk with its computer.
apcsmart An APCSmart UPS and its computer also communicate
through an RS232C serial connection, but they actually use it as
a character channel (2400bps, 8 data bits, 1 stop bit, no parity)
and pass commands back and forth in a primitive language (see
APC smart protocol) resembling modem-control codes. The different
APC UPSes all use closely related firmware, so the language doesn’t
vary much (later versions add more commands). This class of UPS
is in decline, rapidly being replaced in APC’s product line by USB
UPSes.
usb A USB UPS speaks a universal well defined control language over a
USB wire. Most of APC’s lineup now uses this method as of late
2003, and it seems likely to completely take over in their low- and
middle range.Other manufacturers (Belkin, Tripp-Lite, etc.)are
moving the same way, though with a different control protocol for
each manufacturer. As long as USB hardware can be mass-produced
more cheaply than an Ethernet card, most UPSes are likely to go this
design route. Please note that even if you have a USB UPS, if you use
a serial cable with it (as can be supplied by APC), you will need to
configure your UPS as apcsmart rather than usb.
net This is the keyword to specify if you are using your UPS in Slave mode
(i.e. the machine is not directly connected to the UPS, but to another
machine which is), and it is connected to the Master via an ethernet
connection. You must have apcupsd’s Network Information Services
NIS turned on for this mode to work. It is a much simpler form of
running a Slave than the old Master/Slave code.
snmp SNMP UPSes communicate via an Ethernet NIC and firmware that
speaks Simple Network Management Protocol.
dumb A dumb or voltage-signaling UPS and its computer communicate
through the signal lines on an RS232C serial connection. Not much
can actually be conveyed this way other than an order to shut down.
Voltage-signaling UPSes are obsolete; you are unlikely to encounter
one other than as legacy hardware. If you have a choice, we recommend
you avoid simple signalling UPSes.
The table shown below lists the APC model supported, and the possible
kewords that you would use in the configuration with the listed cables. Some
17
of the models, particularly USB enabled models, can be run in multiple
modes, so they may appear more than once in the table. APC is putting
out new models at a furious rate, and so it is very likely that your model is
not listed in the table. If it is USB enabled, it will probably work in USB
mode. Please note that some of these new models are extremely inexpensive,
so they are stripped down versions of more expensive units, and as such
they do not offer as many features, so some of the example output you see
elsewhere in this manual may not be available with your unit.
APC ModelUPSTYPE
Keyword
BackUPS
CS/ES (serial
mode)
BackUPS Pro,
Smarter BackUPS Pro
SmartUPS,
SmartUPS VS
(Ithasnot
been confirmed
that the cable
shippedwith
the VS is a
940-0095.),
PowerStack
450,Matrix
UPS,ShareUPS Advanced
Port
apcsmartsmart(note:
apcsmart940-0095ASupported
apcsmartsmart(note:
UPSCABLE
keywordsfor
CablesSupported
usingSmart
Custom RJ45)
the new BackUPS RS 500
modelsare
reported NOT
to work with
this cable.
usingSmartCustom),
940-0024C
Status
Supported
Supported
18
BackUPSCS
USB,Pro
USB, ES USB,
RS/XS1000,
RS/XS1500,
andprobably
otherUSB
models
SmartUPS
USB,BackUPSOffice
USB, and any
otherUSB
UPS
AllSNMPcapable models
BackUPSdumbsimple(note:
BackUPSOffice, BackUPS
ES
BackUPSCS
andpossibly
ESmodels
(serial mode)
ShareUPS Basic Port
usbusb(note:
usingAPC
cables9400127A/B/C)
usbusb (note: us-
ing APC cable,
no number)
snmpetherSupported
usingSimpleCustom (This
cable is not an
APC product.
Youhaveto
build it yourself using the
instructions
inCables.),
940-0020B,
940-0020C,
940-0119A,
940-0023A
dumb940-0119ASupported
dumb940-0128ASupported
dumb940-0020B,
940-0020C,
940-0023A
Supported in version >=3.9.8
Supported, version >=3.9.8
Supported
Supported
There are three major ways of running apcupsd on your system. The first
is a standalone configuration where apcupsd controls a single UPS, which
19
powers a single computer. This is the most common configuration. If you’re
working with just one machine and one UPS, skip the rest of this section.
Your choices become more interesting if you are running a small cluster or a
big server farm. Under those circumstances, it may not be possible or even
desirable to pair a UPS with every single machine. apcupsd supports some
alternate arrangements.
The second type of configuration is a master/slave configuration, where one
UPS powers several computers, each of which runs a copy of apcupsd. The
computer that controls the UPS is called the master, and the other computers are called slaves. The master copy of apcupsd communicates with
and controls the slaves via an Ethernet connection. This type of configuration may be appropriate for a small cluster of machines. Some example
configuration files for the master and the slave machines can be found in the
examples directory of the source distribution. The more recent examples
are in master.apcupsd.conf and slave.apcupsd.conf.
The third configuration (new with version 3.8.3), is where a single computer
controls multiple UPSes. In this case, there are several copies of apcupsd on
the same computer, each controlling a different UPS. One copy of apcupsd
will run in standalone mode, and the other copy or copies will normally
run in master/slave mode. This type of configuration may be appropriate
for large server farms that use one dedicated machine for monitoring and
diagnostics
Here is a diagram that summarizes the possibilities:
If you decide to set up one of these more complex configurations, see the
Advanced Topics (see Advanced topics) section for details.
Apcupsd Known USB Issues
- Problem: USB is only supported on Linux and *BSD systems (though
the *BSD is still BETA). Although the configuration script allows the usb
20
driver to be enabled on other platforms, it will only compile and run on
Linux and *BSD systems.
- Workaround: Try using UPS in serial mode instead of USB.
- Problem: Linux 2.4 series kernels older than 2.4.22 do not bind the USB
device to the proper driver. This is evidenced by /proc/bus/usb/devices
listing the UPS correctly but it will have “driver=(none)” instead of
“driver=(hid)”. This affects RHEL3, among others.
- Workaround: Upgrade linux kernel to 2.4.22 or higher.
- Problem: Mandrake 10.0 and 10.1 systems with high security mode enabled (running kernel-secure kernel) use static device nodes but still assign
USB minor numbers dynamically. This is evidenced by hiddev0: USBHID v1.10 Device [...] instead of hiddev96: ... in dmesg log.
- Workaround: Boot standard kernel instead of kernel-secure or disable
CONFIG
USB DYNAMIC MINORS and rebuild kernel-secure.
- Problem: USB driver linux-usb.c fails to compile, reporting errors about
MAX USAGES undefined. This is due to a defect in the linux
HID
kernel hiddev.h header file on 2.6.5 and higher kernels.
- Workaround: Workaround: Upgrade to apcupsd-3.10.14 or higher. These
versions contain a workaround for the defect.
- Problem: On some systems such as Slackware 10.0, no USB devices will
showup (see the next section).
- Workaround: add the following to rc.local
mount -t usbdevfs none /proc/bus/usb
- Problem:2.6 kernels use udev and does not autmatically create
/dev/usb/hiddev?? as it should, causing apcupsd to
- Workaround: Edit the file /etc/udev/rules.d/50-udev.rules, and add the
following:
KERNEL="hiddev*", NAME="usb/hiddev%n"
More details are provided in the following section ...
21
Checking Out Your USB Subsystem
You can skip this section if your UPS has an Ethernet or RS232-C interface
or you are not running on a Linux kernel. If it has a USB interface, you
need to make sure that your USB subsystem can see the UPS. On a Linux
system this is easy, just do this from a shell prompt (please see below for
2.6 kernel considerations):
Most of this section applies to Linux. However, toward the end, there is
critical information about the BSD USB driver, including a list of known
issues and kernel configuration requirements.
cat /proc/bus/usb/devices
This information is updated by the kernel whenever a device is
plugged in or unplugged,irrespective of whether apcupsd is running ornot.Tointerpret thecodesin thisfile,pleasesee
http://www.linuxhq.com/kernel/v2.4/doc/usb/proc usb info.txt.html
You should get some output back that includes something like this from
ESR’s site, featuring an RS 1000:
Note, if on the last line, Driver is listed as Driver=none then you do not
have the HID driver loaded or the driver did not attach to the UPS. One
common cause is having a Linux kernel older than 2.4.22 (such as a stock
RedHat 9 kernel). If this is the case for your system, please upgrade to at
least kernel version 2.4.22 and try again. Otherwise, please read further for
instructions for other possible courses of action.
For more details on how to interpret these codes, please see the end of this
section.
Here are two more ample entries from Kern Sibbald. The first features a
Back-UPS 350 direct connected USB device:
Note that the IOgear device is using the serial driver (the I: line) while the
Back-UPS 350 is using the hid driver.
In general, if you see your UPS model in the S field, which means Manu-facturer=, Product=, and SerialNumber=, and you see hid in the I
field (or serial if you are using an IOGear connection), you’re done. You
can skip the rest of this section and go straight to building and installing.
If it doesn’t show, check the obvious things; the UPS must be powered on,
and a cable must be properly seated in both the data port of the UPS and
one of your machine’s USB ports. Many UPSes have phone ports to provide
surge protection for phones or modems – make sure you haven’t plugged
your USB cable into one of those rather than the data port (which will
usually be near the top edge of the case.)
Note, on recent Debian systems, they do not include the hiddev device nodes in /dev, so you may need to manually create them using the
examples/make-hiddev script.
Also, ensure that the correct drivers are loaded. Under Linux-2.4.x, you can
check this out easily by examining the right file in the /proc system. Here’s
how you can do that:
23
esr@grelber$ cat /proc/bus/usb/drivers
and you should get:
usbdevfs
hub
96-111: hiddev
hid
On Linux-2.6.x, make sure the sysfs filesystem is mounted on /sys and do:
adk0212@mail$ ls -l /sys/bus/usb/drivers/
where you should get
total 0
drwxr-xr-x2 rootroot0 May 1 18:55 hid
drwxr-xr-x2 rootroot0 May 1 18:55 hiddev
drwxr-xr-x2 rootroot0 May 1 18:55 hub
drwxr-xr-x2 rootroot0 May 1 18:55 usb
drwxr-xr-x2 rootroot0 May 1 18:55 usbfs
or perhaps something like
total 0
drwxr-xr-x 2 root root 0 Jan 6 15:27 hiddev
drwxr-xr-x 2 root root 0 Jan 6 15:28 hub
drwxr-xr-x 2 root root 0 Jan 6 15:28 usb
drwxr-xr-x 2 root root 0 Jan 6 15:27 usbfs
drwxr-xr-x 2 root root 0 Jan 6 15:28 usbhid
If your 2.6.x system does not have the /sys/bus/usb directory, either you do
not have sysfs mounted on /sys or the USB module(s) have not been loaded.
(Check /proc/mounts to make sure sysfs is mounted.)
A USB UPS needs all of these drivers – the USB device filesystem, the USB
hub, the Human Interface Device subsystem driver, and the Human Interface Device driver. If you are compiling your own kernel, you want to enable
24
CONFIG USB, CONFIG USB HID, CONFIG USB HIDDEV, and CON-
USB DEVICEFS as well as at least one USB Host Controller Driver
FIG
(CONFIG USB UHCI HCD [2.6.x], CONFIG USB UHCI [2.4.x], etc.).
If CONFIG USB is set as M, CONFIG USB HID must be M (if enabled
at all). If CONFIG USB is set as Y, CONFIG USB HID can be M or Y.
hiddev, in turn, will be built however HID is.
To complicate things more many Linux flavors running 2.6 kernels such as
Fedora FC3 use the udev filesystem, which creates the devices in /dev (as
well as some others such as network devices) on the fly as they are needed.
It is basically a hotplug system, giving a lot more power to the user to
determine what happens when a device is probed or opened. It is also a lot
more complicated.
The bottom line for apcupsd on such a system is that the file
/dev/usb/hiddev# is not defined, and hence apcupsd terminates in error.
The solution to the problem is to add a rule to the udev rules file. On Fedora
FC3, this file is found in /etc/udev/rules.d/50-udev.rules. Start by adding
the following line:
where you replace the [ and ] with braces and the serial number with the
one that correspnds to your UPS.
Somekernelsship,suchasMandrake10,shipwithCON-
USB DYNAMIC MINORS turned on.This is not ideal for
FIG
running with apcupsd, and the easiest solution is to turn CONFIG USB DYNAMIC MINORSoffandrebuildyourkernel,or
find a pre-built kernel with it off.For a kernel with CONFIG USB DYNAMIC MINORS turned on to work with apcupsd, you
must enable devfs. The following will tell you if devfs is enabled:
$ ps ax | grep devs
which should give something like the following:
533 ?S0:00 devfsd /dev
What complicates the situation much more on Mandrake kernels is their
security level since CONFIG DYNAMIC USB MINORS is turned on, but
on higher security levels devfs is turned off. The net result, is that in those
situations hiddev is hosed (to use Adam’s terms) so apcupsd will not work.
So, in these cases, the choices are:
(a) Reduce the security level setting of the system
(not sure if this is possible after the initial install).
(b) Custom build a high security kernel with devfs enabled
and make sure devfs is mounted and devfsd is running.
(c) Custom build a high security kernel with dynamic
minors disabled
(d) Use udev
For a typical USB section of a kernel .config file, please see the end of this
section.
For the IOGear serial USB connection, you need:
usbcore
usbserial
pl2303
26
Finally, check that appropriate USB devices exist. On a Red Hat system
you can do this:
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 layout 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 <apcupsdsource>/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
If all there things check out and you still can’t see the UPS, something is
more seriously wrong than this manual can cover – find expert help. If you
are unable to list USB devices or drivers, you kernel may not be USB-capable
and that needs to be fixed. Please check if your kernel has the three patches
listed in the <apcupsd-source>/examples directory. Each of the files ends
with the name .patch, and at the current writing they are:
For example, RedHat 9 and/or pre-2.4.22 kernels are known to need the
linux-2.4.20-USB-reject.patch for APC SmartUPS XL series devices.
There are also a few email files that you can consult in the examples directory
for additional information and details.
Finally, check your Kernel Config. You will find more information about it
at:
Kernel Config.
KNOWN ISSUES WITH BSD USB
The BSD USB driver for apcupsd is BETA software and has some known
issues.
- FreeBSD lockups: Some users have experienced lockups (apcupsd stops
responding) on FreeBSD systems. In at least one case this problem was
worked around by disabling pthreads (—disable-pthreads flag to configure).
The problem seems to be caused by a FreeBSD kernel bug.
- FreeBSD kernel panics if USB cable is unplugged while apcupsd is running.
This is another kernel bug and is most easily worked around by not hotunplugging the UPS while apcupsd is running.
PLATFORMS & VERSIONS
The new (beta) FreeBSD USB driver supports FreeBSD, OpenBSD and
NetBSD. (Thanks go to the *BSD developers who kept a nearly identical
interface across all three platforms.)
The driver has been tested with the following platform versions:
FreeBSD-5.3(Primary development platform)
28
FreeBSD-4.11
NetBSD-2.0
NetBSD-1.6.2
OpenBSD-3.6
FreeBSD-5.3 has had the most testing since it is the primary platform on
which the driver is developed. The other platforms and versions have had
somewhat less testing. The only architecture tested so far (on any platform)
is i386, althought there is no reason to think it will not work on other archs.
If you run the driver on a new platform version or architecture, please report
your experience to the apcupsd-users mailing list.
KERNEL CONFIGURATION
You will need to rebuild your kernel in order to disable the uhid driver.
uhid is not sufficient for apcupsd at this time and we need to prevent it
from grabbing the UPS device. You should disable the following devices in
your kernel config file (comment them out):
FreeBSD (you WILL NOT lose use of USB keyboard and mouse): uhid
NetBSD (you WILL lose use of USB keyboard and mouse): uhidev, ums,
wsmouse, ukbd, wskbd, uhid
OpenBSD (you WILL lose use of USB keyboard and mouse): uhidev, ums,
wsmouse, ukbd, wskbd, uhid
For detailed information on rebuilding your kernel, consult these references:
After building a properly configured kernel, reboot into that kernel and
plug in your UPS USB cable. You should see a dmesg log message like the
following:
ugen0: American Power Conversion Back-UPS RS 1500 FW:8.g6 .D USB
FW:g6, rev 1.10/1.06, addr 2
29
Loading...
+ 203 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.