[Nut-upsuser] Incorrect battery.runtime.low being reported?
Charles Lepple
clepple at gmail.com
Tue Mar 8 04:00:53 UTC 2016
On Mar 6, 2016, at 1:40 AM, Mike Lee <curby+forums at cur.by> wrote:
>
> As part of the desired second configuration, I reset the UPS to report
> low battery when it had 10 minutes (600s) of estimated battery left.
> However, battery.runtime.low as reported to NUT is still the default
> of 120.
"There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors."
-- https://twitter.com/secretGeek/status/7269997868
It seems like the NUT usbhid-ups driver is a little overzealous when it comes to caching UPS values associated with NUT variables: it is not refreshing certain variables unless they were changed through NUT.
This is due to the HU_FLAG_SEMI_STATIC flag here (so other similarly-marked variables would be affected as well):
https://github.com/networkupstools/nut/blob/master/drivers/apc-hid.c#L309
If you stop and start the driver, it should refresh.
I created an issue on Github so we don't forget: https://github.com/networkupstools/nut/issues/268
--
Charles Lepple
clepple at gmail
More information about the Nut-upsuser
mailing list