I had the same problems as well, and I lost plenty of time to search for a solution, while in fact it was working fine. So, I am documenting here what happened to me so that others can benefit from it.
First, I am using Raspbian "wheezy" and my UPS is connected through USB (not SmartUps).
For the setup, basically I followed these steps from
ubuntu community:
Code: Select all
raspberrypi$ sudo apt-get install apcupsd
raspberrypi$ sudo vi /etc/apcupsd/apcupsd.conf
UPSNAME MYUPS
UPSCABLE usb
UPSTYPE usb
DEVICE
raspberrypi$ sudo vi /etc/default/apcupsd
ISCONFIGURE=yes
raspberrypi$ sudo /etc/init.d/apcupsd start
raspberrypi$ apcaccess status
TL/DR; Everything was working perfectly at this point. All further testing I did was only sending me on a wild goose chase! The big missing thing, turns out you have to shutdown apcupsd to run apctest AND you have to sudo apctest...
So far, it looked fine. apcaccess is reporting was seams relevant data from my UPS. Now, I wanted to verify all was working fine and went to follow
Apcupsd Quick Start for Beginners, more specifically
Testing Apcupsd. So, it did the following:
Code: Select all
raspberrypi$ ps fax | grep apcupsd
1768 ? Ssl 0:02 /sbin/apcupsd
I only had a single instance of apcupsd running, while the manual showed that I should have three. There was a notice there saying:
If you see only one instance of apcupsd running, don't worry about it as this is normal on most non-Linux systems, and on Linux 2.6.x kernels.
But in fact I am using a linux kernel 3.2.x+ as evidence is shown by running uname
Code: Select all
raspberrypi$ uname -a
Linux raspberrypi 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux
At this point I wasn't sure about what was happenning. apcaccess was showing data. So I followed with next step, checking log messages
Code: Select all
raspberrypi$ cat /var/log/messages | grep apcupsd
Nothing found there... is something amiss? Now I kind of think something is not right, so I decide to check if driver is properly setup. As per documentation, I do dmesg
Code: Select all
raspberrypi$ dmesg
generic-usb 0003:051D:0002.0001: hiddev0: USB HID v1.10 Device [APC Back-UPS ES 450G FW:844.K4 .D USB FW:K4 ] on usb-bcm2708_usb-1.2/input0
My interpretation of the documentations shows, that I should have found something along:
ugen0: American Power Conversion Back-UPS RS 1500 FW:8.g6 .D USB FW:g6, rev 1.10/1.06, addr 2
Note that the ugen driver is called out. If you see uhid instead, it probably means you did not properly disable the uhid driver when you compiled your kernel or perhaps you're not running the new kernel.
Well, I do see hid stuff in my dmesg. Am I doomed? Lets try something else, lets try apctest
Code: Select all
raspberrypi$ apctest
2013-02-16 14:02:35 apctest 3.14.10 (13 September 2011) debian
Checking configuration ...
Attached to driver: usb
sharenet.type = Network & ShareUPS Disabled
cable.type = USB Cable
mode.type = USB UPS Driver
Setting up the port ...
apctest FATAL ERROR in linux-usb.c at line 609
Cannot find UPS device --
For a link to detailed USB trouble shooting information,
please see <http://www.apcupsd.com/support.html>.
apctest error termination completed
That is how I got here in the first place, looking for that FATAL ERROR. I now have all kind of scary options: rebuilding my kernel, compiling Apcupsd from code. None of them are appealing. I am looking for something else, some other tips! After all it seems I have at least something, apcaccess does returns data. But I am afraid I might not be able to operate the UPS and "killpower" so I try it manually!
Code: Select all
raspberrypi$ apcupsd --killpower
apcupsd FATAL ERROR in linux-usb.c at line 609
Cannot find UPS device --
For a link to detailed USB trouble shooting information,
please see <http://www.apcupsd.com/support.html>.
Damn! I do have a problem! I looked around for a while and somehow stumble upon
this guy where I see:
sudo apctest – You have to turn off the apcupsd daemon first, but this hand tool lets you conduct a self test and other great utilities for your UPS.
sudo /etc/init.d/apcupsd stop – stops the apcupsd daemon
sudo /etc/init.d/apcupsd start – starts the apcupsd daemon
Well, I did miss the small note "Shutdown apcupsd if it is running." in the documentation. The documentation also doesn't indicate you need to sudo apctest as well... could it be just that!
Yes IT IS!
Code: Select all
raspberrypi$ sudo /etc/init.d/apcupsd stop
raspberrypi$ sudo apctest
2013-02-16 14:19:36 apctest 3.14.10 (13 September 2011) debian
Checking configuration ...
Attached to driver: usb
sharenet.type = Network & ShareUPS Disabled
cable.type = USB Cable
mode.type = USB UPS Driver
Setting up the port ...
Doing prep_device() ...
You are using a USB cable type, so I'm entering USB test mode
Hello, this is the apcupsd Cable Test program.
This part of apctest is for testing USB UPSes.
Getting UPS capabilities...SUCCESS
Please select the function you want to perform.
1) Test kill UPS power
2) Perform self-test
3) Read last self-test result
4) View/Change battery date
5) View manufacturing date
6) View/Change alarm behavior
7) View/Change sensitivity
8) View/Change low transfer voltage
9) View/Change high transfer voltage
10) Perform battery calibration
11) Test alarm
12) View/Change self-test interval
Q) Quit
Select function number:
My error is that I did not continue the "Testing Apcupsd" steps when I started having discrepancies. Would I have, the next step was to turn off the power and I would have seen the WALL message and eventually the shutdown! I went offscript on a wild goose chase...
Let's hope that if you read this and you also have discrepancies, then it will help you out.