Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #439 Incorrect Output Voltage on CPS*EFPCLCD #1245

Merged
merged 17 commits into from
Jan 19, 2022

Conversation

flashydave
Copy link
Contributor

This fixes the problem whereby the Output Voltage on Cyberpower CPS*EPFCLCD UPS's is masked.
The root cause is due to a legal but inappropriate Report Descriptor published as part of the HID.
Specifically it looks liike Report ID 17 was deleted (ie Report 16 is followed by Report 18) with the result that there was no attempt to reset the LogMin and LogMax values from those used by the HighVoltageTransfer Item for those used by the Output Voltage.

The fix conditionally corrects the Report Descriptor structure by applying the same LogMin and LogMax values used by the Input Voltage Item after first checking the issue exists.

The fix creates a generic framework for fixing Report Descriptors that can be used for different manufacturers by adding code to the appropriate subdriver rather than polluting the main code with UPS specific exceptions.

@lgtm-com

This comment has been minimized.

* To fix it copy the input voltage log min/max settings as reasonable values for the output voltage limits.
*/

if ((pData=FindReport(pDesc, 15, (PAGE_POWER_DEVICE<<16)+USAGE_VOLTAGE))) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I my opinion we should skip report 15 (0xe) and change output voltage:

  • LogMin to 0
  • LogMax leave as it is or even increase it (current value 270)

According to the specification for EU version of the UPS "Input Voltage Range" is "170 ~ 270".
which means that the input voltage up to 270 V can be accepted, before system will switch to a battery.
If UPS will switch to battery I'm not sure if it will report input voltage higher than 270V, I don't have equipment to verify it.

@flashydave
Copy link
Contributor Author

flashydave commented Dec 25, 2021 via email

@jimklimov
Copy link
Member

jimklimov commented Dec 26, 2021 via email

@flashydave
Copy link
Contributor Author

flashydave commented Dec 26, 2021 via email

@flashydave
Copy link
Contributor Author

flashydave commented Dec 28, 2021 via email

@wmigas
Copy link

wmigas commented Dec 28, 2021

@flashydave @jimklimov may we apply changes related to the logical Max value. It should be set

  • for EU to 270 or higher . see "MAX O/P Voltage" from functional setup guide
  • for US to 144 or higher. see "MAX O/P Voltage" from functional setup guide https://dl4jz3rbrsfum.cloudfront.net/documents/CyberPower_FG_CP1500PFCLCD.pdf
    My understanding is that "MAX O/P Voltage" is the same as "UPS.Input.HighVoltageTransfer". If I'm correct, then logical Max should not be changed or should be increased, because the UPS should be able to measure higher voltage to be able to safely switch to battery, when voltage is too high.

Logical Min can be hardcoded to 0, because when there is power failure, then UPS returns 0

@jimklimov
Copy link
Member

Just in case, CCing @nbriggs as our recent expert in USB protocol nuances, and LogMin/LogMax processing in particular.

@flashydave
Copy link
Contributor Author

flashydave commented Dec 28, 2021 via email

@wmigas
Copy link

wmigas commented Dec 28, 2021

Using this logic we need to fix the InputVoltage too.

I agree with you. let's wait on CPS response. in theory voltage should be 230 +/- 15%, which gives max 264V, but in spec they input voltage range is 170-270. maybe it is max which is supported by hardware. who knows

@nbriggs
Copy link
Contributor

nbriggs commented Dec 28, 2021

My involvement has only been with the syntactically incorrect Report Descriptors from an APC unit...

This looks like a reasonable framework for fixing the syntactically correct but logically faulty report descriptors, particularly because these errors are most likely specific to a particular manufacturer.

At the point where you're doing the fix up... I suspect you don't have access to the particular model or firmware revision level, which if so is unfortunate because it means you have to base the fix up only on an analysis of the static values in the report descriptor.

I would be interested in seeing the hex dump of the USB report descriptor from the CyberPower unit if someone would care to attach it.

I'm impressed that CyberPower is responding -- unlike the APC/Schneider Electric front line support who are still, after having seen the full decoding of the bad report description and multiple explanations, say "I see that you are having issue on the HID drivers when UPS is connected to the PC, correct?"

@wmigas
Copy link

wmigas commented Dec 28, 2021

@nbriggs
we have access to the USBDevice_t, so we have following information:

  • VendorID: 0764
  • ProductID: 0501
  • Manufacturer: CPS
  • Product: CP1300EPFCLCD
  • Serial Number: CRLJW2000151

here is an output of /lib/nut/usbhid-ups -DDDDDDDDDD -a cyberpower1500
CP1300EPFCLCD.txt

@flashydave
Copy link
Contributor Author

flashydave commented Dec 28, 2021 via email

@nbriggs
Copy link
Contributor

nbriggs commented Dec 28, 2021

Here's the machine decode (using https://github.com/abend0c1/hidrdd and the Regina-REXX-3.9.4 interpreter) -- seems to match up pretty well with your hand decode.

05 84        (GLOBAL) USAGE_PAGE         0x0084 Power Device Page 
09 04        (LOCAL)  USAGE              0x00840004 UPS (Application Collection)  
A1 01        (MAIN)   COLLECTION         0x01 Application (Usage=0x00840004: Page=Power Device Page, Usage=UPS, Type=Application Collection)
09 24          (LOCAL)  USAGE              0x00840024 Power Summary (Logical or Physical Collection)  
A1 00          (MAIN)   COLLECTION         0x00 Physical (Usage=0x00840024: Page=Power Device Page, Usage=Power Summary, Type=Logical or Physical Collection)
85 01            (GLOBAL) REPORT_ID          0x01 (1)  
09 FE            (LOCAL)  USAGE              0x008400FE i Product (Static Value)  
75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field  
95 01            (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields  
15 00            (GLOBAL) LOGICAL_MINIMUM    0x00 (0)  <-- Info: Consider replacing 15 00 with 14
26 FF00          (GLOBAL) LOGICAL_MAXIMUM    0x00FF (255)  
B1 23            (MAIN)   FEATURE            0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 02            (GLOBAL) REPORT_ID          0x02 (2)  
09 FF            (LOCAL)  USAGE              0x008400FF i Serial Number (Static Value)  
B1 23            (MAIN)   FEATURE            0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 1B            (GLOBAL) REPORT_ID          0x1B (27)  
06 01FF          (GLOBAL) USAGE_PAGE         0xFF01 Vendor-defined 
09 D0            (LOCAL)  USAGE              0xFF0100D0 <-- Warning: Undocumented usage (document it by inserting 00D0 into file FF01.conf)
B1 22            (MAIN)   FEATURE            0x00000022 (1 field x 8 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 03            (GLOBAL) REPORT_ID          0x03 (3)  
05 85            (GLOBAL) USAGE_PAGE         0x0085 Battery System Page 
09 89            (LOCAL)  USAGE              0x00850089 i Device Chemistry (Static Value)  
B1 23            (MAIN)   FEATURE            0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 04            (GLOBAL) REPORT_ID          0x04 (4)  
09 8F            (LOCAL)  USAGE              0x0085008F i OEMInformation (Static Value)  
B1 23            (MAIN)   FEATURE            0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 05            (GLOBAL) REPORT_ID          0x05 (5)  
09 8B            (LOCAL)  USAGE              0x0085008B Rechargeable (Static Value)  
B1 23            (MAIN)   FEATURE            0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 06            (GLOBAL) REPORT_ID          0x06 (6)  
09 2C            (LOCAL)  USAGE              0x0085002C Capacity Mode (Dynamic Value)  
B1 23            (MAIN)   FEATURE            0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 07            (GLOBAL) REPORT_ID          0x07 (7)  
75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field <-- Redundant: REPORT_SIZE is already 8 
95 06            (GLOBAL) REPORT_COUNT       0x06 (6) Number of fields  
25 64            (GLOBAL) LOGICAL_MAXIMUM    0x64 (100)  
09 83            (LOCAL)  USAGE              0x00850083 Design Capacity (Static Value)  
09 8D            (LOCAL)  USAGE              0x0085008D Capacity Granularity 1 (Static Value)  
09 8E            (LOCAL)  USAGE              0x0085008E Capacity Granularity 2 (Static Value)  
09 8C            (LOCAL)  USAGE              0x0085008C Warning Capacity Limit (Static Value)  
09 29            (LOCAL)  USAGE              0x00850029 Remaining Capacity Limit (Dynamic Value)  
09 67            (LOCAL)  USAGE              0x00850067 Full Charge Capacity (Dynamic Value)  
B1 23            (MAIN)   FEATURE            0x00000023 (6 fields x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 08            (GLOBAL) REPORT_ID          0x08 (8)  
75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field <-- Redundant: REPORT_SIZE is already 8 
95 01            (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields  
65 00            (GLOBAL) UNIT               0x00 No unit (0=None) <-- Redundant: UNIT is already 0x00000000 <-- Info: Consider replacing 65 00 with 64
09 66            (LOCAL)  USAGE              0x00850066 Remaining Capacity (Dynamic Value)  
81 23            (MAIN)   INPUT              0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
09 66            (LOCAL)  USAGE              0x00850066 Remaining Capacity (Dynamic Value)  
B1 A3            (MAIN)   FEATURE            0x000000A3 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
09 68            (LOCAL)  USAGE              0x00850068 Run Time To Empty (Dynamic Value)  
75 10            (GLOBAL) REPORT_SIZE        0x10 (16) Number of bits per field  
27 FFFF0000      (GLOBAL) LOGICAL_MAXIMUM    0x0000FFFF (65535)  
66 0110          (GLOBAL) UNIT               0x1001 Time in seconds [1 s units] (1=System=SI Linear, 1=Time=Seconds)  
81 23            (MAIN)   INPUT              0x00000023 (1 field x 16 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
09 68            (LOCAL)  USAGE              0x00850068 Run Time To Empty (Dynamic Value)  
B1 A3            (MAIN)   FEATURE            0x000000A3 (1 field x 16 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
09 2A            (LOCAL)  USAGE              0x0085002A Remaining Time Limit (Dynamic Value)  
26 5802          (GLOBAL) LOGICAL_MAXIMUM    0x0258 (600)  
81 23            (MAIN)   INPUT              0x00000023 (1 field x 16 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
09 2A            (LOCAL)  USAGE              0x0085002A Remaining Time Limit (Dynamic Value)  
B1 A2            (MAIN)   FEATURE            0x000000A2 (1 field x 16 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
85 09            (GLOBAL) REPORT_ID          0x09 (9)  
75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field  
26 FF00          (GLOBAL) LOGICAL_MAXIMUM    0x00FF (255)  
05 84            (GLOBAL) USAGE_PAGE         0x0084 Power Device Page 
09 40            (LOCAL)  USAGE              0x00840040 Config Voltage (Static Value or Dynamic Value)  
67 21D1F000      (GLOBAL) UNIT               0x00F0D121 Electric potential difference in volts [0.1 μV units] (1=System=SI Linear, 2=Length=Centimetre², 1=Mass=Gram, D=Time=Seconds⁻³, F=Current=Ampere⁻¹)  
55 06            (GLOBAL) UNIT_EXPONENT      0x06 (Unit Value x 10⁶)  
B1 23            (MAIN)   FEATURE            0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 0A            (GLOBAL) REPORT_ID          0x0A (10)  
09 30            (LOCAL)  USAGE              0x00840030 Voltage (Dynamic Value)  
B1 A3            (MAIN)   FEATURE            0x000000A3 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
09 02            (LOCAL)  USAGE              0x00840002 Present Status (Logical Collection)  
A1 02            (MAIN)   COLLECTION         0x02 Logical (Usage=0x00840002: Page=Power Device Page, Usage=Present Status, Type=Logical Collection)
65 00              (GLOBAL) UNIT               0x00 No unit (0=None)  <-- Info: Consider replacing 65 00 with 64
55 00              (GLOBAL) UNIT_EXPONENT      0x00 (Unit Value x 10⁰)  <-- Info: Consider replacing 55 00 with 54
85 0B              (GLOBAL) REPORT_ID          0x0B (11)  
75 01              (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field  
95 06              (GLOBAL) REPORT_COUNT       0x06 (6) Number of fields  
25 01              (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)  
05 85              (GLOBAL) USAGE_PAGE         0x0085 Battery System Page 
09 D0              (LOCAL)  USAGE              0x008500D0 AC Present (Dynamic Flag)  
09 44              (LOCAL)  USAGE              0x00850044 Charging (Dynamic Flag)  
09 45              (LOCAL)  USAGE              0x00850045 Discharging (Dynamic Value)  
09 42              (LOCAL)  USAGE              0x00850042 Below Remaining Capacity Limit (Dynamic Flag)  
09 46              (LOCAL)  USAGE              0x00850046 Fully Charged (Dynamic Flag)  
09 43              (LOCAL)  USAGE              0x00850043 Remaining Time Limit Expired (Dynamic Flag)  
81 23              (MAIN)   INPUT              0x00000023 (6 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
09 D0              (LOCAL)  USAGE              0x008500D0 AC Present (Dynamic Flag)  
09 44              (LOCAL)  USAGE              0x00850044 Charging (Dynamic Flag)  
09 45              (LOCAL)  USAGE              0x00850045 Discharging (Dynamic Value)  
09 42              (LOCAL)  USAGE              0x00850042 Below Remaining Capacity Limit (Dynamic Flag)  
09 46              (LOCAL)  USAGE              0x00850046 Fully Charged (Dynamic Flag)  
09 43              (LOCAL)  USAGE              0x00850043 Remaining Time Limit Expired (Dynamic Flag)  
B1 A3              (MAIN)   FEATURE            0x000000A3 (6 fields x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
75 02              (GLOBAL) REPORT_SIZE        0x02 (2) Number of bits per field  
95 01              (GLOBAL) REPORT_COUNT       0x01 (1) Number of fields  
81 01              (MAIN)   INPUT              0x00000001 (1 field x 2 bits) 1=Constant 0=Array 0=Absolute 
B1 01              (MAIN)   FEATURE            0x00000001 (1 field x 2 bits) 1=Constant 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap 
C0               (MAIN)   END_COLLECTION     Logical 
85 0C            (GLOBAL) REPORT_ID          0x0C (12)  
05 84            (GLOBAL) USAGE_PAGE         0x0084 Power Device Page 
09 5A            (LOCAL)  USAGE              0x0084005A Audible Alarm Control (Dynamic Value)  
75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field  
15 01            (GLOBAL) LOGICAL_MINIMUM    0x01 (1)  
25 03            (GLOBAL) LOGICAL_MAXIMUM    0x03 (3)  
B1 A2            (MAIN)   FEATURE            0x000000A2 (1 field x 8 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
09 5A            (LOCAL)  USAGE              0x0084005A Audible Alarm Control (Dynamic Value)  
81 22            (MAIN)   INPUT              0x00000022 (1 field x 8 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 0D            (GLOBAL) REPORT_ID          0x0D (13)  
09 FD            (LOCAL)  USAGE              0x008400FD i Manufacturer (Static Value)  
15 00            (GLOBAL) LOGICAL_MINIMUM    0x00 (0)  <-- Info: Consider replacing 15 00 with 14
26 FF00          (GLOBAL) LOGICAL_MAXIMUM    0x00FF (255)  
B1 23            (MAIN)   FEATURE            0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
C0             (MAIN)   END_COLLECTION     Physical 
05 84          (GLOBAL) USAGE_PAGE         0x0084 Power Device Page <-- Redundant: USAGE_PAGE is already 0x0084
09 1A          (LOCAL)  USAGE              0x0084001A Input (Physical Collection)  
A1 00          (MAIN)   COLLECTION         0x00 Physical (Usage=0x0084001A: Page=Power Device Page, Usage=Input, Type=Physical Collection)
85 0E            (GLOBAL) REPORT_ID          0x0E (14)  
05 84            (GLOBAL) USAGE_PAGE         0x0084 Power Device Page <-- Redundant: USAGE_PAGE is already 0x0084
09 40            (LOCAL)  USAGE              0x00840040 Config Voltage (Static Value or Dynamic Value)  
75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field <-- Redundant: REPORT_SIZE is already 8 
67 21D1F000      (GLOBAL) UNIT               0x00F0D121 Electric potential difference in volts [0.1 μV units] (1=System=SI Linear, 2=Length=Centimetre², 1=Mass=Gram, D=Time=Seconds⁻³, F=Current=Ampere⁻¹)  
55 07            (GLOBAL) UNIT_EXPONENT      0x07 (Unit Value x 10⁷)  
B1 23            (MAIN)   FEATURE            0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 0F            (GLOBAL) REPORT_ID          0x0F (15)  
75 10            (GLOBAL) REPORT_SIZE        0x10 (16) Number of bits per field  
09 30            (LOCAL)  USAGE              0x00840030 Voltage (Dynamic Value)  
B1 A3            (MAIN)   FEATURE            0x000000A3 (1 field x 16 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
85 10            (GLOBAL) REPORT_ID          0x10 (16)  
09 53            (LOCAL)  USAGE              0x00840053 Low Voltage Transfer (Dynamic Value)  
16 AA00          (GLOBAL) LOGICAL_MINIMUM    0x00AA (170)  
26 B400          (GLOBAL) LOGICAL_MAXIMUM    0x00B4 (180)  
B1 A2            (MAIN)   FEATURE            0x000000A2 (1 field x 16 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
09 53            (LOCAL)  USAGE              0x00840053 Low Voltage Transfer (Dynamic Value)  
81 23            (MAIN)   INPUT              0x00000023 (1 field x 16 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
09 54            (LOCAL)  USAGE              0x00840054 High Voltage Transfer (Dynamic Value)  
16 0401          (GLOBAL) LOGICAL_MINIMUM    0x0104 (260)  
26 0E01          (GLOBAL) LOGICAL_MAXIMUM    0x010E (270)  
B1 A2            (MAIN)   FEATURE            0x000000A2 (1 field x 16 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
09 54            (LOCAL)  USAGE              0x00840054 High Voltage Transfer (Dynamic Value)  
81 23            (MAIN)   INPUT              0x00000023 (1 field x 16 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
C0             (MAIN)   END_COLLECTION     Physical  <-- Warning: Physical units are still in effect PHYSICAL(MIN=,MAX=) UNIT(0x00F0D121,EXP=7)
09 1C          (LOCAL)  USAGE              0x0084001C Output (Physical Collection)  
A1 00          (MAIN)   COLLECTION         0x00 Physical (Usage=0x0084001C: Page=Power Device Page, Usage=Output, Type=Physical Collection)
85 12            (GLOBAL) REPORT_ID          0x12 (18)  
09 30            (LOCAL)  USAGE              0x00840030 Voltage (Dynamic Value)  
B1 A3            (MAIN)   FEATURE            0x000000A3 (1 field x 16 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field  
15 00            (GLOBAL) LOGICAL_MINIMUM    0x00 (0)  <-- Info: Consider replacing 15 00 with 14
26 FF00          (GLOBAL) LOGICAL_MAXIMUM    0x00FF (255)  
65 00            (GLOBAL) UNIT               0x00 No unit (0=None)  <-- Info: Consider replacing 65 00 with 64
55 00            (GLOBAL) UNIT_EXPONENT      0x00 (Unit Value x 10⁰)  <-- Info: Consider replacing 55 00 with 54
85 13            (GLOBAL) REPORT_ID          0x13 (19)  
09 35            (LOCAL)  USAGE              0x00840035 Percent Load (Dynamic Value)  
B1 A3            (MAIN)   FEATURE            0x000000A3 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
85 14            (GLOBAL) REPORT_ID          0x14 (20)  
09 58            (LOCAL)  USAGE              0x00840058 Test (Dynamic Value)  
25 06            (GLOBAL) LOGICAL_MAXIMUM    0x06 (6)  
B1 A2            (MAIN)   FEATURE            0x000000A2 (1 field x 8 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
09 58            (LOCAL)  USAGE              0x00840058 Test (Dynamic Value)  
81 22            (MAIN)   INPUT              0x00000022 (1 field x 8 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 15            (GLOBAL) REPORT_ID          0x15 (21)  
09 57            (LOCAL)  USAGE              0x00840057 Delay Before Shutdown (Dynamic Value)  
75 10            (GLOBAL) REPORT_SIZE        0x10 (16) Number of bits per field  
15 FF            (GLOBAL) LOGICAL_MINIMUM    0xFF (-1)  
26 FF7F          (GLOBAL) LOGICAL_MAXIMUM    0x7FFF (32767)  
35 C4            (GLOBAL) PHYSICAL_MINIMUM   0xC4 (-60)  
47 C4FF1D00      (GLOBAL) PHYSICAL_MAXIMUM   0x001DFFC4 (1966020)  
66 0110          (GLOBAL) UNIT               0x1001 Time in seconds [1 s units] (1=System=SI Linear, 1=Time=Seconds)  
B1 A2            (MAIN)   FEATURE            0x000000A2 (1 field x 16 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
85 16            (GLOBAL) REPORT_ID          0x16 (22)  
09 56            (LOCAL)  USAGE              0x00840056 Delay Before Startup (Dynamic Value)  
B1 A2            (MAIN)   FEATURE            0x000000A2 (1 field x 16 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
85 17            (GLOBAL) REPORT_ID          0x17 (23)  
09 6E            (LOCAL)  USAGE              0x0084006E Boost (Dynamic Flag)  
75 01            (GLOBAL) REPORT_SIZE        0x01 (1) Number of bits per field  
15 00            (GLOBAL) LOGICAL_MINIMUM    0x00 (0)  <-- Info: Consider replacing 15 00 with 14
25 01            (GLOBAL) LOGICAL_MAXIMUM    0x01 (1)  
35 00            (GLOBAL) PHYSICAL_MINIMUM   0x00 (0)  <-- Info: Consider replacing 35 00 with 34
45 00            (GLOBAL) PHYSICAL_MAXIMUM   0x00 (0)  <-- Info: Consider replacing 45 00 with 44
65 00            (GLOBAL) UNIT               0x00 No unit (0=None)  <-- Info: Consider replacing 65 00 with 64
B1 A3            (MAIN)   FEATURE            0x000000A3 (1 field x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
09 65            (LOCAL)  USAGE              0x00840065 Overload (Dynamic Flag)  
B1 A3            (MAIN)   FEATURE            0x000000A3 (1 field x 1 bit) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
75 06            (GLOBAL) REPORT_SIZE        0x06 (6) Number of bits per field  
B1 01            (MAIN)   FEATURE            0x00000001 (1 field x 6 bits) 1=Constant 0=Array 0=Absolute 0=NoWrap 0=Linear 0=PrefState 0=NoNull 0=NonVolatile 0=Bitmap 
85 18            (GLOBAL) REPORT_ID          0x18 (24)  
75 10            (GLOBAL) REPORT_SIZE        0x10 (16) Number of bits per field  
09 44            (LOCAL)  USAGE              0x00840044 Config Active Power (Static Value or Dynamic Value)  
26 8403          (GLOBAL) LOGICAL_MAXIMUM    0x0384 (900)  
66 21D1          (GLOBAL) UNIT               0xD121 Power in watts [0.1 μW units] (1=System=SI Linear, 2=Length=Centimetre², 1=Mass=Gram, D=Time=Seconds⁻³)  
55 07            (GLOBAL) UNIT_EXPONENT      0x07 (Unit Value x 10⁷)  
B1 A3            (MAIN)   FEATURE            0x000000A3 (1 field x 16 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
85 1A            (GLOBAL) REPORT_ID          0x1A (26)  
06 01FF          (GLOBAL) USAGE_PAGE         0xFF01 Vendor-defined 
65 00            (GLOBAL) UNIT               0x00 No unit (0=None)  <-- Info: Consider replacing 65 00 with 64
55 00            (GLOBAL) UNIT_EXPONENT      0x00 (Unit Value x 10⁰)  <-- Info: Consider replacing 55 00 with 54
75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field  
15 00            (GLOBAL) LOGICAL_MINIMUM    0x00 (0) <-- Redundant: LOGICAL_MINIMUM is already 0 <-- Info: Consider replacing 15 00 with 14
25 02            (GLOBAL) LOGICAL_MAXIMUM    0x02 (2)  
09 43            (LOCAL)  USAGE              0xFF010043 <-- Warning: Undocumented usage (document it by inserting 0043 into file FF01.conf)
B1 A2            (MAIN)   FEATURE            0x000000A2 (1 field x 8 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 0=Bitmap 
09 43            (LOCAL)  USAGE              0xFF010043 <-- Warning: Undocumented usage (document it by inserting 0043 into file FF01.conf)
81 23            (MAIN)   INPUT              0x00000023 (1 field x 8 bits) 1=Constant 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
C0             (MAIN)   END_COLLECTION     Physical 
85 1C          (GLOBAL) REPORT_ID          0x1C (28)  
09 BA          (LOCAL)  USAGE              0xFF0100BA <-- Warning: Undocumented usage (document it by inserting 00BA into file FF01.conf)
A1 02          (MAIN)   COLLECTION         0x02 Logical (Usage=0xFF0100BA: Page=Vendor-defined, Usage=, Type=) <-- Error: COLLECTION must be preceded by a known USAGE
75 10            (GLOBAL) REPORT_SIZE        0x10 (16) Number of bits per field  
27 FFFF0000      (GLOBAL) LOGICAL_MAXIMUM    0x0000FFFF (65535)  
09 BB            (LOCAL)  USAGE              0xFF0100BB <-- Warning: Undocumented usage (document it by inserting 00BB into file FF01.conf)
B1 22            (MAIN)   FEATURE            0x00000022 (1 field x 16 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
75 08            (GLOBAL) REPORT_SIZE        0x08 (8) Number of bits per field  
26 FF00          (GLOBAL) LOGICAL_MAXIMUM    0x00FF (255)  
09 BC            (LOCAL)  USAGE              0xFF0100BC <-- Warning: Undocumented usage (document it by inserting 00BC into file FF01.conf)
B1 22            (MAIN)   FEATURE            0x00000022 (1 field x 8 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 0=NonVolatile 0=Bitmap 
75 10            (GLOBAL) REPORT_SIZE        0x10 (16) Number of bits per field  
27 FFFF0000      (GLOBAL) LOGICAL_MAXIMUM    0x0000FFFF (65535)  
09 BD            (LOCAL)  USAGE              0xFF0100BD <-- Warning: Undocumented usage (document it by inserting 00BD into file FF01.conf)
B2 A201          (MAIN)   FEATURE            0x000001A2 (1 field x 16 bits) 0=Data 1=Variable 0=Absolute 0=NoWrap 0=Linear 1=NoPrefState 0=NoNull 1=Volatile 1=Buffer 
C0             (MAIN)   END_COLLECTION     Logical 
C0           (MAIN)   END_COLLECTION     Application 

@flashydave
Copy link
Contributor Author

flashydave commented Jan 7, 2022 via email

It appears both input and output LogMin and LogMax values are incorrect
as the rated voltage (for EU models) is 170v to 270v which is outside
the logical limits reported by the HID.  The fix checks for the error
(loosely) and then applies reasonable values (0v and 511v) to allow the
actual input and output voltages to be reported rather than be
constrained to the limits.
@jimklimov jimklimov added the USB-HID encoding/LogMin/LogMax Issues and solutions (PRs) specifically about incorrect values in bitstream label Jan 12, 2022
@jimklimov
Copy link
Member

Note: updated with the current state of the NUT master branch (since recently including the libusb-1.0(+0.1) codebase as well), to solve a merge conflict and to safely forget the sibling PR originally posted with libusb-1.0 as the target.

@flashydave
Copy link
Contributor Author

Not sure why the jenkins CI seems to be stalled. Can someone take a look?
The pull request is otherwise complete and ready for merging.

@jimklimov
Copy link
Member

jimklimov commented Jan 13, 2022 via email

…obal variable

Pre-emptively: `extern pDesc` is defined in libhid.h which does not
seem to be used in/along-with hidparser.{c,h} currently - but this
collision may happen later (especially with code-copying around).
@jimklimov
Copy link
Member

I suppose inspiration from hidparser.c could have misfired here; I'll pre-emptively reword that too, to avoid stepping into this twice :)

@jimklimov jimklimov merged commit 5998729 into networkupstools:master Jan 19, 2022
@jimklimov
Copy link
Member

jimklimov commented Jan 19, 2022

Hooray, finally good enough for the (stuttering lately) CI farm! For some reason, it failed to publish the verdict - green on Jenkins, (remained?) red here...

@nbriggs
Copy link
Contributor

nbriggs commented Jan 19, 2022

at https://ci.networkupstools.org/blue/organizations/jenkins/nut%2Fnut/detail/PR-1245/15/pipeline it shows one failure for
"jenkins-freebsd12-worker was marked offline: Connection was broken: java.io.EOFException"

Don't know anything about the details of your setup, but perhaps there's a (virtual) machine not running properly?

@jimklimov
Copy link
Member

jimklimov commented Jan 20, 2022 via email

jimklimov added a commit to jimklimov/nut that referenced this pull request Feb 7, 2022
jimklimov added a commit to pkubanek/nut that referenced this pull request Feb 9, 2022
@45413 45413 mentioned this pull request Jul 12, 2022
jimklimov added a commit to jimklimov/nut that referenced this pull request Dec 13, 2024
… Input Voltage" for a fix [networkupstools#1245]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov added this to the 2.8.0 milestone Dec 13, 2024
jimklimov added a commit to jimklimov/nut that referenced this pull request Dec 16, 2024
… Input Voltage" for a fix [networkupstools#1245]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added a commit that referenced this pull request Dec 18, 2024
…p for input_logmin/input_logmax vs. high voltage transfer [#1245, #2718]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ready / code review Author (and CI) consider the PR worthy of human rewievers' time ready / gonna merge The PR is in final cycles leading to merge unless someone logs an objection before we hit the button USB USB-HID encoding/LogMin/LogMax Issues and solutions (PRs) specifically about incorrect values in bitstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants