This describes how to connect an APC SmartUps SU-700 via USB on a Linksys EA3500 router. This includes collecting the data, and displaying graphs.
opkg update opkg install kmod-usb-serial-pl2303 opkg install apcupsd opkg install collectd-mod-apcups
# ls -la /dev/ttyUSB* crw------- 1 root root 188, 0 Dec 1 00:29 /dev/ttyUSB0
# cd /etc/apcupsd # vi apcupsd.conf
## apcupsd.conf v1.1 ## UPSNAME APC700 UPSCABLE smart UPSTYPE apcsmart DEVICE /dev/ttyUSB0 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
# /etc/init.d apcupsd restart
# apcaccess APC : 001,034,0829 DATE : 2017-12-01 18:11:01 -0700 HOSTNAME : myrouter VERSION : 3.14.14 (31 May 2016) unknown UPSNAME : APC700 CABLE : Custom Cable Smart DRIVER : APC Smart UPS (any) UPSMODE : Stand Alone STARTTIME: 2017-12-01 18:10:11 -0700 MODEL : Smart-UPS 700 RM STATUS : ONLINE ...
If you don't have APC UPS graphs at this point, here are some things to check:
Y SM
Y SM
http://192.168.1.1/cgi-bin/luci/admin/statistics/collectd/general
If not, you may not have the patches that added luci-statistics support for the apcups plugin: https://github.com/openwrt/luci/pull/1227. The best fix for this is to upgrade to a version that does.
LoadPlugin apcups <Plugin apcups> Host localhost Port "3551" </Plugin>
If it does not, you can regenerate /var/etc/collectd.conf with this command:
/usr/bin/stat-genconfig > /var/etc/collectd.conf