I am using NUT with the UPS binding. After a while, the Thing goes off line with a message in the UI that the data are stale.
I have NUT running on a Pi 4B running openhabian.
I saw in the log (journalctl -u nut-driver) that it was exiting with Signal 15:
- Boot 922518458229470eb725485ef60a868d --
Jul 31 02:17:46 openhabian-spring4 systemd[1]: Starting Network UPS Tools - power device driver controller...
Jul 31 02:17:46 openhabian-spring4 upsdrvctl[508]: Using subdriver: CyberPower HID 0.4
Jul 31 02:17:46 openhabian-spring4 upsdrvctl[508]: Network UPS Tools - Generic HID driver 0.41 (2.7.4)
Jul 31 02:17:46 openhabian-spring4 upsdrvctl[508]: USB communication driver 0.33
Jul 31 02:17:46 openhabian-spring4 upsdrvctl[499]: Network UPS Tools - UPS driver controller 2.7.4
Jul 31 02:17:46 openhabian-spring4 usbhid-ups[528]: Startup successful
Jul 31 02:17:46 openhabian-spring4 systemd[1]: Started Network UPS Tools - power device driver controller.
-- Boot 5e4adaf929584a378c3af0aa9efba608 --
Aug 06 06:41:43 openhabian-spring4 systemd[1]: Starting Network UPS Tools - power device driver controller...
Aug 06 06:41:43 openhabian-spring4 upsdrvctl[507]: Using subdriver: CyberPower HID 0.4
Aug 06 06:41:43 openhabian-spring4 upsdrvctl[507]: Network UPS Tools - Generic HID driver 0.41 (2.7.4)
Aug 06 06:41:43 openhabian-spring4 upsdrvctl[507]: USB communication driver 0.33
Aug 06 06:41:43 openhabian-spring4 usbhid-ups[526]: Startup successful
Aug 06 06:41:43 openhabian-spring4 upsdrvctl[499]: Network UPS Tools - UPS driver controller 2.7.4
Aug 06 06:41:43 openhabian-spring4 systemd[1]: Started Network UPS Tools - power device driver controller.
Aug 09 20:32:15 openhabian-spring4 systemd[1]: Stopping Network UPS Tools - power device driver controller...
Aug 09 20:32:15 openhabian-spring4 upsdrvctl[6918]: Network UPS Tools - UPS driver controller 2.7.4
Aug 09 20:32:15 openhabian-spring4 usbhid-ups[526]: Signal 15: exiting
Aug 09 20:32:15 openhabian-spring4 systemd[1]: nut-driver.service: Succeeded.
Aug 09 20:32:15 openhabian-spring4 systemd[1]: Stopped Network UPS Tools - power device driver controller.
Aug 09 20:32:15 openhabian-spring4 systemd[1]: nut-driver.service: Consumed 2min 30.000s CPU time.
Aug 09 20:32:15 openhabian-spring4 systemd[1]: Starting Network UPS Tools - power device driver controller...
Aug 09 20:32:15 openhabian-spring4 upsdrvctl[6922]: Using subdriver: CyberPower HID 0.4
Aug 09 20:32:15 openhabian-spring4 upsdrvctl[6922]: Network UPS Tools - Generic HID driver 0.41 (2.7.4)
Aug 09 20:32:15 openhabian-spring4 upsdrvctl[6922]: USB communication driver 0.33
Aug 09 20:32:16 openhabian-spring4 upsdrvctl[6920]: Network UPS Tools - UPS driver controller 2.7.4
Aug 09 20:32:16 openhabian-spring4 systemd[1]: Started Network UPS Tools - power device driver controller.
Aug 09 20:32:16 openhabian-spring4 usbhid-ups[6924]: Startup successful
Aug 09 20:40:19 openhabian-spring4 systemd[1]: Stopping Network UPS Tools - power device driver controller...
Aug 09 20:40:19 openhabian-spring4 upsdrvctl[8775]: Network UPS Tools - UPS driver controller 2.7.4
Aug 09 20:40:19 openhabian-spring4 usbhid-ups[6924]: Signal 15: exiting
Aug 09 20:40:19 openhabian-spring4 systemd[1]: nut-driver.service: Succeeded.
Aug 09 20:40:19 openhabian-spring4 systemd[1]: Stopped Network UPS Tools - power device driver controller.
Aug 09 20:40:19 openhabian-spring4 systemd[1]: nut-driver.service: Consumed 1.053s CPU time.
Aug 09 20:40:19 openhabian-spring4 systemd[1]: Starting Network UPS Tools - power device driver controller...
Aug 09 20:40:19 openhabian-spring4 upsdrvctl[8779]: Using subdriver: CyberPower HID 0.4
Searching the internet, I suspect this is related to the default MAXAGE setting in upsd.conf of 15 (seconds). I changed it to 25 and will see if that makes a difference.
Taking a different look at syslog, I’m not sure this is the problem, as it seems to recover from the 15 second aging out, but loses connection and fails.
From journalctl | grep upsd
Aug 07 11:34:28 openhabian-spring4 upsd[543]: Connected to UPS [UPS]: usbhid-ups-UPS
Aug 07 11:34:46 openhabian-spring4 upsd[543]: Data for UPS [UPS] is stale - check driver
Aug 07 12:02:24 openhabian-spring4 upsd[543]: Send ping to UPS [UPS] failed: Resource temporarily unavailable
Aug 07 12:02:25 openhabian-spring4 upsd[543]: Connected to UPS [UPS]: usbhid-ups-UPS
Aug 07 12:02:42 openhabian-spring4 upsd[543]: Data for UPS [UPS] is stale - check driver
Aug 07 12:30:20 openhabian-spring4 upsd[543]: Send ping to UPS [UPS] failed: Resource temporarily unavailable
Aug 07 12:30:21 openhabian-spring4 upsd[543]: Connected to UPS [UPS]: usbhid-ups-UPS
Aug 07 12:30:38 openhabian-spring4 upsd[543]: Data for UPS [UPS] is stale - check driver
Aug 07 12:58:18 openhabian-spring4 upsd[543]: Send ping to UPS [UPS] failed: Resource temporarily unavailable
Aug 07 12:58:19 openhabian-spring4 upsd[543]: Connected to UPS [UPS]: usbhid-ups-UPS
Aug 07 12:58:36 openhabian-spring4 upsd[543]: Data for UPS [UPS] is stale - check driver
Aug 07 13:26:14 openhabian-spring4 upsd[543]: Send ping to UPS [UPS] failed: Resource temporarily unavailable
Aug 07 13:26:15 openhabian-spring4 upsd[543]: Connected to UPS [UPS]: usbhid-ups-UPS
Aug 07 13:26:32 openhabian-spring4 upsd[543]: Data for UPS [UPS] is stale - check driver
Aug 07 13:54:11 openhabian-spring4 upsd[543]: Send ping to UPS [UPS] failed: Resource temporarily unavailable
Aug 07 13:54:12 openhabian-spring4 upsd[543]: Connected to UPS [UPS]: usbhid-ups-UPS
Aug 07 13:54:29 openhabian-spring4 upsd[543]: Data for UPS [UPS] is stale - check driver
Aug 07 14:22:06 openhabian-spring4 upsd[543]: Send ping to UPS [UPS] failed: Resource temporarily unavailable
Aug 07 14:22:07 openhabian-spring4 upsd[543]: Connected to UPS [UPS]: usbhid-ups-UPS
Aug 07 14:22:24 openhabian-spring4 upsd[543]: Data for UPS [UPS] is stale - check driver
Aug 07 14:50:02 openhabian-spring4 upsd[543]: Send ping to UPS [UPS] failed: Resource temporarily unavailable
Aug 09 20:25:38 openhabian-spring4 sudo[5507]: openhabian : TTY=pts/1 ; PWD=/etc/nut ; USER=root ; COMMAND=/usr/bin/cat upsd.conf
Aug 09 20:32:15 openhabian-spring4 upsdrvctl[6918]: Network UPS Tools - UPS driver controller 2.7.4
Aug 09 20:32:15 openhabian-spring4 upsd[543]: Can't connect to UPS [UPS] (usbhid-ups-UPS): Connection refused
Aug 09 20:32:15 openhabian-spring4 upsd[543]: write() failed for ::1: Broken pipe
Aug 09 20:32:15 openhabian-spring4 upsd[543]: write() failed for ::1: Broken pipe
Aug 09 20:32:15 openhabian-spring4 upsd[543]: write() failed for ::1: Broken pipe
Aug 09 20:32:15 openhabian-spring4 upsdrvctl[6922]: Using subdriver: CyberPower HID 0.4
Aug 09 20:32:15 openhabian-spring4 upsdrvctl[6922]: Network UPS Tools - Generic HID driver 0.41 (2.7.4)
Aug 09 20:32:15 openhabian-spring4 upsdrvctl[6922]: USB communication driver 0.33
Aug 09 20:32:16 openhabian-spring4 upsdrvctl[6920]: Network UPS Tools - UPS driver controller 2.7.4
Aug 09 20:32:17 openhabian-spring4 upsd[543]: Connected to UPS [UPS]: usbhid-ups-UPS
Aug 09 20:33:29 openhabian-spring4 sudo[7212]: openhabian : TTY=pts/1 ; PWD=/etc/nut ; USER=root ; COMMAND=/usr/bin/nano upsd.conf
Aug 09 20:40:19 openhabian-spring4 upsdrvctl[8775]: Network UPS Tools - UPS driver controller 2.7.4
Aug 09 20:40:19 openhabian-spring4 upsd[543]: Can't connect to UPS [UPS] (usbhid-ups-UPS): No such file or directory
Aug 09 20:40:19 openhabian-spring4 upsdrvctl[8779]: Using subdriver: CyberPower HID 0.4
Aug 09 20:40:19 openhabian-spring4 upsdrvctl[8779]: Network UPS Tools - Generic HID driver 0.41 (2.7.4)
Aug 09 20:40:19 openhabian-spring4 upsdrvctl[8779]: USB communication driver 0.33
Aug 09 20:40:20 openhabian-spring4 upsdrvctl[8778]: Network UPS Tools - UPS driver controller 2.7.4
Aug 09 20:40:21 openhabian-spring4 upsd[543]: Connected to UPS [UPS]: usbhid-ups-UPS
After restarting nut-driver (systemctl restart nut-driver), it works for a while:
openhabian@openhabian-spring4:/etc/nut $ upsc ups
Init SSL without certificate database
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 3400
battery.runtime.low: 300
battery.type: PbAcid
battery.voltage: 14.3
battery.voltage.nominal: 12
device.mfr: CPS
device.model: ABST600
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.data: CyberPower HID 0.4
driver.version.internal: 0.41
input.transfer.high: 140
input.transfer.low: 96
input.voltage: 119.0
input.voltage.nominal: 120
output.voltage: 119.0
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 11
ups.mfr: CPS
ups.model: ABST600
ups.productid: 0501
ups.realpower.nominal: 360
ups.status: OL
ups.test.result: No test initiated
ups.timer.shutdown: -60
ups.timer.start: 0
ups.vendorid: 0764
openhabian@openhabian-spring4:/etc/nut $
I’m just getting started troubleshooting this and will update this with my progress. I welcome any suggestions.
I wasn’t sure what category to put this in, so I left it blank. I think it is a NUT issue, not a binding issue. But I assume other openhab users will face or have faced similar issues, so I’m sharing my experience.