Open YumingChang02 opened 1 year ago
Interesting case, thanks for reporting :)
At least in the ups.status
it reports only the OL
(on line) flag, so immediately in the driver it does not assume that it has a low battery, it seems.
Where do you have the practical problem (if any) with this situation? Does upsmon
raise an alarm and trigger a host shutdown?
Also, just in case, ask the vendor support if their protocol implementation actually mis-behaves this way (does report run-time and reports as 0) which then would be a bug for them to fix (e.g. you as a paying customer can't predict how well protected your server is for a safe shutdown, without causing an outage for the test)? Or if they do report the runtime, but in some manner that earlier contributors to this NUT driver did not encounter and code for (sort of our bug, PRs welcome)?
Also, can it be just a case of old/dead battery?
@jimklimov If i set battery.runtime.low to anything but 0, it shows OL LB flags. Not really a huge issue, just that it will span over log files. Machines complains about low power but still runs as is. Maybe i'll try to check what the problem is, whether is a vendor or code.
Fast look over log looks like a driver issue?
3.815847 [D3] send: QBV
4.159666 [D5] read [ 0]: (8 bytes) => 28 30 35 34 2e 37 20 30
4.239674 [D5] read [ 8]: (8 bytes) => 34 20 30 31 20 31 30 30
4.271677 [D5] read [ 16]: (8 bytes) => 20 30 30 30 31 39 0d 00
4.271698 [D3] read: (054.7 04 01 100 00019
4.271726 battery_number: 4
4.271735 battery_number, settable range: 1..9
4.271754 [D5] send_to_all: SETINFO battery.packs "1"
4.271765 [D5] send_to_all: SETFLAGS battery.packs RW
4.271778 [D5] send_to_all: ADDRANGE battery.packs 1 99
4.271792 [D5] send_to_all: SETFLAGS battery.packs RW NUMBER
4.271807 [D5] send_to_all: SETINFO battery.charge "100"
4.271823 [D5] send_to_all: SETINFO battery.runtime "0"
4.272062 [D3] send: QLDL
according to ref should be (MM.M NN PP QQQ RRR, where RRR is Remaining backup time (minutes)
Thanks for the trace! So it does seem like a NUT bug, with 19 minutes not interpreted well.
Would it be possible for you to custom-build a NUT master (or use a recent 2.8.1 release if packaged for your system) to check if it works better? There were some changes to QX parser, not sure OTOH if they were limited to the armac
subdriver or benefitted all of them.
Although, looking at source, I think it just picks 3 chars (positions 17..19
) and so only sees the zeroes:
I am not sure if it is a "protocol violation" to have not exactly 21 chars in that response, or if it is just the expected minimal length. Notably, referenced spec says RRR
and the device returns RRRRR
here... but maybe the spec evolved on vendor side
(or is branched by licensors), and we only know of an older/base version...
Per structure comments, probably using 0
for the last element (remainder of line) would be OK; less sure about use of a specific numeric size (e.g. 5
here) with regard to possible buffer overflows (what if a reply does have 3 digits and we walk the array for 5?) - gotta read/trace into the parser to be sure about a safe choice here. Or experiment with larger numbers than the response you have in practice (say, 10
).
I would welcome a PR following a custom build and test on your side, if possible - please check https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests for suggestions about it. Don't forget to bump VOLTRONIC_VERSION
in the driver and perhaps describe the improvement in NEWS.adoc
:)
@YumingChang02 : cheers, just in case - did you have any progress with this issue to share?
Hello there, same here for me. I am using a Bluewalker/Powerwalker with driver nutdrv_qx
and it also shows battery.runtime: 0
but ups.status: OL
I just run a deep test to let the ups determine the runtime (battery went down to 10 %) but still no runtime output.
I got an ATEN OL2000LV, which seems to indicate - runtime when connected to wall power, is there a way to only check battery low when running on battery?