[Nut-upsuser] persistent "low battery" condition

Charles Lepple
2015-01-09T13:45:56Z

On Jan 8, 2015, at 11:43 PM, Graham Menhennitt <graham at
menhennitt.com.au> wrote:

> Hello Nutters,
>
> I'm running nut 2.7.2 on FreeBSD 10-stable (via the FreeBSD port) with
an APC Back-UPS CS 350 connected via USB. I get persistent (every few minutes)
messages logged "battery is low" but I don't understand why. I
don't think it's for the reason described in the FAQ (but I'm not
100% sure).

I think that FAQ #39 ("My APC UPS keeps reporting OL LB, even after it?s
been charging for many hours") refers to a continuous LB state.

> In the trace output I can see that UPS.PowerSummary.RunTimeToEmpty is
usually around 150 - 170 seconds. Occasionally it drops to 105. I don't see
any reason why the load would be changing significantly. In any case, I've
set the threshold to 90 seconds in ups.conf.
>
> See below for debug info.
>
> If somebody could offer suggestions on how to fix it, I'd be very
grateful.
>
> Thanks in advance,
>     Graham
>
> ups.conf:
> [maxwell]
>         driver = usbhid-ups
>         port = auto
>         override.battery.runtime.low = 90
The information flow for the majority of the UPS status in NUT looks like this:

UPS -> driver -> upsd -> client (upslog, upsmon, etc)

The override.* settings get parsed by the driver, but by themselves, they
don't affect the UPS - they modify values stored in the driver, and things
"downstream". When the UPS provides the values for ups.status (in
particular, the LB flag), then the UPS is using its internal value for
battery.runtime.low (if it has one), and the UPS is not affected by the
battery.runtime.low setting in the driver.

There is an exception that is discussed in the apcsmart man page (and
potentially applies to all Back-UPS models, USB or serial):

> ""New" units have battery.runtime.low, but depending on
battery quality, firmware
> version, calibration and UPS load - this variable can be underestimated
quite a bit -
> especially right after going into OB state. This in turn can cause LB to be
> asserted, which under normal conditions will cause NUT to initiate the
> shutdown. You might want to disable this condition entirely, when relying
on
> ignorelb option (this was actually the main motivation behind introduction
of
> such feature)."

So you probably want to set "ignorelb" in order for the override to
take effect-- although the apcsmart man page is effectively recommending the use
of battery.charge, which is a percentage rather than a time. (That may not be an
issue if the batteries are replaced proactively.)

> output of /usr/local/libexec/nut/usbhid-ups -a maxell -DD at a time when
low battery is reported:

hmm, are you sure that this log matches the time of the LB event?

The file drivers/usbhid-ups.c is looking for any of the following conditions to
declare LB:

? STATUS(LOWBATT)
? STATUS(TIMELIMITEXP)
? STATUS(SHUTDOWNIMM)

The mapping to HID Path names will depend on the model, but STATUS(LOWBATT) can
come from ...BelowRemainingCapacityLimit, which is 0 in both instances in your
log. STATUS(TIMELIMITEXP) maps to ...RemainingTimeLimitExpired, which I
don't see, and STATUS(SHUTDOWNIMM) would cause an ups.alarm message to show
up in upsc.

--
Charles Lepple
clepple at gmail



-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20150109/4b4d7886/attachment.html>