On May 15, 2014, at 9:39 PM, Stefan Bruda wrote:

> What bugs be though is that I cannot seem to be able to read the
> remaining run time on battery.  The battery charge is also widely
> inaccurate (it drops to zero really fast and stays there).  I read
> somewhere that the usb.debug numbers may hold the key to this (at
> least to the running time that is), but I don't know what to do with
> them (and I can no longer find that piece of information...).

Here's where the battery.charge variable is calculated:

   
https://github.com/networkupstools/nut/blob/master/drivers/tripplite_usb.c#L1099

   battery_charge = (unsigned)(s_value[5]);

(In that file, the 3003 protocol is denoted by "tl_model == 
TRIPP_LITE_SMARTPRO".)

Due to the command prefix characters in the protocol, the ups.debug.S hex 
values are actually indexed from 1 as follows:

              1  2  3  4  5  6  7

ups.debug.S: 31 30 30 00 28 30 0d '100..0.'

Hence, your s_value[5] yields 0x28 == 40%.

That said, a lot of information was either observed empirically, or taken from 
this email:

   
http://lists.alioth.debian.org/pipermail/nut-upsuser/2005-September/000218.html

You will note that neither battery charge nor runtime is listed there.

It is possible that a better value for the state-of-chage could be calculated, 
similar to the other protocols:

   
https://github.com/networkupstools/nut/blob/master/drivers/tripplite_usb.c#L1129

However, calculating runtime usually requires the UPS to do a battery test, and 
observe the voltage while under load. This unit might not be capable of doing 
that.

-- 
Charles Lepple
clepple@gmail




_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Reply via email to