How to setup apcupsd for BackUPS BR1000G-IN on CentOS 6.6

apcupsd is linux counter part of PowerChute windows program shipped by APC for their UPS models. In this article we will go over how to properly setup apcupds to work with APC BackUPS BR1000G-IN also some times known as RS1000G on CentOS 6.6 . Entire setup process looks normal according to the nice manual that apcupsd comes with except in the end it is not able to communicate with UPS if you follow all the steps mentioned in there. We are going to install it from source. So, you need to have compiler (g++) and usb libraries preinstalled on the machine First get the latest version of apcupsd
yum install gcc-c++
yum install libusb-devel
cd /usr/local/
wget http://downloads.sourceforge.net/project/apcupsd/apcupsd%20-%20Stable/3.14.13/apcupsd-3.14.13.tar.gz
tar -zxvf apcupsd-3.14.13.tar.gz
cd apcupsd-3.14.13
./configure --enable-usb --enable-modbus-usb
if there are any required libraries missing configure command will print it out.
make 
make install
The configuration file goes into /etc/apcupsd/apcupsd.conf Edit this file with your favourite text editor
vim /etc/apcupsd/apcupsd.conf
Change the file to look like below
UPSCABLE usb
UPSTYPE usb
DEVICE /dev/usb/hiddev0
LOCKFILE /var/lock
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd
NOLOGINDIR /etc
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 0.0.0.0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0

most of them are default options except the following UPSCABLE usb BR1000G-IN ships with cable model 940-0127E but if you specify this option apcupds spits out error message "Bogus option" UPSTYPE is set to usb The important line is DEVICE . Though the manual and comments in config file says to leave out this line blank for usb UPS models, apcupsd won't find BR1000G-IN if you leave it as empty. You need to provide the correct device path here. To find out the name that you UPS got assigned by OS run the following command
dmesg|grep American\ Power
On my machine it prints out
hid-generic 0003:051D:0002.0001: hiddev0,hidraw0: USB HID v1.00 Device [American Power Conversion Back-UPS RS 1000G-IN FW:900.L4 .I USB FW:L4 ] on usb-0000:00:14.0-4/input0
As you can see from the above line its hiddev0 so we will change DEVICE line to reflect this
DEVICE /dev/usb/hiddev0
Now you can start apcupsd by running following command
/etc/init.d/apcupsd start
And run another command to make sure that apcupsd is communicating with UPS
apcaccess
Output will be something like this
APC      : 001,037,0971
DATE     : 2015-09-05 22:51:49 +0530  
HOSTNAME : localhost.localdomain
VERSION  : 3.14.13 (02 February 2015) redhat
UPSNAME  : localhost.localdomain
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2015-09-04 20:28:33 +0530  
MODEL    : Back-UPS RS 1000G-IN 
STATUS   : ONLINE 
LINEV    : 238.0 Volts
LOADPCT  : 7.0 Percent
BCHARGE  : 100.0 Percent
TIMELEFT : 87.5 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
SENSE    : High
LOTRANS  : 170.0 Volts
HITRANS  : 288.0 Volts
ALARMDEL : 30 Seconds
BATTV    : 27.3 Volts
LASTXFER : Unacceptable line voltage changes
NUMXFERS : 1
XONBATT  : 2015-09-05 19:39:13 +0530  
TONBATT  : 0 Seconds
CUMONBATT: 2 Seconds
XOFFBATT : 2015-09-05 19:39:15 +0530  
SELFTEST : NO
STATFLAG : 0x05000008
SERIALNO : EB1214007152  
BATTDATE : 2015-09-03
NOMINV   : 230 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 600 Watts
FIRMWARE : 900.L4 .I USB FW:L4
END APC  : 2015-09-05 22:52:00 +0530  
Now you have a working setup and you can perform some of the tests mentioned in apcupsd manual.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Syntax highlight code surrounded by the <pre class="brush: lang">...</pre> tags, where lang is one of the following language brushes: bash, php, plain, python.

More information about formatting options

Image CAPTCHA
Enter the characters shown in the image.