[Nut-upsdev] Question about voltage threshold setting in NUT

Charles Lepple clepple at gmail.com
Fri Jun 6 23:10:12 UTC 2014


On Jun 6, 2014, at 10:35 AM, Shen Chuan wrote:

> Out model is Eaton 3S 500. And in windows it has a Eaton Personal Solution Pac. In Battery transfer threshold it has three voltage sensitivity ranges: 96-138, 84-142, 75-144. 96 and 84 are working in NUT, not sure why 75 is not working.

Interesting, I'm not sure why either. It is possible to monitor the USB connection to see what the Windows software is sending, but it might not be worth the effort. Check the list archives for usbpcap or terms related to USB capture.

> Do you think that range is restricted in the firmware? We have a tripplitte model and upsc doesn't have input.transfer.low at all.

There are seven vendor-specific HID backends for usbhid-ups (plus a dummy "explore" option), and each deals with the quirks of how each UPS vendor transmits their information back to the host PC. The driver tries to map these readings back to standard NUT variable names, but it is often the case that one vendor does not publish the same measurements and adjustments as another.

As an example, check out drivers/tripplite-hid.c:

   https://github.com/networkupstools/nut/blob/master/drivers/tripplite-hid.c#L369

That line contains a definition for "input.transfer.low". The driver looks for the 4th element in that struct ("UPS.PowerConverter.Output.LowVoltageTransfer") in the USB HID descriptor, and if it does not exist, the driver does not publish the "input.transfer.low" variable. If it does exist, the combination of "ST_FLAG_RW | ST_FLAG_STRING" and the sscanf() format string "%.1f" allow the driver to parse a floating point number string from upsrw, and send that to the UPS. It is up to the UPS firmware to decide how to handle that number.

-- 
Charles Lepple
clepple at gmail






More information about the Nut-upsdev mailing list