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

Toomas Suurmets (Priv) toomas at suurmets.com
Thu Nov 6 18:44:06 UTC 2014


Hi,

Debug output of driver is attached, started with OpenUPS2 input feed 
online @ 12V and going offline at 15th second of debug run.

Second attached file is debug output of unsuccessful UPS shutdown 
captured with command:

/lib/nut/usbhid-ups -a openups -x productid=d005 -u root -DDD *-k* 2>&1 
|tee openups-d005-shut.log


I believe input voltage on my earlier upsc run was around 16V, just in 
case, i'll dump another copy here @ approx 12,2V input

# upsc openups
Init SSL without certificate database
battery.capacity: 100
battery.charge: 100
battery.charge.low: 5
battery.charge.warning: 20
battery.current: 0.000
battery.mfr.date: ?
battery.runtime: 3932100
battery.temperature: 24.59
battery.type: ?
battery.voltage: 10.10
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: 432.74
output.current: 0.000
output.voltage: 315.08
ups.mfr: Mini-Box.Com
ups.model: OPEN-UPS2
ups.productid: d005
ups.serial: LI-ION
ups.status: OL
ups.vendorid: 04d8

> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20141106/d271134d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openups-d005.log.gz
Type: application/gzip
Size: 8488 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20141106/d271134d/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openups-d005-shut.log.gz
Type: application/gzip
Size: 3578 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20141106/d271134d/attachment-0003.bin>


More information about the Nut-upsuser mailing list