Configuring nut

Got a new Bx1200Mi-Gr which I would like to connect to the router (running 21.02.1) for monitoring.

apcaccess shows all relevant information, so I guess apcupsd is running fine:

APC      : 001,036,0881
DATE     : 2021-10-30 19:07:39 +0000  
HOSTNAME : router-casa-andrea
VERSION  : 3.14.14 (31 May 2016) unknown
UPSNAME  : Bx1200Mi-Gr
CABLE    : USB Cable
UPSMODE  : Stand Alone
STARTTIME: 2021-10-30 19:07:38 +0000  
MODEL    : Back-UPS BX1200MI 
LINEV    : 239.0 Volts
LOADPCT  : 10.0 Percent
BCHARGE  : 100.0 Percent
TIMELEFT : 37.4 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
SENSE    : High
LOTRANS  : 150.0 Volts
HITRANS  : 290.0 Volts
ALARMDEL : No alarm
BATTV    : 13.6 Volts
LASTXFER : Automatic or explicit self test
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
STATFLAG : 0x05000008
SERIALNO : xxxxxxxxxxx
BATTDATE : 2001-01-01
NOMINV   : 230 Volts
NOMBATTV : 12.0 Volts
NOMPOWER : 650 Watts
FIRMWARE : 294201G -302201G 
END APC  : 2021-10-30 19:15:49 +0000

Running nut-scanner on a debian desktop I get the following:

I've tried copying the relevant bits to /etc/config/nut_server but it still won't start:

config driver_global 'driver_global'
        option user nut

config driver 'upsname'
        option driver usbhid-ups
        option port auto
#       option enable_usb_serial 0

config user
        option username upsuser
        option password upspassword
#       option actions optional-action
#       list instcmd optional-instant-command
        option upsmon master

config listen_address
        option address ::1
#       option port 3493

config upsd 'upsd'
#       option maxage 15
#       option statepath /var/run/nut
#       option maxconn 1024
#       option runas nut
# NB: certificates only apply to SSL-enabled version
#       option certfile /usr/local/etc/upsd.pem

I've tried luci-app-nut but it's not really working well and it didn't help.

What am I doing wrong?

Very new to this myself, but I was recently having issues because the OpenWRT config (like you've posted above) wasn't getting properly converted back into the app's native config format.

Can you build a native config file for nut (same as you'd do for any other Linux distro) and run nut manually from the command line, just to see whether that part works? That will at least tell you whether the problem lies with the nut side of things or the OpenWRT side.

Also I note you aren't specifying the USB vendor or product IDs in the /etc/config/nut_server you posted. Does nut autodetect USB devices or do you need to specify which USB device you want it to talk to?

So, recap of what I have discovered / verified so far:

  • apcupsd and nut are alternatives (I was misled by some bits of the documentation and because I initially installed collect-apcupsd)
  • nut-scanner on desktop finds the ups, using the same data in /etc/nut/ups.conf (after breaking the symlink and fixing the permissions) won't work: nut loops a few times then gives up. I'd say the problem lies with the OpenWRT package, most likely.
  • the full USB IDs are only required if you have multiple units to be monitored

Anyway, since the main goal of this purchase was to protect the NAS I'll let it be the master and be on my way. Using the router as master would have allowed me to occasionally suspend the NAS but with the NAS as ups master all I have to do is plug in the cable: it just works.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.