[Nut-upsuser] Status OB (on battery) when polling a Liebert PSA

Arjen de Korte nut+users at de-korte.org
Mon Feb 7 11:37:55 UTC 2011


Citeren Pier Paolo Glave <pierpaolo.glave op gmail.com>:

> Please find attached the log of "/lib/nut/usbhid-ups -DDDDD -a liebert",
> produced with the 2.6 driver.

 From this it is quite clear what is happening. The UPS *is* reporting  
the values needed, but the people that wrote the firmware of this  
device apparently got some things horribly wrong in the report  
descriptor. For many variables, the exponents are incorrect. It is  
nonsense to report the status bits (like  
UPS.PowerSummary.PresentStatus.*) with the unit "V" (00f0d121). This  
means that instead of integer values (0 or 1), these values are  
reported as floating point (0 or 1e-07) due to the exponent that is  
embedded in the unit. Subsequent parsing of the values fails.

It looks like the firmware developers missed the fact that for some  
units, an exponent is used (V, VA and W) which causes a 7 decades  
offset. You either have to account for that in the units exponent or  
use a type that doesn't have this offset. I'm fairly certain that by  
commenting out the following lines in drivers/libhid.c

604 	        for (i = 0; i < NB_HID_UNITS; i++) {
605
606 	                if (HIDUnits[i].Type == hiddata->Unit) {
607 	                        unit_expo -= HIDUnits[i].Expo;
608 	                        break;
609 	                }
610 	        }

you'll get better results. Please let us know if it does, so that we  
can include this fix in the belkin-hid subdriver.

Best regards, Arjen
-- 
Please keep list traffic on the list (off-list replies will be rejected)




More information about the Nut-upsuser mailing list