Toomas Suurmets (Priv)
2014-Nov-06 18:44 UTC
[Nut-upsuser] OpenUPS2 support in the HID driver?
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>
On Nov 6, 2014, at 1:44 PM, Toomas Suurmets (Priv) <toomas at suurmets.com> wrote:> Hi, > > Debug output of driver is attached, started with OpenUPS2 input feed online @ 12V and going offline at 15th second of debug run.Thanks, the voltages seem to only be off by a factor of 10: Path: UPS.PowerSummary.Output.Voltage, Type: Feature, ReportID: 0x21, Offset: 0, Size: 16, Value: 122.69 Path: UPS.PowerSummary.Output.Current, Type: Feature, ReportID: 0x21, Offset: 16, Size: 16, Value: 0 Path: UPS.PowerSummary.Input.Voltage, Type: Feature, ReportID: 0x22, Offset: 0, Size: 16, Value: 122.17 Not sure about the current scaling - I assumed it was also 10x too high. I pushed a new version (0.4; ignore 0.3) which should fix the voltage scaling. The runtime estimate seems high, but you might need to plot that over time to see what the scale factor should be for that. NUT usually reports it in seconds.> 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.logNot sure what to tell you - there is no shutdown command listed in the HID descriptor. I CC'd the author of the driver - maybe the manufacturer can provide more information? Same thing with the configuration variables. There are a few non-standard HID usage IDs at the end of the log, but it is not clear how to make use of them. -- Charles Lepple clepple at gmail -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20141106/e8f6a51c/attachment-0001.html>
Toomas Suurmets (Priv)
2014-Nov-07 07:33 UTC
[Nut-upsuser] OpenUPS2 support in the HID driver?
Hi Charles, Thanks for these efforts! On 7.11.2014 6:24, Charles Lepple wrote:> On Nov 6, 2014, at 1:44 PM, Toomas Suurmets (Priv) > <toomas at suurmets.com <mailto:toomas at suurmets.com>> wrote: > >> Hi, >> >> Debug output of driver is attached, started with OpenUPS2 input feed >> online @ 12V and going offline at 15th second of debug run. > > Thanks, the voltages seem to only be off by a factor of 10: > > Path: UPS.PowerSummary.Output.Voltage, Type: Feature, ReportID: 0x21, > Offset: 0, Size: 16, Value: 122.69 > Path: UPS.PowerSummary.Output.Current, Type: Feature, ReportID: 0x21, > Offset: 16, Size: 16, Value: 0 > Path: UPS.PowerSummary.Input.Voltage, Type: Feature, ReportID: 0x22, > Offset: 0, Size: 16, Value: 122.17 > > Not sure about the current scaling - I assumed it was also 10x too high. > > I pushed a new version (0.4; ignore 0.3) which should fix the voltage > scaling. > > The runtime estimate seems high, but you might need to plot that over > time to see what the scale factor should be for that. NUT usually > reports it in seconds. > >> 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 > > Not sure what to tell you - there is no shutdown command listed in the > HID descriptor. I CC'd the author of the driver - maybe the > manufacturer can provide more information? > > Same thing with the configuration variables. There are a few > non-standard HID usage IDs at the end of the log, but it is not clear > how to make use of them. > > -- > Charles Lepple > clepple at gmail > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20141107/a3027471/attachment.html>