<div dir="ltr"><div>Thanks! Now trying to make sense of this :) Partially notes to myself, partially to whoever might want to peek deeper into the driver... If only we had some active Qx experts (or wanna-be's)!..<br></div><div><br></div><div><a class="gmail_plusreply" id="plusReplyChip-0">@tbsky:</a><br></div><div>
<div>Can you please check if 2.7.4 also reports the huge voltages for
the 3kW and 10kW units, or something around 13.5V? Does it set
"battery.packs" to 20 or 6?</div><div>Namely, I wonder if the new
"battery_voltage_reports_one_pack" handling (and with no such option in
your configs) misfires here somehow?..</div><div><br></div><div>Also, can you please re-run the tests with the PR-ed branch build and higher verbosity (e.g. `<code class="gmail-notranslate">./nutdrv_qx -a ftups
-DDDDDD
-d1</code>`) to help trace whether values optionally guessed by
qx_initbattery() are in fact guessed or directly provided by respective
devices (and subdrivers)?..</div><div><br></div>
</div><div>Findings and ramblings:<br></div><div><br></div><div>* the 2kV model is handled by a different subdriver than the other two.</div><div>* A "battery_number" ("number of batteries that make a pack") is unique to drivers/nutdrv_qx_voltronic.c and seems to be in 0..9 range yet the driver gets a "20" value somewhere (setting? protocol?) It is not further reported as a dstate value, it seems.<br></div><div>* There are separately "battery_packs" which are 0.99 per comments in the same subdriver.</div><div>* Reported battery voltages seem huge, and maybe scale with the amount of batteries (comments seem to imply that). I wonder if in fact the driver should report single-battery (pack) voltages, e.g. (<code class="gmail-notranslate">272.9</code>/20)=13,645 and (82.0/6)=13.67 respectively?..</div><div>* Note: To complicate matters more, and as was among inputs for the PR, some terminology (and devices) deal with "cells" which can make up a single battery, down to reporting their individual voltages in the 2V range...</div><div><br></div><div>So far it seems that for the bigger devices (and their driver) the "battery.packs" is reported and "known" so there is less guesswork involved. For the 2kV device it does log some progress through guesswork:</div><div>
<pre class="gmail-notranslate"><code class="gmail-notranslate">
<code class="gmail-notranslate">No values for battery high/low voltages
Using 'guesstimation' (low: 10.400000, high: 15.000000)!</code>
Autodetected 1 as number of battery packs [12/13.50]
Battery runtime will not be calculated (runtimecal not set)</code></pre>
</div><div>and ends up with some possibly measured and some guessed voltages:</div><div>
<pre class="gmail-notranslate"><code class="gmail-notranslate">battery.charge: 67
battery.voltage: 13.5
battery.voltage.high: 15.00
battery.voltage.low: 10.40
battery.voltage.nominal: 12.0</code></pre>
</div><div>and probably ends up guessing the charge in qx_battery() if such dstate value is not yet available (e.g. from device protocol... or if the PR botched something, e.g. order of reading/guessing somehow):</div><div> batt.chrg.act = 100 * (batt.volt.act - batt.volt.low) / (batt.volt.high - batt.volt.low);<br></div><div>would be ( 100 * (13.5 - 10.4) / (15.0 - 10.4) ) = 67.39... <br></div><div><br>Close enough to explain the value seen, at least.<br></div><div><br></div><div>Jim<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 17, 2023 at 10:04 AM d tbsky <<a href="mailto:tbskyd@gmail.com">tbskyd@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Jim Klimov via Nut-upsuser <<a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a>><br>
><br>
> Cheers,<br>
><br>
> One PR waiting to get into 2.8.1 release timeframe is <a href="https://github.com/networkupstools/nut/pull/1652" rel="noreferrer" target="_blank">https://github.com/networkupstools/nut/pull/1652</a> stemming from issue <a href="https://github.com/networkupstools/nut/issues/1279" rel="noreferrer" target="_blank">https://github.com/networkupstools/nut/issues/1279</a><br>
><br>
> The gist of it is that "battery.voltage" and "battery.charge" were not always reported correctly with nutdrv-qx driver (might be handled better by blazer drivers though), and the overrides tried by issue posters did not help them with original state of NUT codebase.<br>
<br>
I tried it on three ups: 10kv online, 3kv online, 2kv offline.<br>
all the battery.voltage are fine and the same value as 2.7.4.<br>
the battery.charge report of 10kv and 3kv are fine. but 2kv is wrong.<br>
with 2.7.4 the 2kv battery.charge is reporting 100. but the new code<br>
is reporting 67. details below:<br>
<br>
10KV:<br>
./nutdrv_qx -a ftups -d1<br>
Network UPS Tools - Generic Q* USB/Serial driver 0.33<br>
(Windows-v2.8.0-alpha3-1252-g757813e)<br>
USB communication driver (libusb 0.1) 0.44<br>
Using protocol: Voltronic 0.07<br>
battery_number: 20<br>
battery_number, settable range: 1..9<br>
bypass_alarm: enabled<br>
battery_alarm: enabled<br>
bypass_when_off: disabled<br>
alarm_control: enabled<br>
converter_mode: disabled<br>
eco_mode: disabled<br>
battery_open_status_check: enabled<br>
bypass_forbidding: disabled<br>
setvar(bypass_when_off, disabled)<br>
bypass_when_off is already disabled<br>
setvar: FAILED<br>
max_bypass_volt: 264<br>
max_bypass_volt, settable range: 231..276<br>
min_bypass_volt: 110<br>
min_bypass_volt, settable range: 110..209<br>
max_bypass_freq: 64.0<br>
max_bypass_freq, settable range: 61.0..64.0<br>
min_bypass_freq: 56.0<br>
min_bypass_freq, settable range: 56.0..59.0<br>
No values for battery high/low voltages<br>
Using 'guesstimation' (low: 208.000000, high: 300.000000)!<br>
setvar(ups.delay.start, 60)<br>
setvar: SUCCEED<br>
setvar(ups.delay.shutdown, 12)<br>
setvar: SUCCEED<br>
battery.charge: 100<br>
battery.packs: 1<br>
battery.protection: yes<br>
battery.runtime: 600<br>
battery.voltage: 272.9<br>
battery.voltage.high: 300.00<br>
battery.voltage.low: 208.00<br>
battery.voltage.nominal: 240.0<br>
device.model: G10K<br>
device.type: ups<br>
<a href="http://driver.name" rel="noreferrer" target="_blank">driver.name</a>: nutdrv_qx<br>
driver.parameter.bypass_when_off: disabled<br>
driver.parameter.offdelay: 12<br>
driver.parameter.ondelay: 60<br>
driver.parameter.pollfreq: 30<br>
driver.parameter.pollinterval: 10<br>
driver.parameter.port: auto<br>
driver.parameter.synchronous: yes<br>
driver.state: dumping<br>
driver.version: Windows-v2.8.0-alpha3-1252-g757813e<br>
driver.version.data: Voltronic 0.07<br>
driver.version.internal: 0.33<br>
driver.version.usb: libusb-0.1 (or compat)<br>
input.current.nominal: 45.0<br>
input.frequency: 59.9<br>
input.frequency.nominal: 60.0<br>
input.phases: 1<br>
input.transfer.high: 231<br>
input.transfer.high.max: 244<br>
input.transfer.high.min: 231<br>
input.transfer.low: 209<br>
input.transfer.low.max: 209<br>
input.transfer.low.min: 196<br>
input.voltage: 218.7<br>
input.voltage.nominal: 230.0<br>
outlet.0.switchable: no<br>
output.current: 2.8<br>
output.current.nominal: 45<br>
output.frequency: 59.9<br>
output.frequency.nominal: 60.0<br>
output.phases: 1<br>
output.powerfactor: 0.8<br>
output.voltage: 218.7<br>
output.voltage.nominal: 220.0<br>
ups.beeper.status: enabled<br>
ups.delay.shutdown: 12<br>
ups.delay.start: 60<br>
ups.firmware: 00077.13<br>
ups.firmware.aux: P02<br>
ups.load: 7<br>
ups.power.nominal: 10000<br>
ups.productid: 5161<br>
ups.start.auto: yes<br>
ups.status: OL<br>
ups.temperature: 25.4<br>
ups.type: online<br>
ups.vendorid: 0665<br>
<br>
3KV:<br>
./nutdrv_qx -a ftups -d1<br>
Network UPS Tools - Generic Q* USB/Serial driver 0.33<br>
(Windows-v2.8.0-alpha3-1252-g757813e)<br>
USB communication driver (libusb 0.1) 0.44<br>
Using protocol: Voltronic 0.07<br>
device.serial: UPS reported a non-significant serial [00000000000000]<br>
battery_number: 6<br>
battery_number, settable range: 1..9<br>
bypass_alarm: enabled<br>
battery_alarm: enabled<br>
bypass_when_off: disabled<br>
alarm_control: enabled<br>
converter_mode: disabled<br>
eco_mode: disabled<br>
bypass_forbidding: disabled<br>
site_fault_detection: disabled<br>
setvar(bypass_when_off, disabled)<br>
bypass_when_off is already disabled<br>
setvar: FAILED<br>
max_bypass_volt: 132<br>
max_bypass_volt, settable range: 120..140<br>
min_bypass_volt: 85<br>
min_bypass_volt, settable range: 85..115<br>
max_bypass_freq: 63.0<br>
max_bypass_freq, settable range: 61.0..70.0<br>
min_bypass_freq: 57.0<br>
min_bypass_freq, settable range: 50.0..59.0<br>
No values for battery high/low voltages<br>
Using 'guesstimation' (low: 62.400000, high: 90.000000)!<br>
setvar(ups.delay.start, 60)<br>
setvar: SUCCEED<br>
setvar(ups.delay.shutdown, 30)<br>
setvar: nothing to do... [ups.delay.shutdown]<br>
battery.charge: 100<br>
battery.energysave: no<br>
battery.packs: 1<br>
battery.protection: yes<br>
battery.runtime: 2820<br>
battery.voltage: 082.0<br>
battery.voltage.high: 90.00<br>
battery.voltage.low: 62.40<br>
battery.voltage.nominal: 72.0<br>
device.model: 3K<br>
device.type: ups<br>
<a href="http://driver.name" rel="noreferrer" target="_blank">driver.name</a>: nutdrv_qx<br>
driver.parameter.bypass_when_off: disabled<br>
driver.parameter.offdelay: 30<br>
driver.parameter.ondelay: 60<br>
driver.parameter.pollfreq: 30<br>
driver.parameter.pollinterval: 10<br>
driver.parameter.port: auto<br>
driver.parameter.synchronous: yes<br>
driver.state: dumping<br>
driver.version: Windows-v2.8.0-alpha3-1252-g757813e<br>
driver.version.data: Voltronic 0.07<br>
driver.version.internal: 0.33<br>
driver.version.usb: libusb-0.1 (or compat)<br>
input.current.nominal: 27.0<br>
input.frequency: 59.9<br>
input.frequency.nominal: 60.0<br>
input.phases: 1<br>
input.transfer.high: 116<br>
input.transfer.high.max: 122<br>
input.transfer.high.min: 113<br>
input.transfer.low: 104<br>
input.transfer.low.max: 107<br>
input.transfer.low.min: 98<br>
input.voltage: 112.2<br>
input.voltage.nominal: 110.0<br>
outlet.0.switchable: no<br>
output.current: 5.4<br>
output.current.nominal: 27<br>
output.frequency: 59.9<br>
output.frequency.nominal: 60.0<br>
output.phases: 1<br>
output.power.maximum.percent: 19<br>
output.power.minimum.percent: 18<br>
output.powerfactor: 0.8<br>
output.voltage: 109.8<br>
output.voltage.nominal: 110.0<br>
ups.beeper.status: enabled<br>
ups.delay.shutdown: 30<br>
ups.delay.start: 60<br>
ups.firmware: 00204.06<br>
ups.firmware.aux: P01<br>
ups.load: 18<br>
ups.power.nominal: 3000<br>
ups.productid: 5161<br>
ups.start.auto: yes<br>
ups.start.battery: yes<br>
ups.status: OL<br>
ups.temperature: 17.2<br>
ups.type: online<br>
ups.vendorid: 0665<br>
<br>
2KV:<br>
./nutdrv_qx -a ftups -d1<br>
Network UPS Tools - Generic Q* USB/Serial driver 0.33<br>
(Windows-v2.8.0-alpha3-1252-g757813e)<br>
USB communication driver (libusb 0.1) 0.44<br>
Using protocol: Voltronic-QS 0.09<br>
No values for battery high/low voltages<br>
Using 'guesstimation' (low: 10.400000, high: 15.000000)!<br>
Autodetected 1 as number of battery packs [12/13.50]<br>
Battery runtime will not be calculated (runtimecal not set)<br>
setvar(ups.delay.start, 60)<br>
setvar: SUCCEED<br>
setvar(ups.delay.shutdown, 30)<br>
setvar: nothing to do... [ups.delay.shutdown]<br>
battery.charge: 67<br>
battery.voltage: 13.5<br>
battery.voltage.high: 15.00<br>
battery.voltage.low: 10.40<br>
battery.voltage.nominal: 12.0<br>
device.type: ups<br>
<a href="http://driver.name" rel="noreferrer" target="_blank">driver.name</a>: nutdrv_qx<br>
driver.parameter.bypass_when_off: disabled<br>
driver.parameter.offdelay: 30<br>
driver.parameter.ondelay: 60<br>
driver.parameter.pollfreq: 30<br>
driver.parameter.pollinterval: 10<br>
driver.parameter.port: auto<br>
driver.parameter.synchronous: yes<br>
driver.state: dumping<br>
driver.version: Windows-v2.8.0-alpha3-1252-g757813e<br>
driver.version.data: Voltronic-QS 0.09<br>
driver.version.internal: 0.33<br>
driver.version.usb: libusb-0.1 (or compat)<br>
input.voltage: 119.5<br>
input.voltage.fault: 119.5<br>
output.current.nominal: 6.0<br>
output.frequency: 60.1<br>
output.frequency.nominal: 60<br>
output.voltage: 119.5<br>
output.voltage.nominal: 110<br>
ups.beeper.status: enabled<br>
ups.delay.shutdown: 30<br>
ups.delay.start: 60<br>
ups.firmware.aux: PM-V<br>
ups.load: 32<br>
ups.productid: 5161<br>
ups.status: OL<br>
ups.type: offline / line interactive<br>
ups.vendorid: 0665<br>
</blockquote></div>