APC UPS (Back-UPS ES 500) on ubuntu
The UPS model I've got (and is pretty common APC product in India) is BackUPS ES 500. The device comes with an USB connector. The Back-up they (the APC fellows) claim is 20 minutes... though it just gives around 12 minutes for me even after a complete recharge. (But the UPS has saved my PC on many occasions - so, worth the compromise).
The UPS comes with a CD, which has the Powerchute software for Windows. But they don't provide software or support for Linux. (Once when I had called up the customer support to inquire about software for Linux, a person there had asked "Whats Linux, Sir?" :D) which more or less explains how serious they're about Linux. Nevertheless, we have open source alternatives :) (which is why OSS rocks).
The best among the alternatives happens to be apcupsd (APC UPS daemon).
When using fedora, I don't remember having any issues getting the apcupsd daemon running. The only big deal was to take the rpm, install it and start the daemon. But that was probably the only thing that was so straightforward... every other package needed compiling from source (unless there was an rpm for it on freshrpms.net)
Installing apcupsd on ubuntu is straightforward. One has to just apt-get it from the repository. But, ironically, on ubuntu, getting apcupsd running needs some tweaking. From the day I switched over to ubuntu, I've seldom tweaked anything to get packages working... which makes this tweak worth to be mentioned on the blog. At first shot, here's what you get:
hpn@kapila:~$ sudo /etc/init.d/apcupsd start
Please check your configuration ISCONFIGURED
I googled around, and found this nice document. The document is for debian, but is the same on ubuntu... so works. Here's what I did for my BackUPS ES 500, with reference to that document:
open /etc/apcupsd/apcupsd.conf
and set:
UPSNAME myups
UPSCABLE usb
UPSTYPE usb
NETSERVER on
DEVICE - commented out.
open /etc/default/apcupsd
and change ISCONFIGURED=no to ISCONFIGURED=yes
done!
and do a apcaccess, you should get something similiar to this:
sh-3.00# apcaccess
APC : 001,033,0816
DATE : Sun May 22 18:22:13 IST 2005
HOSTNAME : kapila
RELEASE : 3.10.17
VERSION : 3.10.17 (18 March 2005) debian
UPSNAME : myups
CABLE : USB Cable
MODEL : Back-UPS ES 500
UPSMODE : Stand Alone
STARTTIME: Sun May 22 18:22:13 IST 2005
STATUS : TRIM ONLINE
LINEV : 000.0 Volts
LOADPCT : 49.0 Percent Load Capacity
BCHARGE : 100.0 Percent
TIMELEFT : 29.2 Minutes
MBATTCHG : 20 Percent
MINTIMEL : 10 Minutes
MAXTIME : 0 Seconds
LOTRANS : 195.0 Volts
HITRANS : 255.0 Volts
ALARMDEL : Always
BATTV : 13.3 Volts
NUMXFERS : 0
TONBATT : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x0200000A Status Flag
SERIALNO : NB18008004272
BATTDATE : 2004-11-17
NOMBATTV : 12.0
FIRMWARE : 50.m3.I USB FW:m3
APCMODEL : Back-UPS ES 500
END APC : Sun May 22 18:22:18 IST 2005
and now, whenever there's a power failure, something similiar to the following prop up on the terminal with a beep:
Broadcast Message from root@kapila
(somewhere) at 18:26 ...Warning power loss detected on UPS myups
Broadcast Message from root@kapila
(somewhere) at 18:26 ...Power failure on UPS myups. Running on batteries.
and it cleanly shuts down the comp once the batteries are used up! woot! ;)
- 3975 reads



Comments
[...] the detailed workaround. Check it. Getting APC UPS daemon running to monitor your UPS See this post. Few applications that you might want to [...]
This worked great for me on ubuntu edgy. thanks