networkupstools / nut

The Network UPS Tools repository. UPS management protocol Informational RFC 9271 published by IETF at https://www.rfc-editor.org/info/rfc9271 Please star NUT on GitHub, this helps with sponsorships!
https://networkupstools.org/
Other
1.92k stars 345 forks source link

Output voltage is now wrong - off by about 220V #1973

Open jonandel opened 1 year ago

jonandel commented 1 year ago

Something is underreportng the output voltage of my UPS - Im sure it used to be correct, when I set it up about 18 months ago... See below - input voltage is 230V, output 10.

I'm using NUT Tools in Homeassistant Hassos.

NUT Tools config:

  • config: [] driver: usbhid-ups name: myups port: auto

I posted details in the HA Core - suggestion there that it may be a NUT tools/driver issue...hence posting here for ideas... https://github.com/home-assistant/core/issues/95157

jonandel commented 1 year ago

I notice this in the addon log though - is it significant ?

[10:34:42] INFO: Configuring Device named myups...
[10:34:42] INFO: Starting the UPS drivers...
**Network UPS Tools - Generic HID driver 0.47 (2.8.0)
HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 65535 in ReportID: 0x0f
HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 255 in ReportID: 0x12
HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 255 in ReportID: 0x13**
Using subdriver: CyberPower HID 0.6
USB communication driver (libusb 1.0) 0.43
Network UPS Tools - UPS driver controller 2.8.0
cont-init: info: /etc/cont-init.d/nut.sh exited 0
cont-init: info: running /etc/cont-init.d/nutclient.sh
cont-init: info: /etc/cont-init.d/nutclient.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun upsd (no readiness notification)
services-up: info: copying legacy longrun upsmon (no readiness notification)
[10:34:42] INFO: Starting the UPS information server...
jimklimov commented 1 year ago

Hello, thanks for the post. It may be significant - one of the changes in NUT v2.8.0 release was about detecting malformed protocol information and amending that (stemming from issue #1024 and later issues and PRs on this matter; another related thread is #439). Looking at related key words, I think #1969 is quite similar to yours (although there the bogus value is larger and does not change over time).

It is possible that some of that did misfire and better amendments could have been made, so in the NUT master branch there were some fixes later, e.g. #1338 or #1497

jonandel commented 1 year ago

thanks - yes I saw several that were similar - interestingly #1512 reports the same problem but with a slightly different product - - mine is a 650 with no LCD, rather than a 500 with LCD. However, I see NUT is reporting same vendor and product ID's....

Dunuin commented 1 year ago

Same problem here with my PowerWalker STL 800. Worked perfectly fine with latest NUT shipped with Debian 11, then I upgraded Debian to 12 and the output voltage directly dropped from ~235V to ~5V and is now fluctuating between 2V and 10V for 3 weeks.

jimklimov commented 1 year ago

Cheers, thanks for the reports. Are any of you in position to try custom-building NUT to query the device with current codebase (to check if this was solved after 2.8.0 release)? This can be done from a build workspace without compromising the packaged installation, see https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests

jonandel commented 1 year ago

Im running HASOS, so will need to pull out a rPi and setup a test rig....give me a week or so - and Ill give it a go.

jonandel commented 1 year ago

Jim, Ive fired up a rPi and the master branch built (2.8.0.1)... which build do you suggest I try ?

jimklimov commented 1 year ago

I think master should do it for tests. And then fiddle with driver options: what it does by default now, if it reports better again or still wrong as in 2.8.0 vs. 2.7.4; I think there was a toggle to disable the fix for presumed bad usb logical min/max encoding... can't remember quickly now - but should be in man pages (to see if that is the culprit).

jonandel commented 1 year ago

Erm OK. Remember though, I'm seeing the error in 2.8.0 pulled through in the Home Assistant add in an of about a month ago...but I don't know which version was used previously (which I don't think had the issue).... Let me play around for a few days..and ill come back....

jimklimov commented 1 year ago

Thanks! Note that Home Assistant builds generally include a version of NUT from packaging, e.g. Debian's 2.7.4 or 2.8.0 release plus their tweaks and backports over time. So even a 2.8.0 is a bit over a year old, and some fixes have landed since, and maybe something among these impacts the handling of your device.

Thinking of it, you might want to build a custom HA plugin with current NUT. Never did that myself, but there is a contributed post on the Wiki about it.

jonandel commented 1 year ago

Hey Jim, Im not quite sure what Im doing frankly - but I think I have the mast branch installed and running. (although tools such as nut-scanner complain about a missing libusb... anywhooo... when I probe with usb-hid-ups driver it seems to be communicating with the USB, and I get the below output.

Is this any use? What should I do next ?

pi@raspberrypi:~/nut $ sudo drivers/usbhid-ups -DD -u root -x explore -x vendorid=0764 -x port=auto -s ups
Network UPS Tools - Generic HID driver 0.50 (2.8.0-2306-g3d9630e0f)
USB communication driver (libusb 0.1) 0.44
   0.000005     [D1] Built-in default or configured user for drivers 'nobody' was ignored due to 'root' specified on command line
   0.000155     [D1] Network UPS Tools version 2.8.0-2306-g3d9630e0f (release/snapshot of 2.8.0.1) built with gcc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110 and configured with flags: --with-dev
   0.000208     [D1] debug level is '2'
   0.002482     [D1] Succeeded to become_user(root): now UID=0 GID=0
   0.002653     [D2] Initializing an USB-connected UPS with library libusb-0.1 (or compat) (NUT subdriver name='USB communication driver (libusb 0.1)' ver='0.44')
   0.002711     [D1] upsdrv_initups (non-SHUT)...
   0.075475     [D2] Checking device (1D6B/0003) (002/001)
   0.119071     [D2] - VendorID: 1d6b
   0.119141     [D2] - ProductID: 0003
   0.119200     [D2] - Manufacturer: Linux 6.1.21-v8+ xhci-hcd
   0.119257     [D2] - Product: xHCI Host Controller
   0.119314     [D2] - Serial Number: 0000:01:00.0
   0.119370     [D2] - Bus: 002
   0.119426     [D2] - Device: 001
   0.119483     [D2] - Device release number: 0601
   0.119540     [D2] Trying to match device
   0.119598     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.119681     [D2] match_function_regex: failed match of VendorID: 1d6b
   0.119740     [D2] Device does not match - skipping
   0.120196     [D2] Checking device (0764/0601) (001/003)
   0.125553     [D2] - VendorID: 0764
   0.125620     [D2] - ProductID: 0601
   0.125675     [D2] - Manufacturer: 1
   0.125731     [D2] - Product:  650
   0.125788     [D2] - Serial Number:
   0.125844     [D2] - Bus: 001
   0.125900     [D2] - Device: 003
   0.125957     [D2] - Device release number: 0200
   0.126013     [D2] Trying to match device
   0.126070     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.126172     [D2] Device matches
   0.126262     [D2] failed to claim USB device: could not claim interface 0: Device or resource busy
   0.127452     [D2] detached kernel driver from USB device...
   0.128336     [D2] Retrieved HID descriptor (expected 9, got 9)
   0.128454     [D2] HID descriptor length 739
   0.133944     [D2] Report Descriptor size = 739
   0.134557     HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 65535 in ReportID: 0x0f
   0.135343     HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 255 in ReportID: 0x12
   0.135413     HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 255 in ReportID: 0x13
   0.135822     Using subdriver: EXPLORE HID 0.2
   0.136607     [D1] 73 HID objects found
   0.139079     [D1] Path: UPS.PowerSummary.iProduct, Type: Feature, ReportID: 0x01, Offset: 0, Size: 8, Value: 1
   0.141339     [D1] Path: UPS.PowerSummary.iSerialNumber, Type: Feature, ReportID: 0x02, Offset: 0, Size: 8, Value: 2
   0.144096     [D1] Path: UPS.PowerSummary.iOEMInformation, Type: Feature, ReportID: 0x03, Offset: 0, Size: 8, Value: 3
   0.146844     [D1] Path: UPS.PowerSummary.iDeviceChemistry, Type: Feature, ReportID: 0x04, Offset: 0, Size: 8, Value: 4
   0.149587     [D1] Path: UPS.PowerSummary.Rechargeable, Type: Feature, ReportID: 0x05, Offset: 0, Size: 8, Value: 1
   0.152337     [D1] Path: UPS.PowerSummary.CapacityMode, Type: Feature, ReportID: 0x06, Offset: 0, Size: 8, Value: 2
   0.155088     [D1] Path: UPS.PowerSummary.DesignCapacity, Type: Feature, ReportID: 0x07, Offset: 0, Size: 8, Value: 100
   0.155170     [D1] Path: UPS.PowerSummary.CapacityGranularity1, Type: Feature, ReportID: 0x07, Offset: 8, Size: 8, Value: 10
   0.155244     [D1] Path: UPS.PowerSummary.CapacityGranularity2, Type: Feature, ReportID: 0x07, Offset: 16, Size: 8, Value: 10
   0.155319     [D1] Path: UPS.PowerSummary.WarningCapacityLimit, Type: Feature, ReportID: 0x07, Offset: 24, Size: 8, Value: 20
   0.155483     [D1] Path: UPS.PowerSummary.FullChargeCapacity, Type: Feature, ReportID: 0x07, Offset: 32, Size: 8, Value: 100
   0.155685     [D1] Path: UPS.PowerSummary.RemainingCapacityLimit, Type: Feature, ReportID: 0x07, Offset: 40, Size: 8, Value: 10
   0.158093     [D1] Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID: 0x08, Offset: 0, Size: 8, Value: 100
   0.158177     [D1] Path: UPS.PowerSummary.RemainingCapacity, Type: Feature, ReportID: 0x08, Offset: 0, Size: 8, Value: 100
   0.158254     [D1] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x08, Offset: 8, Size: 16, Value: 2520
   0.158368     [D1] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, ReportID: 0x08, Offset: 8, Size: 16, Value: 2520
   0.158569     [D1] Path: UPS.PowerSummary.RemainingTimeLimit, Type: Input, ReportID: 0x08, Offset: 24, Size: 16, Value: 300
   0.158828     [D1] Path: UPS.PowerSummary.RemainingTimeLimit, Type: Feature, ReportID: 0x08, Offset: 24, Size: 16, Value: 300
   0.160580     [D1] Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x09, Offset: 0, Size: 16, Value: 12
   0.161329     [D1] Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x0a, Offset: 0, Size: 16, Value: 13.7
   0.162076     [D1] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1
   0.162154     [D1] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Input, ReportID: 0x0b, Offset: 1, Size: 1, Value: 1
   0.162226     [D1] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Input, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0
   0.162331     [D1] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Input, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0
   0.162527     [D1] Path: UPS.PowerSummary.PresentStatus.FullyCharged, Type: Input, ReportID: 0x0b, Offset: 4, Size: 1, Value: 1
   0.162728     [D1] Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Input, ReportID: 0x0b, Offset: 5, Size: 1, Value: 0
   0.162916     [D1] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1
   0.163067     [D1] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x0b, Offset: 1, Size: 1, Value: 1
   0.163253     [D1] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0
   0.163376     [D1] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0
   0.163666     [D1] Path: UPS.PowerSummary.PresentStatus.FullyCharged, Type: Feature, ReportID: 0x0b, Offset: 4, Size: 1, Value: 1
   0.163933     [D1] Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Feature, ReportID: 0x0b, Offset: 5, Size: 1, Value: 0
   0.164828     [D1] Path: UPS.PowerSummary.AudibleAlarmControl, Type: Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 2
   0.165711     [D1] Path: UPS.PowerSummary.iManufacturer, Type: Feature, ReportID: 0x0d, Offset: 0, Size: 8, Value: 3
   0.168346     [D1] Path: UPS.Input.ConfigVoltage, Type: Feature, ReportID: 0x0e, Offset: 0, Size: 16, Value: 230
   0.171086     [D1] Path: UPS.Input.Voltage, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 16, Value: 245.5
   0.173838     [D1] Path: UPS.Input.LowVoltageTransfer, Type: Feature, ReportID: 0x10, Offset: 0, Size: 16, Value: 165
   0.176592     [D1] Path: UPS.Input.HighVoltageTransfer, Type: Feature, ReportID: 0x11, Offset: 0, Size: 16, Value: 290
   0.179338     [D1] Path: UPS.Input.Frequency, Type: Feature, ReportID: 0x1c, Offset: 0, Size: 16, Value: 50.2
   0.182088     [D1] Path: UPS.Output.Voltage, Type: Feature, ReportID: 0x12, Offset: 0, Size: 16, Value: 15.1
   0.184874     [D1] Path: UPS.Output.PercentLoad, Type: Feature, ReportID: 0x13, Offset: 0, Size: 8, Value: 12
   0.187574     [D1] Path: UPS.Output.Test, Type: Feature, ReportID: 0x14, Offset: 0, Size: 8, Value: 0
   0.190324     [D1] Path: UPS.Output.DelayBeforeShutdown, Type: Feature, ReportID: 0x15, Offset: 0, Size: 16, Value: -60
   0.193069     [D1] Path: UPS.Output.DelayBeforeStartup, Type: Feature, ReportID: 0x16, Offset: 0, Size: 16, Value: -60
   0.195818     [D1] Path: UPS.Output.Boost, Type: Feature, ReportID: 0x17, Offset: 0, Size: 1, Value: 0
   0.195941     [D1] Path: UPS.Output.Overload, Type: Feature, ReportID: 0x17, Offset: 1, Size: 1, Value: 0
   0.196051     [D1] Path: UPS.Output.Buck, Type: Feature, ReportID: 0x17, Offset: 2, Size: 1, Value: 0
   0.198569     [D1] Path: UPS.Output.ConfigActivePower, Type: Feature, ReportID: 0x18, Offset: 0, Size: 16, Value: 360
   0.201316     [D1] Path: UPS.Output.Frequency, Type: Feature, ReportID: 0x1d, Offset: 0, Size: 16, Value: 50.2
   0.204067     [D1] Path: UPS.Output.CommunicationLost, Type: Feature, ReportID: 0x1b, Offset: 0, Size: 8, Value: 0
   0.206827     [D1] Path: UPS.ff010004.ff010024.ff0100d0, Type: Feature, ReportID: 0x19, Offset: 0, Size: 8, Value: 0.1
   0.209575     [D1] Path: UPS.ff010004.ff010024.ff0100d1, Type: Feature, ReportID: 0x1a, Offset: 0, Size: 8, Value: 0
   0.212325     [D1] Path: UPS.ff01001d.ff010019.ff010020, Type: Feature, ReportID: 0x25, Offset: 0, Size: 1, Value: 0
   0.215074     [D1] Path: UPS.ff01001d.ff010019.ff010021, Type: Feature, ReportID: 0x2c, Offset: 0, Size: 1, Value: 0
   0.215198     [D1] Path: UPS.ff01001d.ff010019.ff010021, Type: Input, ReportID: 0x2c, Offset: 0, Size: 1, Value: 0
   0.217820     [D1] Path: UPS.ff01001d.ff01001a.ff010001, Type: Feature, ReportID: 0x26, Offset: 0, Size: 1, Value: 0
   0.220567     [D1] Path: UPS.ff01001d.ff01001a.ff010002, Type: Feature, ReportID: 0x27, Offset: 0, Size: 8, Value: 1
   0.223335     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.223468     [D1] Can't retrieve Report 28: Value too large for defined data type
   0.223580     [D1] Path: UPS.ff01001d.ff01001b.ff010040, Type: Feature, ReportID: 0x28, Offset: 0, Size: 8
   0.224423     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.224543     [D1] Can't retrieve Report 28: Value too large for defined data type
   0.224674     [D1] Path: UPS.ff01001d.ff01001b.ff010016, Type: Input, ReportID: 0x28, Offset: 0, Size: 8
   0.225549     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.225664     [D1] Can't retrieve Report 28: Value too large for defined data type
   0.225777     [D1] Path: UPS.ff01001d.ff01001b.ff010018, Type: Feature, ReportID: 0x28, Offset: 8, Size: 8
   0.226875     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.227018     [D1] Can't retrieve Report 28: Value too large for defined data type
   0.227132     [D1] Path: UPS.ff01001d.ff01001b.ff010018, Type: Input, ReportID: 0x28, Offset: 8, Size: 8
   0.229587     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.229730     [D1] Can't retrieve Report 29: Value too large for defined data type
   0.229843     [D1] Path: UPS.ff01001d.ff01001b.ff010015, Type: Feature, ReportID: 0x29, Offset: 0, Size: 8
   0.230827     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.230960     [D1] Can't retrieve Report 29: Value too large for defined data type
   0.231071     [D1] Path: UPS.ff01001d.ff01001b.ff010015, Type: Output, ReportID: 0x29, Offset: 0, Size: 8
   0.231936     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.232058     [D1] Can't retrieve Report 29: Value too large for defined data type
   0.232173     [D1] Path: UPS.ff01001d.ff01001b.ff010017, Type: Feature, ReportID: 0x29, Offset: 8, Size: 8
   0.233034     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.233154     [D1] Can't retrieve Report 29: Value too large for defined data type
   0.233264     [D1] Path: UPS.ff01001d.ff01001b.ff010017, Type: Output, ReportID: 0x29, Offset: 8, Size: 8
   0.239493     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.239632     [D1] Can't retrieve Report 2d: Value too large for defined data type
   0.239748     [D1] Path: UPS.ff01001d.ff01001b.ff010010, Type: Feature, ReportID: 0x2d, Offset: 0, Size: 1
   0.240556     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.240680     [D1] Can't retrieve Report 2d: Value too large for defined data type
   0.240793     [D1] Path: UPS.ff01001d.ff01001b.ff01001e, Type: Feature, ReportID: 0x2d, Offset: 1, Size: 1
   0.241671     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.241790     [D1] Can't retrieve Report 2d: Value too large for defined data type
   0.241899     [D1] Path: UPS.ff01001d.ff01001b.ff01001f, Type: Feature, ReportID: 0x2d, Offset: 2, Size: 1
   0.242830     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.242960     [D1] Can't retrieve Report 2d: Value too large for defined data type
   0.243073     [D1] Path: UPS.ff01001d.ff01001b.ff010010, Type: Input, ReportID: 0x2d, Offset: 0, Size: 1
   0.243928     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.244048     [D1] Can't retrieve Report 2d: Value too large for defined data type
   0.244158     [D1] Path: UPS.ff01001d.ff01001b.ff01001e, Type: Input, ReportID: 0x2d, Offset: 1, Size: 1
   0.244927     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.245044     [D1] Can't retrieve Report 2d: Value too large for defined data type
   0.245154     [D1] Path: UPS.ff01001d.ff01001b.ff01001f, Type: Input, ReportID: 0x2d, Offset: 2, Size: 1
   0.246085     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.246204     [D1] Can't retrieve Report 2a: Value too large for defined data type
   0.246492     [D1] Path: UPS.ff01001d.ff01001b.ff010013, Type: Feature, ReportID: 0x2a, Offset: 0, Size: 1
   0.247320     [D2] libusb_get_report: error sending control message: Value too large for defined data type
   0.247444     [D1] Can't retrieve Report 2b: Value too large for defined data type
   0.247554     [D1] Path: UPS.ff01001d.ff01001b.ff010014, Type: Feature, ReportID: 0x2b, Offset: 0, Size: 1
   0.247713     [D2] Report descriptor retrieved (Reportlen = 739)
   0.247815     [D2] Found HID device
   0.247918     [D1] Detected a UPS: 1 / 650
   0.248030     [D2] find_nut_info: unknown info type: load.off.delay
   0.248131     [D2] find_nut_info: unknown info type: load.on.delay
   0.248231     [D2] find_nut_info: unknown info type: load.off.delay
   0.248374     [D1] upsdrv_initinfo...
   0.248539     [D1] upsdrv_updateinfo...
   0.250090     [D1] Got 3 HID objects...
   0.250227     [D2] Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID: 0x08, Offset: 0, Size: 8, Value: 100
   0.250513     [D2] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x08, Offset: 8, Size: 16, Value: 2340
   0.250632     [D2] Path: UPS.PowerSummary.RemainingTimeLimit, Type: Input, ReportID: 0x08, Offset: 24, Size: 16, Value: 300
   0.250739     [D1] Quick update...
   0.254045     [D2] dstate_init: sock /var/state/ups/usbhid-ups-ups open on fd 5
   0.254353     [D1] Group and/or user account for this driver was customized ('root:nogroup') compared to built-in defaults. Fixing socket '/var/state/ups/usbhid-ups-ups' ownership/access.
   0.254552     [D1] Group access for this driver successfully fixed
   0.254706     Running as foreground process, not saving a PID file
   0.254834     [D1] Driver initialization completed, beginning regular infinite loop
   0.254954     [D1] upsdrv_updateinfo...
   1.005626     [D2] libusb_get_interrupt: Connection timed out
   1.005687     [D1] Got 0 HID objects...
   1.005718     [D1] Quick update...
   2.256235     [D1] upsdrv_updateinfo...
   2.273343     [D1] Got 6 HID objects...
   2.273391     [D2] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1
   2.273432     [D2] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Input, ReportID: 0x0b, Offset: 1, Size: 1, Value: 1
   2.273469     [D2] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Input, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0
   2.273505     [D2] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Input, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0
   2.273542     [D2] Path: UPS.PowerSummary.PresentStatus.FullyCharged, Type: Input, ReportID: 0x0b, Offset: 4, Size: 1, Value: 1
   2.273579     [D2] Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Input, ReportID: 0x0b, Offset: 5, Size: 1, Value: 0
   2.273609     [D1] Quick update...
   4.258242     [D1] upsdrv_updateinfo...
   4.259609     [D1] Got 3 HID objects...
   4.259658     [D2] Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID: 0x08, Offset: 0, Size: 8, Value: 100
   4.259700     [D2] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x08, Offset: 8, Size: 16, Value: 2580
   4.259735     [D2] Path: UPS.PowerSummary.RemainingTimeLimit, Type: Input, ReportID: 0x08, Offset: 24, Size: 16, Value: 300
   4.259767     [D1] Quick update...
   6.260321     [D1] upsdrv_updateinfo...
   6.261994     [D1] Got 6 HID objects...
   6.262105     [D2] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1
   6.262201     [D2] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Input, ReportID: 0x0b, Offset: 1, Size: 1, Value: 1
   6.262353     [D2] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Input, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0
   6.262450     [D2] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Input, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0
   6.262542     [D2] Path: UPS.PowerSummary.PresentStatus.FullyCharged, Type: Input, ReportID: 0x0b, Offset: 4, Size: 1, Value: 1
   6.262633     [D2] Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Input, ReportID: 0x0b, Offset: 5, Size: 1, Value: 0
   6.262712     [D1] Quick update...
   8.262347     [D1] upsdrv_updateinfo...
   8.279230     [D1] Got 3 HID objects...
   8.279333     [D2] Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID: 0x08, Offset: 0, Size: 8, Value: 100
   8.279431     [D2] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x08, Offset: 8, Size: 16, Value: 2400
   8.279525     [D2] Path: UPS.PowerSummary.RemainingTimeLimit, Type: Input, ReportID: 0x08, Offset: 24, Size: 16, Value: 300
   8.279601     [D1] Quick update...
  10.264396     [D1] upsdrv_updateinfo...
  10.281533     [D1] Got 6 HID objects...
  10.281642     [D2] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1
  10.281737     [D2] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Input, ReportID: 0x0b, Offset: 1, Size: 1, Value: 1
  10.281832     [D2] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Input, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0
  10.281921     [D2] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Input, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0
  10.282009     [D2] Path: UPS.PowerSummary.PresentStatus.FullyCharged, Type: Input, ReportID: 0x0b, Offset: 4, Size: 1, Value: 1
  10.282097     [D2] Path: UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Input, ReportID: 0x0b, Offset: 5, Size: 1, Value: 0
  10.282173     [D1] Quick update...
  12.266427     [D1] upsdrv_updateinfo...
  12.283767     [D1] Got 3 HID objects...
  12.283872     [D2] Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID: 0x08, Offset: 0, Size: 8, Value: 100
  12.283965     [D2] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x08, Offset: 8, Size: 16, Value: 2220
  12.284053     [D2] Path: UPS.PowerSummary.RemainingTimeLimit, Type: Input, ReportID: 0x08, Offset: 24, Size: 16, Value: 300
  12.284128     [D1] Quick update...
jonandel commented 1 year ago

PS, any ideas why this doesnt work ? Whats the subdriver ?

(I used the quoted subdriver thats 'discovered' too - no luck 'EXPLORE HID 0.2'

xx@raspberrypi:~/nut $ sudo ./drivers/nutdrv_qx -s tempups -d1 -DDDDDD -x port=auto -x vendorid=0764 -x productid=0601 -x subdriver="CyberPower HID 0.6"
Network UPS Tools - Generic Q* USB/Serial driver 0.33 (2.8.0-2306-g3d9630e0f)
USB communication driver (libusb 0.1) 0.44
   0.000004     [D3] main_arg: var='port' val='auto'
   0.000341     [D6] testinfo_reloadable: var=port, infoname=driver.parameter.port, newval=auto, reloadable=0, reload_flag=0
   0.000397     [D6] testinfo_reloadable: verdict for (re)loading var=port value: 1
   0.000463     [D5] send_to_all: SETINFO driver.parameter.port "auto"
   0.000937     [D3] main_arg: var='vendorid' val='0764'
   0.001016     [D5] send_to_all: SETINFO driver.parameter.vendorid "0764"
   0.001072     [D3] main_arg: var='productid' val='0601'
   0.001495     [D5] send_to_all: SETINFO driver.parameter.productid "0601"
   0.001553     [D3] main_arg: var='subdriver' val='CyberPower HID 0.6'
   0.001619     [D5] send_to_all: SETINFO driver.parameter.subdriver "CyberPower HID 0.6"
   0.002058     [D1] Network UPS Tools version 2.8.0-2306-g3d9630e0f (release/snapshot of 2.8.0.1) built with gcc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110 and configured with flags: --enable-check-NIT
   0.002124     [D1] debug level is '6'
   0.002186     [D5] send_to_all: SETINFO driver.debug "6"
   0.002243     [D5] send_to_all: SETFLAGS driver.debug RW NUMBER
   0.005496     [D1] Succeeded to become_user(nobody): now UID=65534 GID=65534
   0.005588     [D5] send_to_all: SETINFO device.type "ups"
   0.005650     [D5] send_to_all: SETINFO driver.state "init.device"
   0.005703     [D1] upsdrv_initups...
   0.006128     Subdriver 'CyberPower HID 0.6' not found!
   0.006203     [D5] send_to_all: SETINFO driver.state "cleanup.exit"
pi@raspberrypi:~/nut $
jimklimov commented 1 year ago

Try usbhid-ups without the -x explore flag (it discovers and reports known data points to help write new sub-drivers, but does not interpret them).

At least, according to the initial report the device was handled with usbhid-ups which is about a different protocol than what nutdrv_qx uses (that said, its subdriver would be like plain cyberpower - single token, without versions).

jonandel commented 1 year ago

ok done... not sure it particularly helpful... gives the same as nutdrv_qx...:

pi@raspberrypi:~/nut $ sudo ./drivers/usbhid-ups -s 0764 -x port=auto
Network UPS Tools - Generic HID driver 0.50 (2.8.0-2306-g3d9630e0f)
USB communication driver (libusb 0.1) 0.44
HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 65535 in ReportID: 0x0f
HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 255 in ReportID: 0x12
HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 255 in ReportID: 0x13
Using subdriver: CyberPower HID 0.8
...
jonandel commented 1 year ago

either way - it shows the current Master has the same problem as reported: ie

0.171086 [D1] Path: UPS.Input.Voltage, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 16, Value: **245.5**
0.182088 [D1] Path: UPS.Output.Voltage, Type: Feature, ReportID: 0x12, Offset: 0, Size: 16, Value: **15.1**

So probably confirmed its still a problem !

However, the logmax is less than statments appear to apply to the reportID's corresponding to the output voltage (at least word 0x12) - so perhaps IS related to that in the code....

jonandel commented 1 year ago

@jimklimov Any ideas where to start looking ? I see the cyberpower driver was updated about a year ago - but I dont see those HID Report desciptors having changed. I pulled the patest mast yesterday - as I see a few changes to the cyberpower-mib recently. I rebuilt, but still get the same incorrect reporting value for output voltage. Also, in my original post, the sub-driver version is being reported as "driver.version.data": "CyberPower HID 0.6" - but current version here is 0.54 ... Where should I start looking ?