User Tools

Site Tools


doc:howto:apcupsd_es500

APC BackUps ES-500 - Linksys EA3500 - Luci Graphs

This describes how to connect an APC BackUps ES-500 via the USB on a Linksys EA3500 router. This includes collecting the data, and displaying graphs.

Note that the collected data will be lost after a reboot of the router. To save the data, you need to put it on an external device, like a USB flash drive. Connecting both the UPS and a flash drive to a USB hub, which is then connected to the router, works fine for me.

  • Plug in UPS, and Connect cable from UPS to router USB port. This is a custom cable that comes with the UPS.
  • in router command line or Luci web pages, install packages: apcpusd, collectd-mod-apcups
  • for command line, the commands are:
    opkg update
    opkg install kmod-usb-hid
    opkg install apcpusd
    opkg install collectd-mod-apcups
  • On router command line, verify that the USB HID driver is installed and working with command and response:
    # ls -lA /dev/usb
    crw-------    1 root     root      180,  96 Jul 13 14:34 hiddev0
  • If you don't see a line for hiddev#, then something is wrong with the install of kmod-usb-hid.
  • Resolve this, before proceeding.
  • on the router command line, go to the /etc/apcupsd directory, and edit it
    # cd /etc/apcupsd
    # vi
  • use the dd command to delete all the lines in the file
  • use the i command to set the VI editor into "insert" mode.
  • Copy and paste this text into the editor:
    ## apcupsd.conf v1.1 ##
    UPSNAME myups
    UPSCABLE usb
    UPSTYPE usb
    DEVICE /dev/usb/hid/hiddev[0-15]
    LOCKFILE /var/lock
    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
    # max kilobytes
    EVENTSFILEMAX 10
    UPSCLASS standalone
    UPSMODE disable
    # ===== Configuration statements to control apcupsd system logging ========
    # Time interval in seconds between writing the STATUS file; 0 disables
    STATTIME 0
    # Location of STATUS file (written to only if STATTIME is non-zero)
    STATFILE /var/log/apcupsd.status
    LOGSTATS off
    # Time interval in seconds between writing the DATA records to
    #   the log file. 0 disables.
    DATATIME 0
  • type :wq into the editor, to write the new apcupsd.conf, and quit the edit session
  • restart the apcupsd deamon process:
     
    # /etc/init.d apcupsd restart
  • Enter the apcaccess command into the command line, and you should get output like this:
    # apcaccess
    root@g70outside:~# apcaccess 
    APC      : 001,034,0829
    DATE     : 2017-07-15 12:29:26 -0700  
    HOSTNAME : myrouter
    VERSION  : 3.14.14 (31 May 2016) unknown
    UPSNAME  : myups
    CABLE    : USB Cable
    DRIVER   : USB UPS Driver
    UPSMODE  : Stand Alone
    STARTTIME: 2017-07-13 14:34:46 -0700  
    MODEL    : Back-UPS ES 500 
    STATUS   : ONLINE 
    ...
  • Note the STATUS : ONLINE
  • If you don't have "ONLINE", then something is wrong
  • Restart the luci statistics data collection:
    # /etc/init.d/luci_statistics restart
  • In the router web interface, go to Statistics, Graphs, APC UPS
  • You should see the graphs, with data starting on the right side.
  • If not, wait a minute, refresh your browser and you should start to see data being written.
doc/howto/apcupsd_es500.txt · Last modified: 2017/07/16 06:14 by tmomas