[Nut-upsuser] Fwd: Cyberpower usbhid-ups wrong battery voltage

davor emard davoremard at gmail.com
Wed Apr 2 10:58:13 UTC 2008


HI

Here is relevant -DDDDD dump. From unit descriptors I see only
unit exponent get_unit_expo: 00f0d121 found 7
but I don't see when the physical unit descriptor is read
(indicating unit means Volts)

hid_lookup_usage: UPS -> 00840004
hid_lookup_usage: PowerSummary -> 00840024
hid_lookup_usage: ConfigVoltage -> 00840040
string_to_path: depth = 3
Report[buf]: (2 bytes) => 09 78
PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
get_unit_expo: 00f0d121 found 7
Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x09,
Offset: 0, Size: 8, Value: 12.000000

hid_lookup_usage: UPS -> 00840004
hid_lookup_usage: PowerSummary -> 00840024
hid_lookup_usage: Voltage -> 00840030
string_to_path: depth = 3
Report[buf]: (2 bytes) => 0a d3
PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
get_unit_expo: 00f0d121 found 7
Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x0a, Offset:
0, Size: 8, Value: 21.100000

While lsusb -vvvvv -d .. shows this

            Item(Global): Report ID, data= [ 0x0a ] 10
            Item(Local ): Usage, data= [ 0x30 ] 48
                            Voltage
            Item(Main  ): Feature, data= [ 0xa2 ] 162
                            Data Variable Absolute No_Wrap Linear
                            No_Preferred_State No_Null_Position
Volatile Bitfield
            Item(Global): Unit, data= [ 0x00 ] 0
                            System: None, Unit: (None)  <======
undimensioned unit
            Item(Global): Unit Exponent, data= [ 0x00 ] 0
                            Unit Exponent: 0
            Item(Local ): Usage, data= [ 0x02 ] 2
                            Present Status
            Item(Main  ): Collection, data= [ 0x02 ] 2
                            Logical

Because HID descriptors allow units of length, mass, time, temperature,
CURRENT (A), luminous intensity but doesn't allow the VOLTAGE (V)
(whoever invented this HID standard should be more grateful with
units to choose from)

So the manufacturer's only choice was an undimensioned
unit (it is supposed to be linear and SI stanadard compliant meaning
nothing else but VOLT).

But it isn't. we could properly scale it to volts anyway using some
config files but now we need to mach vendor/product id and go thru
the hassle of per-vendor-device conversion coefficients



On 4/2/08, davor emard <davoremard at gmail.com> wrote:
> HI
>
> I will have access to many cyberpower 800E units
> just when they deliver them. Also I may need access
> to a voltmeter that can log to a file so we can let
> battery discharge and compare upsc with the voltmeter
> readings.
> from there we can curve fit to get scale/offset or even
> do the nonlinear calibration if the values are really odd.
> Currently I can only tell that reading of 21.3 corresponds
> to 13.7V at battery terminals
>
> No problem I'll try -DDDDD if I can find out something
> indicative
>
> Best regards, Davor
>
>
>
> On 4/2/08, Arjen de Korte <nut+users at de-korte.org> wrote:
> > > I think the firmware is broken as it didn't apply correction
> > > factor/offset to get volts in the HID diescriptors.
> >
> > In that case, there is little we can do, unless we have a way to find the
> > correct coefficients and also are sure that these are applicable for *all*
> > devices that use the same VendorID and ProductID. Unless you're working
> > for CyberPower or have access to many units, I doubt we can find out
> > either of those.
> >
> > > I haven't scanned the protocol - but *I think* in the HID
> > > report descriptors contains fields for measured value of
> > > the battery voltage and the physical unit (V, mV) that
> > > describes the value. Unit can be a physical unit but also
> > > some undimensioned value (that may need correction
> > > factor and offset)
> >
> > We use all the above in the logical to physical conversion. Since the
> > reported value has a decimal, I'm certain that the HID descriptor contains
> > the fields needed to do this, but apparently they are wrong.
> >
> > > I wonder is the cyberpower really outputting volts wrong
> > > or does it report an undimensioned value which in the
> > > upsc gets interpreted as volts although it is not true volt
> > > measure report
> >
> > The 'upsc' client doesn't interpret anything, it reports the values from
> > the 'upsd' server ad verbatim. It is the 'usbhid-ups' driver that is doing
> > the grunt work of converting from logical to physical values. You can look
> > quite detailed what is going on by running the 'usbhid-ups' driver with
> > the additional debugging flags '-DDDDD'. It will report all the
> > information it reads from the UPS on the console then (until you stop it).
> > Note that at this debuglevel it will be very verbose, so you may wish to
> > capture this to a logfile before examining it.
> >
> > Best regards, Arjen
> >
> >
>



More information about the Nut-upsuser mailing list