-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Conversation
This comment has been minimized.
This comment has been minimized.
drivers/cps-hid.c
Outdated
* 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))) { |
There was a problem hiding this comment.
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.
I couldnt reconcile the 270v max ac voltage specifucation of the product with
the logical min and logical max values. My take was that they employ an
8 bit ADC on this domestic class device and it cant actually measure outside 0-255 volts.
Without access to a lab or input from cyberpower themselves its
difficult to predict its characteristics.
It is quite possible the HID is more broken than we think and the
Min/Max values for the ConfigVoltage and Voltage (reports 0x0e and 0x0f)
are alsi in error having been inherited from report 0x0d which is
iManufacturer and defined in an earlier collection.
I would like to know the real input and output voltages (unrestricted by
internal max limits applied by the program) but dont know how best to
set it.
Maybe somebody else has more knowledge or can add something.
Happy to amend the program if it is deemed a good idea.
regards
Dave
…On 13:56, Fri 24 Dec 21, Wojciech Migas wrote:
@wmigas commented on this pull request.
> + HIDData_t *pData;
+
+ int vendorID = pDev->VendorID;
+ int productID = pDev->ProductID;
+ if (vendorID != CPS_VENDORID || productID != 0x0501) {
+ return 0;
+ }
+
+ upsdebugx(3, "Attempting Report Descriptor fix for UPS: Vendor:%04x, Product:%04x", vendorID, productID);
+
+ /* Apply the fix cautiously by looking for input voltage, high voltage transfer and output voltage report usages.
+ * If the output voltage log min/max equals high voltage transfer log min/max then the bug is present.
+ * 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))) {
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 ](https://www.cyberpower.com/eu/pl/File/GetFileSampleByType?fileId=DS-18080023-01&fileType=Download%20Center&fileSubType=FileOriginal) 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.
--
Reply to this email directly or view it on GitHub:
#1245 (review)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Just in case - could the voltages be counted as an offset from a non-zero
base value? Maybe using some other report to set that base? (e.g. 170 in
one for EU, V-170 in another)?
…On Sat, Dec 25, 2021, 22:10 flashydave ***@***.***> wrote:
I couldnt reconcile the 270v max ac voltage specifucation of the product
with
the logical min and logical max values. My take was that they employ an
8 bit ADC on this domestic class device and it cant actually measure
outside 0-255 volts.
Without access to a lab or input from cyberpower themselves its
difficult to predict its characteristics.
It is quite possible the HID is more broken than we think and the
Min/Max values for the ConfigVoltage and Voltage (reports 0x0e and 0x0f)
are alsi in error having been inherited from report 0x0d which is
iManufacturer and defined in an earlier collection.
I would like to know the real input and output voltages (unrestricted by
internal max limits applied by the program) but dont know how best to
set it.
Maybe somebody else has more knowledge or can add something.
Happy to amend the program if it is deemed a good idea.
regards
Dave
On 13:56, Fri 24 Dec 21, Wojciech Migas wrote:
> @wmigas commented on this pull request.
>
>
>
> > + HIDData_t *pData;
> +
> + int vendorID = pDev->VendorID;
> + int productID = pDev->ProductID;
> + if (vendorID != CPS_VENDORID || productID != 0x0501) {
> + return 0;
> + }
> +
> + upsdebugx(3, "Attempting Report Descriptor fix for UPS: Vendor:%04x,
Product:%04x", vendorID, productID);
> +
> + /* Apply the fix cautiously by looking for input voltage, high voltage
transfer and output voltage report usages.
> + * If the output voltage log min/max equals high voltage transfer log
min/max then the bug is present.
> + * 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))) {
>
> 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 ](
https://www.cyberpower.com/eu/pl/File/GetFileSampleByType?fileId=DS-18080023-01&fileType=Download%20Center&fileSubType=FileOriginal)
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.
>
>
> --
> Reply to this email directly or view it on GitHub:
>
#1245 (review)
> You are receiving this because you authored the thread.
>
> Message ID: ***@***.***>
—
Reply to this email directly, view it on GitHub
<#1245 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMPTFFLJWWXBNEZIK4N4WDUSYXLVANCNFSM5KW6YDXQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I guess that is possible but the LogMin is zero and I would expect it to
output a zero when on battery if the input had failed or been
disconnected.
I have reached our to Cyberpower and asked the question but we will have
to see if they respond in a useful way.
…On 00:29, Sun 26 Dec 21, Jim Klimov wrote:
Just in case - could the voltages be counted as an offset from a non-zero
base value? Maybe using some other report to set that base? (e.g. 170 in
one for EU, V-170 in another)?
On Sat, Dec 25, 2021, 22:10 flashydave ***@***.***> wrote:
> I couldnt reconcile the 270v max ac voltage specifucation of the product
> with
> the logical min and logical max values. My take was that they employ an
> 8 bit ADC on this domestic class device and it cant actually measure
> outside 0-255 volts.
> Without access to a lab or input from cyberpower themselves its
> difficult to predict its characteristics.
>
> It is quite possible the HID is more broken than we think and the
> Min/Max values for the ConfigVoltage and Voltage (reports 0x0e and 0x0f)
> are alsi in error having been inherited from report 0x0d which is
> iManufacturer and defined in an earlier collection.
>
> I would like to know the real input and output voltages (unrestricted by
> internal max limits applied by the program) but dont know how best to
> set it.
>
> Maybe somebody else has more knowledge or can add something.
>
> Happy to amend the program if it is deemed a good idea.
>
> regards
> Dave
>
> On 13:56, Fri 24 Dec 21, Wojciech Migas wrote:
> > @wmigas commented on this pull request.
> >
> >
> >
> > > + HIDData_t *pData;
> > +
> > + int vendorID = pDev->VendorID;
> > + int productID = pDev->ProductID;
> > + if (vendorID != CPS_VENDORID || productID != 0x0501) {
> > + return 0;
> > + }
> > +
> > + upsdebugx(3, "Attempting Report Descriptor fix for UPS: Vendor:%04x,
> Product:%04x", vendorID, productID);
> > +
> > + /* Apply the fix cautiously by looking for input voltage, high voltage
> transfer and output voltage report usages.
> > + * If the output voltage log min/max equals high voltage transfer log
> min/max then the bug is present.
> > + * 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))) {
> >
> > 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 ](
> https://www.cyberpower.com/eu/pl/File/GetFileSampleByType?fileId=DS-18080023-01&fileType=Download%20Center&fileSubType=FileOriginal)
> 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.
> >
> >
> > --
> > Reply to this email directly or view it on GitHub:
> >
> #1245 (review)
> > You are receiving this because you authored the thread.
> >
> > Message ID: ***@***.***>
>
> —
> Reply to this email directly, view it on GitHub
> <#1245 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAMPTFFLJWWXBNEZIK4N4WDUSYXLVANCNFSM5KW6YDXQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
--
Reply to this email directly or view it on GitHub:
#1245 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
I have received a response from Cyberpower which says they will escalate
my questions to their engineering team. Maybe we will get clarification
as to the UPS characteristics in this area.
btw thank you for your commit.
…On 00:29, Sun 26 Dec 21, Jim Klimov wrote:
Just in case - could the voltages be counted as an offset from a non-zero
base value? Maybe using some other report to set that base? (e.g. 170 in
one for EU, V-170 in another)?
On Sat, Dec 25, 2021, 22:10 flashydave ***@***.***> wrote:
> I couldnt reconcile the 270v max ac voltage specifucation of the product
> with
> the logical min and logical max values. My take was that they employ an
> 8 bit ADC on this domestic class device and it cant actually measure
> outside 0-255 volts.
> Without access to a lab or input from cyberpower themselves its
> difficult to predict its characteristics.
>
> It is quite possible the HID is more broken than we think and the
> Min/Max values for the ConfigVoltage and Voltage (reports 0x0e and 0x0f)
> are alsi in error having been inherited from report 0x0d which is
> iManufacturer and defined in an earlier collection.
>
> I would like to know the real input and output voltages (unrestricted by
> internal max limits applied by the program) but dont know how best to
> set it.
>
> Maybe somebody else has more knowledge or can add something.
>
> Happy to amend the program if it is deemed a good idea.
>
> regards
> Dave
>
> On 13:56, Fri 24 Dec 21, Wojciech Migas wrote:
> > @wmigas commented on this pull request.
> >
> >
> >
> > > + HIDData_t *pData;
> > +
> > + int vendorID = pDev->VendorID;
> > + int productID = pDev->ProductID;
> > + if (vendorID != CPS_VENDORID || productID != 0x0501) {
> > + return 0;
> > + }
> > +
> > + upsdebugx(3, "Attempting Report Descriptor fix for UPS: Vendor:%04x,
> Product:%04x", vendorID, productID);
> > +
> > + /* Apply the fix cautiously by looking for input voltage, high voltage
> transfer and output voltage report usages.
> > + * If the output voltage log min/max equals high voltage transfer log
> min/max then the bug is present.
> > + * 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))) {
> >
> > 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 ](
> https://www.cyberpower.com/eu/pl/File/GetFileSampleByType?fileId=DS-18080023-01&fileType=Download%20Center&fileSubType=FileOriginal)
> 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.
> >
> >
> > --
> > Reply to this email directly or view it on GitHub:
> >
> #1245 (review)
> > You are receiving this because you authored the thread.
> >
> > Message ID: ***@***.***>
>
> —
> Reply to this email directly, view it on GitHub
> <#1245 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAMPTFFLJWWXBNEZIK4N4WDUSYXLVANCNFSM5KW6YDXQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
>
> You are receiving this because you are subscribed to this thread.Message
> ID: ***@***.***>
>
--
Reply to this email directly or view it on GitHub:
#1245 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
@flashydave @jimklimov may we apply changes related to the logical Max value. It should be set
Logical Min can be hardcoded to 0, because when there is power failure, then UPS returns 0 |
Just in case, CCing @nbriggs as our recent expert in USB protocol nuances, and LogMin/LogMax processing in particular. |
Using this logic we need to fix the InputVoltage too.
…On 10:12, Tue 28 Dec 21, Wojciech Migas wrote:
@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
--
Reply to this email directly or view it on GitHub:
#1245 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
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 |
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?" |
@nbriggs
here is an output of |
Here is a hand decoded report:
05 84 = UPAGE Power Device
09 04 = USAGE UPS (Application collection)
a1 01 = COLLECTION Application
09 24 = USAGE Power Summary (Logical Collection, Physical Collection)
a1 00 = COLLECTION Physical
85 01 = REPORT_ID 1
09 fe = USAGE iProduct (Static Value)
75 08 = REPORT SIZE 8 (Global)
95 01 = REPORT COUNT 1
15 00 = Logical Min 0
26 ff 00 = Logical Max 255
b1 23 = Feature (Constant, Variable, No Preferred),
85 02 = REPORT_ID 2
09 ff = USAGE iSerial (Static Value)
b1 23 = Feature (Constant, Variable, No Preferred),
85 1b = REPORT_ID 27
06 01 ff = UPAGE Vendor Defined
09 d0 = USAGE Unknown
b1 22 = Feature (Variable, No Preferred),
85 03 = REPORT_ID 3
05 85 = UPAGE Battery System
09 89 = USAGE iDevice Chemistry (Static Value)
b1 23 = Feature (Constant, Variable, No Preferred),
85 04 = REPORT_ID 4
09 8f = USAGE iOEM Information (Static Value)
b1 23 = Feature (Constant, Variable, No Preferred),
85 05 = REPORT_ID 5
09 8b = USAGE Rechargable (Static Value)
b1 23 = Feature (Constant, Variable, No Preferred),
85 06 = REPORT_ID 6
09 2c = USAGE Capacity Mode (Dynamic Value)
b1 23 = Feature (Constant, Variable, No Preferred),
85 07 = REPORT_ID 7
75 08 = REPORT SIZE 8 (Global)
95 06 = REPORT COUNT 6
25 64 = Logical Max 100
09 83 = USAGE Design Capacity (Static Value)
09 8d = USAGE Capacity Granularity 1 (Static Value)
09 8e = USAGE Capacity Granularity 2 (Static Value)
09 8c = USAGE Warning Capacity Limit (Static Value)
09 29 = USAGE Remaining Capacity Limit (Dnamic Value)
09 67 = USAGE Full Charge Capacity (Dynamic Value)
b1 23 = Feature (Constant, Variable, No Preferred),
85 08 = REPORT_ID 8
75 08 = REPORT SIZE 8 (Global)
95 01 = REPORT COUNT 1
65 00 = UNIT None
09 66 = USAGE Remaining Capacity (Dynamic Value)
81 23 = Input (Constant, Variable, No Preferred),
09 66 = USAGE Remaining Capacity (Dynamic Value)
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
09 68 = USAGE RunTimeToEmpty
75 10 = Report Size 16
27 ff ff 00 00 = Logical Max 65535
66 01 10 = UNIT Seconds
81 23 = Input (Constant, Variable, No Preferred),
09 68 = USAGE RunTimeToEmpty
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
09 2a = USAGE RemainingTimeLimit
26 58 02 = Logical Max 600
81 23 = Input (Constant, Variable, No Preferred),
09 2a = USAGE RemainingTimeLimit
b1 a2 = Feature (Variable, No Preferred, Volatile),
85 09 = REPORT_ID 9
75 08 = REPORT SIZE 8 (Global)
26 ff 00 = Logical Max 255
05 84 = UPAGE Power Device
09 40 = USAGE ConfigVoltage
67 21 d1 f0 00 = UNIT ?? Voltage V
55 06 = EXPONENT 6 << INVALID EXPONENT
b1 23 = Feature (Constant, Variable, No Preferred),
85 0a = REPORT_ID 10
09 30 = USAGE Voltage (Dynamic Value)
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
09 02 = USAGE Present Status (Logical Collection)
a1 02 = COLLECTION Logical
65 00 = UNIT None
55 00 = EXPONENT None
85 0b = REPORT_ID 11
75 01 = REPORT SIZE 1
95 06 = REPORT COUNT 6
25 01 = Logical Max 1
05 85 = UPAGE Battery System
09 d0 = USAGE ACPresent (Dynamic Flag)
09 44 = USAGE Charging (Dynamic Flag)
09 45 = USAGE Discharging (Dynamic Value)
09 42 = USAGE BelowRemainingCapacityLimit (Dynamic Flag)
09 46 = USAGE FullyCharged (Dynamic Flag)
09 43 = USAGE RemainingTimeLimitExpired (Dynamic Flag)
81 23 = Input (Constant, Variable, No Preferred),
09 d0 = USAGE ACPresent
09 44 = USAGE Charging (Dynamic Flag)
09 45 = USAGE Discharging (Dynamic Value)
09 42 = USAGE BelowRemainingCapacityLimit (Dynamic Flag)
09 46 = USAGE FullyCharged (Dynamic Flag)
09 43 = USAGE RemainingTimeLimitExpired (Dynamic Flag)
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
75 02 = REPORT SIZE 2
95 01 = REPORT COUNT 6
81 01 = Input (Constant),
b1 01 = Feature (Constant),
c0 = END COLLECTION
85 0c = REPORT_ID 12
05 84 = UPAGE Power Device
09 5a = USAGE AudibleAlarmControl
75 08 = REPORT SIZE 8 (Global)
15 01 = Logical Min 1
25 03 = Logical Max 3
b1 a2 = Feature (Variable, No Preferred, Volatile),
09 5a = USAGE AudibleAlarmControl
81 22 = Input (Variable, No Preferred),
85 0d = REPORT_ID 13
09 fd = USAGE iManufacturer
15 00 = Logical Min 00
26 ff 00 = Logical Max 255
b1 23 = Feature (Constant, Variable, No Preferred),
c0 = END COLLECTION
05 84 = UPAGE Power Device
09 1a = USAGE Input (Physical Collextion)
a1 00 = COLLECTION Physical
85 0e = REPORT_ID 14
05 84 = UPAGE Power Device
09 40 = USAGE ConfigVoltage (Static Value Dynamic Value)
75 08 = REPORT SIZE 8 (Global)
67 21 d1 f0 00 = UNIT AC Voltage V
55 07 = EXPONENT 7
b1 23 = Feature (Constant, Variable, No Preferred),
85 0f = REPORT_ID 15
75 10 = Report Size 16
09 30 = USAGE Voltage
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
85 10 = REPORT_ID 16
09 53 = USAGE LowVoltageTransfer
16 aa 00 = Logical Min 170
26 b4 00 = Logical Max VALUE 180
b1 a2 = Feature (Variable, No Preferred, Volatile),
09 53 = USAGE LowVoltageTransfer
81 23 = Input (Constant, Variable, No Preferred),
09 54 = USAGE HighVoltageTransfer
16 04 01 = Logical Min VALUE 260
26 0e 01 = Logical Max VALUE 270
b1 a2 = Feature (Variable, No Preferred, Volatile),
09 54 = USAGE HighVoltageTransfer
81 23 = Input (Constant, Variable, No Preferred),
c0 = END COLLECTION
09 1c = USAGE Output (Physical Collection)
a1 00 = COLLECTION Physical
85 12 = REPORT_ID 18
09 30 = USAGE Voltage (Dyanamic Value)
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
75 08 = REPORT SIZE 8 (Global 1 byte)
15 00 = Logical Min 0
26 ff 00 = Logical Max 255
65 00 = UNIT None
55 00 = EXPONENT 0
85 13 = REPORT_ID 19
09 35 = USAGE PercentLoad (Dynamic)
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
85 14 = REPORT_ID 20
09 58 = USAGE Test
25 06 = Logical Max 6
b1 a2 = Feature (Variable, No Preferred, Volatile),
09 58 = USAGE Test (Dynamic Value)
81 22 = Input (Variable, No Preferred),
85 15 = REPORT_ID 21
09 57 = USAGE DelayBeforeShutdown (Dynamic Value)
75 10 = Report Size 16
15 ff = Logical Min -1
26 ff 7f = Logical Max 32767
35 c4 = Physical Min -60
47 c4 ff 1d 00 = Physical Max 1966020
66 01 10 = UNIT Seconds
b1 a2 = Feature (Variable, No Preferred, Volatile),
85 16 = REPORT_ID 22
09 56 = USAGE DelayBeforeStartup (Dynamic Value)
b1 a2 = Feature (Variable, No Preferred, Volatile),
85 17 = REPORT_ID 23
09 6e = USAGE BOOST
75 01 = Report Size 1
15 00 = Logical Min 0
25 01 = Logical Max 1
35 00 = Physical Min 0
45 00 = Physical Max 0
65 00 = UNIT 0
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
09 65 = USAGE Overload (Dynamic Flag)
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
75 06 = Report Size 6
b1 01 = Feature (Constant),
85 18 = REPORT_ID 24
75 10 = Report Size 16
09 44 = USAGE ConfigActivePower (Static Value, Dynmaic Value)
26 84 03 = Logical Max 900
66 21 d1 = UNIT Apparent or Active Power VA
55 07 = EXPONENT 7 (part of unit)
b1 a3 = Feature (Constant, Variable, No Preferred, Volatile),
85 1a = REPORT_ID 26
06 01 ff = USAGE VENDOR
65 00 = UNIT None
55 00 = EXPONENT 0
75 08 = REPORT SIZE 8 (Global)
15 00 = Logical Min 0
25 02 = Logical Max 2
09 43 = USAGE ConfigApparentPower (Static Value, Dynmaic Value)
b1 a2 = Feature (Variable, No Preferred, Volatile),
09 43 = USAGE ConfigApparentPower (Static Value, Dynmaic Value)
81 23 = Input (Constant, Variable, No Preferred),
c0 = END COLLECTION
c0 = END COLLECTION
…On 13:05, Tue 28 Dec 21, Wojciech Migas wrote:
@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](https://github.com/networkupstools/nut/files/7786287/CP1300EPFCLCD.txt)
--
Reply to this email directly or view it on GitHub:
#1245 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
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.
|
Here is CyberPower's response:
"This is an update regarding your CPS900EFPCLCD. Please be advised that
UPS
will report the voltage above 255V(even 270V), some software will limit
the maximum voltage according to the declared range of the input
voltage,
which is 255. On the UPS, once the voltage is above 255V, AVR will
enable
to buck the input voltage. Additionally, the UPS model misreports the
battery voltage as 24v when there is only one 12v cell fitted, please be
advised that this has been fixed in the latest firmware version of the
UPS."
Given the value reurned as actually a 16 bit number I guess we could set
a very high logmax setting - they imply even above 270. I doubt it
would cause any erroneous operation as far as the driver is concerned.
Re the misreporting of the battery voltage I have asked what rev it was
fixed in. However I am not sure we get that info via the HID (although
their GUI software reports it. Maybe its one of the vendor unique
commands - I have a USB packet capture I might try to use to work it out)
…On 11:40, Tue 28 Dec 21, Wojciech Migas wrote:
> 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 ](https://www.cyberpower.com/eu/pl/File/GetFileSampleByType?fileId=DS-18080023-01&fileType=Download%20Center&fileSubType=FileOriginal) input voltage range is 170-270. maybe it is mac which is supported by hardware. who knows
--
Reply to this email directly or view it on GitHub:
#1245 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
|
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.
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. |
Not sure why the jenkins CI seems to be stalled. Can someone take a look? |
My condolences about that delay. The Fosshost VMs used for the
multiplatform NUT CI farm had migrated over the end of year, to weaker
machines it seems, but ones at least available (sponsor change). And then
libusb-1.0 support layers landed, including some bug-fixes (and increased
default sensitivity to warnings), so "ephemeral branches" for ~30 not yet
merged PRs got recalculated. So now it is unclogging that queue, slowly...
so we'd see the proposed code and recipes remain good everywhere.
…On Thu, Jan 13, 2022, 11:36 flashydave ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub
<#1245 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMPTFHIQVLNIMT4BTXPP7TUV2TKJANCNFSM5KW6YDXQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
…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).
I suppose inspiration from |
Initialize "fix_report_desc", this file appeared from another PR merged before networkupstools#1245
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... |
at https://ci.networkupstools.org/blue/organizations/jenkins/nut%2Fnut/detail/PR-1245/15/pipeline it shows one failure for Don't know anything about the details of your setup, but perhaps there's a (virtual) machine not running properly? |
Sadly yes, things got a bit derailed by Fosshost migration of NUT CI VMs to
another sponsor, that are weaker than the old farm, so it seems we
occasionally hit timeouts somewhere in Jenkins or networking in general,
perhaps losing heartbeats. Feels like those VMs use RAM from swapspace on
host...
…On Thu, Jan 20, 2022, 00:29 Nick Briggs ***@***.***> wrote:
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?
—
Reply to this email directly, view it on GitHub
<#1245 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMPTFHPXB4RKUQMZ7DHFM3UW5CLZANCNFSM5KW6YDXQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
… Input Voltage" for a fix [networkupstools#1245] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… Input Voltage" for a fix [networkupstools#1245] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
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.