[Nut-upsuser] OpenUPS2 support in the HID driver?

Charles Lepple clepple at gmail.com
Wed Nov 5 12:36:31 UTC 2014


On Nov 4, 2014, at 4:36 PM, Toomas Suurmets (Priv) <toomas at suurmets.com> wrote:

> Hi Charles,
> 
> I tried your suggestion with OpenUPS2 (on Raspberry PI, Debian Jessie), it works.

Thanks for the update. We can add the ID to the driver, but I noticed a few inconsistencies (indicated below).

> OpenUPS2 Configuartion variables modification would be very welcome....

I'm assuming these are exposed via USB HID? If so, we need a debug log. Start the driver like so:

/path/to/usbhid-ups -a openups -x productid=d005 -u root -DDD 2>&1 |tee openups-d005.log

Please gzip the log before attaching it, and send to either this list, or nut-upsdev@

> # upsc openups
> Init SSL without certificate database
> battery.capacity: 100
> battery.charge: 98
> battery.charge.low: 5
> battery.charge.warning: 20
> battery.current: 655.290

The current seems to be a units conversion issue, as most of the NUT drivers return amps.

> battery.mfr.date: ?
> battery.runtime: 52860
> battery.temperature: 25.43
> battery.type: ?
> battery.voltage: 10.01
> device.mfr: Mini-Box.Com
> device.model: OPEN-UPS2
> device.serial: LI-ION
> device.type: ups
> driver.name: usbhid-ups
> driver.parameter.pollfreq: 30
> driver.parameter.pollinterval: 2
> driver.parameter.port: auto
> driver.parameter.productid: d005
> driver.version: 2.7.2
> driver.version.data: openUPS HID 0.1
> driver.version.internal: 0.38
> input.current: 0.000
> input.voltage: 606.62
> output.current: 1.192
> output.voltage: 308.16

Input and output voltage do not seem consistent with the battery voltage. What do the real values look like?

> ups.mfr: Mini-Box.Com
> ups.model: OPEN-UPS2
> ups.productid: d005
> ups.serial: LI-ION
> ups.status: OB DISCHRG
> ups.vendorid: 04d8
> 
> # cat /etc/nut/ups.conf
> [openups]
>    driver = usbhid-ups
>    port = auto
>    productid = d005
>    desc = "OpenUPS2"
> 
> On Sep 8, 2014, at 7:08 PM, Charles Lepple <clep... at gmail.com> wrote:
> 
>> On Sep 8, 2014, at 5:46 PM, John Thurston <john.thurs... at alaska.gov> wrote:
>> 
>>> I bought a very nice little, self contained, UPS from mini-box:
>>> http://www.mini-box.com/OpenUPS2
>>> thinking it would be handled by NUT.
>>> I think I misread or misinterpreted the HCL
>>> http://www.networkupstools.org/stable-hcl.html
>> 
>> Correct, we only knew about the original openUPS (USB ID 04d8:d004) at the
>> time that was written.
>> 
>>> The OpenUPS UPS is listed as supported under usbhid-ups, and I had assumed
>>> that OpenUPS2 would be as well. Bzzzzt. I get a unknown device ID for d005
>>> 
>>> Is adding (or hacking) support for this device into the HID driver something
>>> simple which can be done without a recompile?
>> 
>> As a first test, start upsd (let us know if you need more details, but this
>> depends on how your OS/distribution packages things up) and then run the
>> usbhid-ups driver manually, as root, with an extra option:
>> 
>>  path/to/usbhid-ups -u root -x productid=d005 -a name-of-ups
>> 
>> If everything is the same under the hood, you can add "productid=d005" to
>> ups.conf. You will also want to copy the line in
>> /etc/udev/52-nut-usbups.rules that looks like this:
>> 
>> ATTR{idVendor}=="04d8", ATTR{idProduct}=="d004", MODE="664", GROUP="nobody"
>> 
>> and change the "d004" to "d005".
>> 
>> If that works, let us know and we will add it to the driver.
> 
> John,
> 
> Did this work when adding "-x productid=d005"? If so, we can update the driver
> so that it matches automatically.
> 
> The output of "upsc" would also be handy, for future reference.
> 
> -- 
> Charles Lepple
> clepple at gmail
> 
> 
> 

-- 
Charles Lepple
clepple at gmail






More information about the Nut-upsuser mailing list