Discussion:
[Nut-upsuser] Incorrect Values From usbhid-ups
Bill S
2014-03-24 03:12:14 UTC
Permalink
I recently purchased a CyberPower CP1500PFCLCD UPS as a replacement
UPS for a headless server running Slackware 14.1 with the 3.10.7
kernel. I then downloaded the NUT 2.7.1 tarball on the server and
following the directions installed the software. The installation
went well and the UPS will shutdown the server using the forced down
test and then it powers back up as it should. The installation of
the cgi software has been a real slog however and so far I only have
upsstats.cgi working which brings me to my problem. When I first
looked at the upsstats.cgi screen I found the UPS output voltage to be
very high and it did not match the input voltage. It should however
since the line power just passes through the UPS when it is not on
battery power. After further investigation I determined that problem
was not with upsstats.cgi but apparently with the usbhid-ups driver.
It appears the driver recognizes the CP1500 but it is not interpreting
the response from the CP1500 correctly when it interrogates the unit
for the current output voltage. I now suspect that I wasted quite a
bit of time on this project since it will take programming skills that
I certainly do not have to fix the driver. I am writing however in the
hopes that I am wrong, that the fix is simple, and that it only only
seems complex as a result of my not understanding the real problem.

Is there anything I can do to obtain the correct values?

The output of the driver is below. The incorrect voltage of 136 is
shown at 0.265256. It should match input voltage of 119 as shown at
0.265219 but it doesn't. The voltages displayed on the UPS LCD panel
information however are equal and match the input voltage provided by
the driver. There might be other incorrect values in the usbhid-ups
output but that is the one that has caught my attention so far.


Network UPS Tools - Generic HID driver 0.38 (2.7.1)

USB communication driver 0.32

0.000000 debug level is '2'

0.000404 upsdrv_initups...

0.259751 Checking device (0557/7000) (001/002)

0.259799 Failed to open device, skipping. (Permission denied)

0.259804 Checking device (0764/0501) (001/003)

0.260607 - VendorID: 0764

0.260622 - ProductID: 0501

0.260626 - Manufacturer: CP1500PFCLCD

0.260630 - Product: CRCA102*AF1

0.260634 - Serial Number: CPS

0.260638 - Bus: 001

0.260642 Trying to match device

0.260685 Device matches

0.260697 failed to claim USB device: Device or resource busy

0.260713 detached kernel driver from USB device...

0.261109 HID descriptor length 430

0.261807 Report Descriptor size = 430

0.261958 Using subdriver: CyberPower HID 0.3

0.262049 Path: UPS.PowerSummary.iProduct, Type: Feature,
ReportID: 0x01, Offset: 0, Size: 8, Value: 1

0.262137 Path: UPS.PowerSummary.iSerialNumber, Type: Feature,
ReportID: 0x02, Offset: 0, Size: 8, Value: 2

0.262220 Path: UPS.PowerSummary.iDeviceChemistry, Type:
Feature, ReportID: 0x03, Offset: 0, Size: 8, Value: 4

0.262305 Path: UPS.PowerSummary.iOEMInformation, Type: Feature,
ReportID: 0x04, Offset: 0, Size: 8, Value: 3

0.262412 Path: UPS.PowerSummary.Rechargeable, Type: Feature,
ReportID: 0x05, Offset: 0, Size: 8, Value: 1

0.262519 Path: UPS.PowerSummary.CapacityMode, Type: Feature,
ReportID: 0x06, Offset: 0, Size: 8, Value: 2

0.262607 Path: UPS.PowerSummary.DesignCapacity, Type: Feature,
ReportID: 0x07, Offset: 0, Size: 8, Value: 100

0.262618 Path: UPS.PowerSummary.CapacityGranularity1, Type:
Feature, ReportID: 0x07, Offset: 8, Size: 8, Value: 5

0.262627 Path: UPS.PowerSummary.CapacityGranularity2, Type:
Feature, ReportID: 0x07, Offset: 16, Size: 8, Value: 10

0.262637 Path: UPS.PowerSummary.WarningCapacityLimit, Type:
Feature, ReportID: 0x07, Offset: 24, Size: 8, Value: 20

0.262646 Path: UPS.PowerSummary.RemainingCapacityLimit, Type:
Feature, ReportID: 0x07, Offset: 32, Size: 8, Value: 10

0.262655 Path: UPS.PowerSummary.FullChargeCapacity, Type:
Feature, ReportID: 0x07, Offset: 40, Size: 8, Value: 100

0.262740 Path: UPS.PowerSummary.RemainingCapacity, Type: Input,
ReportID: 0x08, Offset: 0, Size: 8, Value: 100

0.262749 Path: UPS.PowerSummary.RemainingCapacity, Type:
Feature, ReportID: 0x08, Offset: 0, Size: 8, Value: 100

0.262759 Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input,
ReportID: 0x08, Offset: 8, Size: 16, Value: 3030

0.262767 Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature,
ReportID: 0x08, Offset: 8, Size: 16, Value: 3030

0.262776 Path: UPS.PowerSummary.RemainingTimeLimit, Type:
Input, ReportID: 0x08, Offset: 24, Size: 16, Value: 300

0.262784 Path: UPS.PowerSummary.RemainingTimeLimit, Type:
Feature, ReportID: 0x08, Offset: 24, Size: 16, Value: 300

0.262865 Path: UPS.PowerSummary.ConfigVoltage, Type: Feature,
ReportID: 0x09, Offset: 0, Size: 8, Value: 24

0.262966 Path: UPS.PowerSummary.Voltage, Type: Feature,
ReportID: 0x0a, Offset: 0, Size: 8, Value: 24

0.263050 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type:
Input, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1

0.263059 Path: UPS.PowerSummary.PresentStatus.Charging, Type:
Input, ReportID: 0x0b, Offset: 1, Size: 1, Value: 0

0.263067 Path: UPS.PowerSummary.PresentStatus.Discharging,
Type: Input, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0

0.263075 Path:
UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type:
Input, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0

0.263082 Path: UPS.PowerSummary.PresentStatus.FullyCharged,
Type: Input, ReportID: 0x0b, Offset: 4, Size: 1, Value: 1

0.263090 Path:
UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Input,
ReportID: 0x0b, Offset: 5, Size: 1, Value: 0

0.263098 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type:
Feature, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1

0.263105 Path: UPS.PowerSummary.PresentStatus.Charging, Type:
Feature, ReportID: 0x0b, Offset: 1, Size: 1, Value: 0

0.263113 Path: UPS.PowerSummary.PresentStatus.Discharging,
Type: Feature, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0

0.263121 Path:
UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type:
Feature, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0

0.263129 Path: UPS.PowerSummary.PresentStatus.FullyCharged,
Type: Feature, ReportID: 0x0b, Offset: 4, Size: 1, Value: 1

0.263137 Path:
UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type:
Feature, ReportID: 0x0b, Offset: 5, Size: 1, Value: 0

0.263218 Path: UPS.PowerSummary.AudibleAlarmControl, Type:
Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 2

0.263227 Path: UPS.PowerSummary.AudibleAlarmControl, Type:
Input, ReportID: 0x0c, Offset: 0, Size: 8, Value: 2

0.263307 Path: UPS.PowerSummary.iManufacturer, Type: Feature,
ReportID: 0x0d, Offset: 0, Size: 8, Value: 3

0.263390 Path: UPS.Input.ConfigVoltage, Type: Feature,
ReportID: 0x0e, Offset: 0, Size: 8, Value: 120

0.263488 Path: UPS.Input.Voltage, Type: Feature, ReportID:
0x0f, Offset: 0, Size: 16, Value: 119

0.263575 Path: UPS.Input.LowVoltageTransfer, Type: Feature,
ReportID: 0x10, Offset: 0, Size: 16, Value: 88

0.263585 Path: UPS.Input.LowVoltageTransfer, Type: Input,
ReportID: 0x10, Offset: 0, Size: 16, Value: 88

0.263593 Path: UPS.Input.HighVoltageTransfer, Type: Feature,
ReportID: 0x10, Offset: 16, Size: 16, Value: 139

0.263601 Path: UPS.Input.HighVoltageTransfer, Type: Input,
ReportID: 0x10, Offset: 16, Size: 16, Value: 139

0.263718 Path: UPS.Output.Voltage, Type: Feature, ReportID:
0x12, Offset: 0, Size: 16, Value: 136

0.263824 Path: UPS.Output.PercentLoad, Type: Feature, ReportID:
0x13, Offset: 0, Size: 8, Value: 16

0.263906 Path: UPS.Output.Test, Type: Feature, ReportID: 0x14,
Offset: 0, Size: 8, Value: 6

0.263914 Path: UPS.Output.Test, Type: Input, ReportID: 0x14,
Offset: 0, Size: 8, Value: 6

0.263996 Path: UPS.Output.DelayBeforeShutdown, Type: Feature,
ReportID: 0x15, Offset: 0, Size: 16, Value: -60

0.264105 Path: UPS.Output.DelayBeforeStartup, Type: Feature,
ReportID: 0x16, Offset: 0, Size: 16, Value: -60

0.264214 Path: UPS.Output.Boost, Type: Feature, ReportID: 0x17,
Offset: 0, Size: 1, Value: 0

0.264223 Path: UPS.Output.Overload, Type: Feature, ReportID:
0x17, Offset: 1, Size: 1, Value: 0

0.264306 Path: UPS.Output.ConfigActivePower, Type: Feature,
ReportID: 0x18, Offset: 0, Size: 16, Value: 900

0.264388 Path: UPS.Output.ff010043, Type: Feature, ReportID:
0x1a, Offset: 0, Size: 8, Value: 1

0.264396 Path: UPS.Output.ff010043, Type: Input, ReportID:
0x1a, Offset: 0, Size: 8, Value: 1

0.264417 Report descriptor retrieved (Reportlen = 430)

0.264421 Found HID device

0.264426 Detected a UPS: CP1500PFCLCD/CRCA102*AF1

0.264455 Path: UPS.PowerSummary.iDeviceChemistry, Type:
Feature, ReportID: 0x03, Offset: 0, Size: 8, Value: 4

0.264735 Path: UPS.PowerSummary.iOEMInformation, Type: Feature,
ReportID: 0x04, Offset: 0, Size: 8, Value: 3

0.264960 Path: UPS.PowerSummary.WarningCapacityLimit, Type:
Feature, ReportID: 0x07, Offset: 24, Size: 8, Value: 20

0.264973 Path: UPS.PowerSummary.RemainingCapacityLimit, Type:
Feature, ReportID: 0x07, Offset: 32, Size: 8, Value: 10

0.264988 Path: UPS.PowerSummary.RemainingCapacity, Type:
Feature, ReportID: 0x08, Offset: 0, Size: 8, Value: 100

0.265001 Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature,
ReportID: 0x08, Offset: 8, Size: 16, Value: 3030

0.265013 Path: UPS.PowerSummary.RemainingTimeLimit, Type:
Feature, ReportID: 0x08, Offset: 24, Size: 16, Value: 300

0.265025 Path: UPS.PowerSummary.ConfigVoltage, Type: Feature,
ReportID: 0x09, Offset: 0, Size: 8, Value: 24

0.265035 Path: UPS.PowerSummary.Voltage, Type: Feature,
ReportID: 0x0a, Offset: 0, Size: 8, Value: 24

0.265049 Path: UPS.Output.PercentLoad, Type: Feature, ReportID:
0x13, Offset: 0, Size: 8, Value: 16

0.265059 Path: UPS.PowerSummary.AudibleAlarmControl, Type:
Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 2

0.265071 Path: UPS.Output.Test, Type: Feature, ReportID: 0x14,
Offset: 0, Size: 8, Value: 6

0.265082 Path: UPS.Output.ConfigActivePower, Type: Feature,
ReportID: 0x18, Offset: 0, Size: 16, Value: 900

0.265104 Path: UPS.Output.DelayBeforeStartup, Type: Feature,
ReportID: 0x16, Offset: 0, Size: 16, Value: -60

0.265116 Path: UPS.Output.DelayBeforeShutdown, Type: Feature,
ReportID: 0x15, Offset: 0, Size: 16, Value: -60

0.265130 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type:
Feature, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1

0.265141 Path: UPS.PowerSummary.PresentStatus.Charging, Type:
Feature, ReportID: 0x0b, Offset: 1, Size: 1, Value: 0

0.265151 Path: UPS.PowerSummary.PresentStatus.Discharging,
Type: Feature, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0

0.265160 Path:
UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type:
Feature, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0

0.265170 Path: UPS.PowerSummary.PresentStatus.FullyCharged,
Type: Feature, ReportID: 0x0b, Offset: 4, Size: 1, Value: 1

0.265179 Path:
UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type:
Feature, ReportID: 0x0b, Offset: 5, Size: 1, Value: 0

0.265189 Path: UPS.Output.Boost, Type: Feature, ReportID: 0x17,
Offset: 0, Size: 1, Value: 0

0.265199 Path: UPS.Output.Overload, Type: Feature, ReportID:
0x17, Offset: 1, Size: 1, Value: 0

0.265208 Path: UPS.Input.ConfigVoltage, Type: Feature,
ReportID: 0x0e, Offset: 0, Size: 8, Value: 120

0.265219 Path: UPS.Input.Voltage, Type: Feature, ReportID:
0x0f, Offset: 0, Size: 16, Value: 119

0.265231 Path: UPS.Input.LowVoltageTransfer, Type: Feature,
ReportID: 0x10, Offset: 0, Size: 16, Value: 88

0.265243 Path: UPS.Input.HighVoltageTransfer, Type: Feature,
ReportID: 0x10, Offset: 16, Size: 16, Value: 139

0.265256 Path: UPS.Output.Voltage, Type: Feature, ReportID:
0x12, Offset: 0, Size: 16, Value: 136

0.265270 Path: UPS.Output.Test, Type: Feature, ReportID: 0x14,
Offset: 0, Size: 8, Value: 6

0.265280 Path: UPS.Output.Test, Type: Feature, ReportID: 0x14,
Offset: 0, Size: 8, Value: 6

0.265290 Path: UPS.Output.Test, Type: Feature, ReportID: 0x14,
Offset: 0, Size: 8, Value: 6

0.265300 Path: UPS.Output.DelayBeforeShutdown, Type: Feature,
ReportID: 0x15, Offset: 0, Size: 16, Value: -60

0.265310 Path: UPS.Output.DelayBeforeStartup, Type: Feature,
ReportID: 0x16, Offset: 0, Size: 16, Value: -60

0.265321 Path: UPS.Output.DelayBeforeShutdown, Type: Feature,
ReportID: 0x15, Offset: 0, Size: 16, Value: -60

0.265334 Path: UPS.PowerSummary.AudibleAlarmControl, Type:
Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 2

0.265344 Path: UPS.PowerSummary.AudibleAlarmControl, Type:
Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 2

0.265353 Path: UPS.PowerSummary.AudibleAlarmControl, Type:
Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 2

0.265363 Path: UPS.PowerSummary.AudibleAlarmControl, Type:
Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 2

0.265373 Path: UPS.PowerSummary.AudibleAlarmControl, Type:
Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 2

0.265391 upsdrv_initinfo...

0.265399 upsdrv_updateinfo...

0.515466 libusb_get_interrupt: Connection timed out

0.515484 Got 0 HID objects...

0.515490 Quick update...

0.515500 Path: UPS.Output.DelayBeforeStartup, Type: Feature,
ReportID: 0x16, Offset: 0, Size: 16, Value: -60

0.515509 Path: UPS.Output.DelayBeforeShutdown, Type: Feature,
ReportID: 0x15, Offset: 0, Size: 16, Value: -60

0.515517 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type:
Feature, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1

0.515524 Path: UPS.PowerSummary.PresentStatus.Charging, Type:
Feature, ReportID: 0x0b, Offset: 1, Size: 1, Value: 0

0.515530 Path: UPS.PowerSummary.PresentStatus.Discharging,
Type: Feature, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0

0.515536 Path:
UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type:
Feature, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0

0.515620 dstate_init: sock /var/state/ups/usbhid-ups-CyberPower
open on fd 8

0.515633 upsdrv_updateinfo...

0.765694 libusb_get_interrupt: Connection timed out

0.765712 Got 0 HID objects...

0.765718 Quick update...

0.765727 Path: UPS.Output.DelayBeforeStartup, Type: Feature,
ReportID: 0x16, Offset: 0, Size: 16, Value: -60

0.765736 Path: UPS.Output.DelayBeforeShutdown, Type: Feature,
ReportID: 0x15, Offset: 0, Size: 16, Value: -60

0.765744 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type:
Feature, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1

0.765750 Path: UPS.PowerSummary.PresentStatus.Charging, Type:
Feature, ReportID: 0x0b, Offset: 1, Size: 1, Value: 0

0.765757 Path: UPS.PowerSummary.PresentStatus.Discharging,
Type: Feature, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0

0.765763 Path:
UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type:
Feature, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0

2.516475 upsdrv_updateinfo...

2.517702 Got 6 HID objects...

2.517722 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type:
Input, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1

2.517733 Path: UPS.PowerSummary.PresentStatus.Charging, Type:
Input, ReportID: 0x0b, Offset: 1, Size: 1, Value: 0

2.517742 Path: UPS.PowerSummary.PresentStatus.Discharging,
Type: Input, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0

2.517751 Path:
UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type:
Input, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0

2.517760 Path: UPS.PowerSummary.PresentStatus.FullyCharged,
Type: Input, ReportID: 0x0b, Offset: 4, Size: 1, Value: 1

2.517769 Path:
UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired, Type: Input,
ReportID: 0x0b, Offset: 5, Size: 1, Value: 0

2.517777 Quick update...

2.517896 Path: UPS.Output.DelayBeforeStartup, Type: Feature,
ReportID: 0x16, Offset: 0, Size: 16, Value: -60

2.518007 Path: UPS.Output.DelayBeforeShutdown, Type: Feature,
ReportID: 0x15, Offset: 0, Size: 16, Value: -60

2.518016 Path: UPS.PowerSummary.PresentStatus.ACPresent, Type:
Feature, ReportID: 0x0b, Offset: 0, Size: 1, Value: 1

2.518023 Path: UPS.PowerSummary.PresentStatus.Charging, Type:
Feature, ReportID: 0x0b, Offset: 1, Size: 1, Value: 0

2.518029 Path: UPS.PowerSummary.PresentStatus.Discharging,
Type: Feature, ReportID: 0x0b, Offset: 2, Size: 1, Value: 0

2.518035 Path:
UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type:
Feature, ReportID: 0x0b, Offset: 3, Size: 1, Value: 0

4.518470 upsdrv_updateinfo...

4.518515 libusb_get_interrupt: Input/output error

4.518521 Got 0 HID objects...

4.518526 Quick update...

4.518538 libusb_get_report: Input/output error

4.518549 Can't retrieve Report 16: Input/output error

6.520478 upsdrv_updateinfo...

6.520513 Got to reconnect!
Bill S
2014-03-26 12:46:15 UTC
Permalink
First I have to apologize for what I think will be the start of a new
thread when I send this, but I did not receive a copy of my original
posting that I can reply to and I do not see a way of adding to the
thread without that copy. If I am wrong, please advise how I should
have posted and it won't happen again.

I suspect there has been no response to my posting of March 24, 2014
because there can be no solution without an updated usbhid-ups but if
someone could confirm that it would be appreciated. I would also like
to know if that is the case if usbhid-ups is ever updated to cover
units that are not presently covered or if this is it and I need to
find another solution for remote monitoring.

.
Charles Lepple
2014-03-26 13:36:49 UTC
Permalink
Post by Bill S
First I have to apologize for what I think will be the start of a new
thread when I send this, but I did not receive a copy of my original
posting that I can reply to and I do not see a way of adding to the
thread without that copy.
There's a setting in the mailing list preferences (see URL below) which defaults to not sending you an extra copy. Another option is to CC yourself on the initial post, or reply to your original message. Gmane also has a "reply-by-web" option that uses email confirmation to limit spam:

http://news.gmane.org/gmane.comp.monitoring.nut.user (Action -> Followup)
Post by Bill S
If I am wrong, please advise how I should
have posted and it won't happen again.
I suspect there has been no response to my posting of March 24, 2014
because there can be no solution without an updated usbhid-ups but if
someone could confirm that it would be appreciated. I would also like
to know if that is the case if usbhid-ups is ever updated to cover
units that are not presently covered or if this is it and I need to
find another solution for remote monitoring.
It is updated, but we prefer to limit the updates to only the affected models. I was hoping we'd get a reply or two from other CyberPower users.
Post by Bill S
_______________________________________________
Nut-upsuser mailing list
Nut-upsuser at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
--
Charles Lepple
clepple at gmail
Charles Lepple
2014-03-26 13:22:11 UTC
Permalink
Post by Bill S
The output of the driver is below. The incorrect voltage of 136 is
shown at 0.265256. It should match input voltage of 119 as shown at
0.265219 but it doesn't. The voltages displayed on the UPS LCD panel
information however are equal and match the input voltage provided by
the driver. There might be other incorrect values in the usbhid-ups
output but that is the one that has caught my attention so far.
Unfortunately, there aren't many driver failure modes which would easily explain this value. Typical UPS firmware issues include using the wrong HID Usage code (the "Path:" in the debug output) or using the wrong combination of units and exponent so that the values are off by some power of ten.

We might get a little more insight with a higher debug level (please save the output to a file, and send it to the list as a gzip'd attachment), but that seems to be what the UPS is reporting for that value.

Another possibility is that when the UPS is in a passthrough mode, the driver should just copy the input voltage to the output voltage, and ignore the reported output voltage. I don't think this is how the USB HID PDC standard was intended to work, but it would probably make for a simpler implementation in the UPS. You would need to do a bit of testing to determine if, for instance, the ACPresent bit could be used for this purpose, or if it needs to be combined with other bits. (The UPS.Output.ff010043 path is non-standard, so maybe this would tell us something about this case, too.)

It might be helpful to test with a variac, and ramp the voltage up and down to see which bits change as the UPS goes from battery to boost to passthrough.
--
Charles Lepple
clepple at gmail
Bill S
2014-03-26 18:15:54 UTC
Permalink
I have attached two .gz files of the driver output with the -DDDD
option. One is for when the unit is on the line AC and the the other
is when it is on battery so that there are at least two points of
reference.

In earlier tests, I did note that when the unit was placed on battery
that the upsstats.cgi screen reported that the input voltage from 119V
to 120V and did not go to zero as I expected it would. I also noted
that the output voltage remained at 136V.

I do have a old General Radio variac kicking around with no line cord
or sockets that I can cobble something together with if these files do not
provide enough data.
Post by Charles Lepple
Post by Bill S
The output of the driver is below. The incorrect voltage of 136 is
shown at 0.265256. It should match input voltage of 119 as shown at
0.265219 but it doesn't. The voltages displayed on the UPS LCD panel
information however are equal and match the input voltage provided by
the driver. There might be other incorrect values in the usbhid-ups
output but that is the one that has caught my attention so far.
Unfortunately, there aren't many driver failure modes which would easily explain this value. Typical UPS firmware issues include using the wrong HID Usage code (the "Path:" in the debug output) or using the wrong combination of units and exponent so that the values are off by some power of ten.
We might get a little more insight with a higher debug level (please save the output to a file, and send it to the list as a gzip'd attachment), but that seems to be what the UPS is reporting for that value.
Another possibility is that when the UPS is in a passthrough mode, the driver should just copy the input voltage to the output voltage, and ignore the reported output voltage. I don't think this is how the USB HID PDC standard was intended to work, but it would probably make for a simpler implementation in the UPS. You would need to do a bit of testing to determine if, for instance, the ACPresent bit could be used for this purpose, or if it needs to be combined with other bits. (The UPS.Output.ff010043 path is non-standard, so maybe this would tell us something about this case, too.)
It might be helpful to test with a variac, and ramp the voltage up and down to see which bits change as the UPS goes from battery to boost to passthrough.
--
Charles Lepple
clepple at gmail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CP1500PFCLCD.ac.txt.gz
Type: application/x-gzip
Size: 2501 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20140326/2ce8433d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CP1500PFCLCD.bat.txt.gz
Type: application/x-gzip
Size: 2452 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20140326/2ce8433d/attachment-0001.bin>
Charles Lepple
2014-03-28 02:40:20 UTC
Permalink
Post by Bill S
I have attached two .gz files of the driver output with the -DDDD
option. One is for when the unit is on the line AC and the the other
is when it is on battery so that there are at least two points of
reference.
In earlier tests, I did note that when the unit was placed on battery
that the upsstats.cgi screen reported that the input voltage from 119V
to 120V and did not go to zero as I expected it would.
Hmm, I wonder if it just wasn't polling fast enough?

From the AC file:

0.263461 Report[get]: (3 bytes) => 0f 77 00
0.263469 Path: UPS.Input.Voltage, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 16, Value: 119

On battery:

0.082947 Report[get]: (3 bytes) => 0f 00 00
0.082957 Path: UPS.Input.Voltage, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 16, Value: 0
Post by Bill S
I also noted that the output voltage remained at 136V.
This value (136) is suspiciously a Logical Minimum that was set elsewhere in the HID Report Descriptor.

AC:

0.263726 Report[get]: (3 bytes) => 12 77 00
0.263735 Path: UPS.Output.Voltage, Type: Feature, ReportID: 0x12, Offset: 0, Size: 16, Value: 136

Note that 0x77 == 119 decimal.

Battery:

0.083198 Report[get]: (3 bytes) => 12 78 00
0.083207 Path: UPS.Output.Voltage, Type: Feature, ReportID: 0x12, Offset: 0, Size: 16, Value: 136

I will have to consult the NUT code and the HID documentation to see whether the issue is in the HID parser or the UPS HID descriptor.
--
Charles Lepple
clepple at gmail
Bill S
2014-03-28 04:07:27 UTC
Permalink
<<Snip>>
Post by Charles Lepple
Hmm, I wonder if it just wasn't polling fast enough?
0.263461 Report[get]: (3 bytes) => 0f 77 00
0.263469 Path: UPS.Input.Voltage, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 16, Value: 119
0.082947 Report[get]: (3 bytes) => 0f 00 00
0.082957 Path: UPS.Input.Voltage, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 16, Value: 0
Based on what you said, I pulled the plug again looking for a possible
delay and what I found was that I needed to hit "refresh" in the
browser to have it update. Once I did that it read "On Bat" and zero
volts input in red. I was expecting it to update on it is own. My
mistake. The output was still "136V"

<<Snip>>
Bill S
2014-03-28 05:52:09 UTC
Permalink
I just noticed what I think is another incorrectly reported value. I
found that on the second screen of upsstats.cgi, the one with bar
graphs, that the reported battery voltage is 16.0V even though the
battery charge is at 100% and the UPS is on AC power. I would have
thought it should be more than 25V.
Charles Lepple
2014-03-28 12:12:30 UTC
Permalink
Post by Bill S
I just noticed what I think is another incorrectly reported value. I
found that on the second screen of upsstats.cgi, the one with bar
graphs, that the reported battery voltage is 16.0V even though the
battery charge is at 100% and the UPS is on AC power. I would have
thought it should be more than 25V.
I'll be honest, I haven't really done much with the CGI scripts lately. For debugging values, it is probably better to be closer to the driver. I'd recommend using "upsc" or the driver logs.

To that end, the .ac.txt and .bat.txt files both show 24.0 V:

0.081935 Entering libusb_get_report
0.082018 Report[get]: (2 bytes) => 09 f0
0.082029 Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x09, Offset: 0, Size: 8, Value: 24
0.082035 Entering libusb_get_report
0.082115 Report[get]: (2 bytes) => 0a f0
0.082124 Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x0a, Offset: 0, Size: 8, Value: 24

To your other point about refreshing the CGI display, you could try adding a tag to reload the page at a specific interval. I'm not sure if that forces the images to be reloaded, or if the images need a "no-cache" header in their HTTP headers.

I tend to use collectd to monitor NUT statistics over time:

https://collectd.org/wiki/index.php/Plugin:NUT
--
Charles Lepple
clepple at gmail
Bill S
2014-03-28 13:08:10 UTC
Permalink
On Fri, Mar 28, 2014 at 8:12 AM, Charles Lepple <clepple at gmail.com> wrote:

<<Snip>>
Post by Charles Lepple
I'll be honest, I haven't really done much with the CGI scripts lately. For debugging values, it is probably better to be closer to the driver. I'd recommend using "upsc" or the driver logs.
0.081935 Entering libusb_get_report
0.082018 Report[get]: (2 bytes) => 09 f0
0.082029 Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x09, Offset: 0, Size: 8, Value: 24
0.082035 Entering libusb_get_report
0.082115 Report[get]: (2 bytes) => 0a f0
0.082124 Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x0a, Offset: 0, Size: 8, Value: 24
I know there are two 12V batteries in series that provide 24V which is
what is being shown, but an actual 24V for new fully charged batteries
seems low to me. Between that and the fact that there are no tenths
of a volt shown and the battery is shown as 24.0 both on AC and on
battery makes me think we are not seeing the actual battery battery
voltage but some nominal or default value. I do not think the battery
voltage is actually being tracked. ???
Post by Charles Lepple
To your other point about refreshing the CGI display, you could try adding a tag to reload the page at a specific interval. I'm not sure if that forces the images to be reloaded, or if the images need a "no-cache" header in their HTTP headers.
https://collectd.org/wiki/index.php/Plugin:NUT
I will take a look at that. Thanks
Post by Charles Lepple
--
Charles Lepple
clepple at gmail
_______________________________________________
Nut-upsuser mailing list
Nut-upsuser at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Charles Lepple
2014-03-28 13:39:33 UTC
Permalink
Post by Bill S
<<Snip>>
Post by Charles Lepple
I'll be honest, I haven't really done much with the CGI scripts lately. For debugging values, it is probably better to be closer to the driver. I'd recommend using "upsc" or the driver logs.
0.081935 Entering libusb_get_report
0.082018 Report[get]: (2 bytes) => 09 f0
0.082029 Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x09, Offset: 0, Size: 8, Value: 24
0.082035 Entering libusb_get_report
0.082115 Report[get]: (2 bytes) => 0a f0
0.082124 Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x0a, Offset: 0, Size: 8, Value: 24
I know there are two 12V batteries in series that provide 24V which is
what is being shown, but an actual 24V for new fully charged batteries
seems low to me. Between that and the fact that there are no tenths
of a volt shown and the battery is shown as 24.0 both on AC and on
battery makes me think we are not seeing the actual battery battery
voltage but some nominal or default value. I do not think the battery
voltage is actually being tracked. ???
"24.0" is slightly optimistic on my part ;-) but the value "f0" is hex for 240, so the UPS is capable of reporting increments of 0.1V. We used to print the floating point values with "%.6f" or similar, which is IMHO slightly more misleading since nobody is measuring with microvolt resolution. That's been on my list to fix for some time now.

ConfigVoltage (battery.voltage.nominal) is often an even multiple of 12V, but you're right, the actual voltage should be higher for fully-charged batteries. That voltage may be hiding somewhere else in the report.

If there is a battery test command, that (plus the -DDD logs) would be a good way to find where the actual battery voltage is hiding.
--
Charles Lepple
clepple at gmail
Bill S
2014-03-29 04:03:16 UTC
Permalink
On Fri, Mar 28, 2014 at 9:39 AM, Charles Lepple <clepple at gmail.com> wrote:

<<Snip>>
Post by Charles Lepple
Post by Bill S
Post by Charles Lepple
I'll be honest, I haven't really done much with the CGI scripts lately. For debugging values, it is probably better to be closer to the driver. I'd recommend using "upsc" or the driver logs.
0.081935 Entering libusb_get_report
0.082018 Report[get]: (2 bytes) => 09 f0
0.082029 Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x09, Offset: 0, Size: 8, Value: 24
0.082035 Entering libusb_get_report
0.082115 Report[get]: (2 bytes) => 0a f0
0.082124 Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x0a, Offset: 0, Size: 8, Value: 24
I know there are two 12V batteries in series that provide 24V which is
what is being shown, but an actual 24V for new fully charged batteries
seems low to me. Between that and the fact that there are no tenths
of a volt shown and the battery is shown as 24.0 both on AC and on
battery makes me think we are not seeing the actual battery battery
voltage but some nominal or default value. I do not think the battery
voltage is actually being tracked. ???
"24.0" is slightly optimistic on my part ;-) but the value "f0" is hex for 240, so the UPS is capable of reporting increments of 0.1V. We used to print the floating point values with "%.6f" or similar, which is IMHO slightly more misleading since nobody is measuring with microvolt resolution. That's been on my list to fix for some time now.
I agree. Three significant figures is the right number. More as you
say would be rather meaningless but only two significant figures
really does not tell you much.
Post by Charles Lepple
ConfigVoltage (battery.voltage.nominal) is often an even multiple of 12V, but you're right, the actual voltage should be higher for fully-charged batteries. That voltage may be hiding somewhere else in the report.
If there is a battery test command, that (plus the -DDD logs) would be a good way to find where the actual battery voltage is hiding.
In effort to find the actual battery voltage I ran
/usr/local/ups/bin/upsc from the command line (results attached) and
it also reports a battery of voltage of 16.0. I also tried unloading
NUT and running CyberPower's latest PowerPanel Linux software but the
only thing I could see to do with that software is run "pwrstat -test"
and "pwrstat -status" and neither one resulted in any output of
battery voltage. If there is something else I should be doing along
those lines that I missed, please let me know.

I guess if there is any good news it is that it appears that the
problem is not with the CGI scripts for both the output AC voltage and
battery voltage.

I also noted that when running the PowerPanel software that the
reported output AC voltage matched the input AC voltage and that the
input AC voltage went to zero when on battery. I would take that to
mean that the UPS has those values available somewhere and so perhaps
it has the right battery voltage as well if they can be accessed.
Post by Charles Lepple
--
Charles Lepple
clepple at gmail
_______________________________________________
Nut-upsuser mailing list
Nut-upsuser at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
-------------- next part --------------
A non-text attachment was scrubbed...
Name: upsc_out.txt.gz
Type: application/x-gzip
Size: 454 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20140329/0478a98d/attachment.bin>
Bill S
2014-04-01 05:03:01 UTC
Permalink
I asked CyberPower why their PowerPanel software did not show battery
voltage and the response was that battery voltage is not supported in
this model. They were surprised that NUT reported 16.0 or any value
at all. It makes you wonder where the 16.0 comes from.

In any case it appears that the only current problem is the
incorrectly reported AC output voltage.
Bill S
2014-04-04 12:56:59 UTC
Permalink
It would appear that there is nothing that can be done to correct the
output voltage reading. Is there anyone in this group that would have
a suggestion on alternative software for remote monitoring of a UPS
installed on a distant server?
Charles Lepple
2014-04-04 13:49:12 UTC
Permalink
Post by Bill S
It would appear that there is nothing that can be done to correct the
output voltage reading.
Nothing easy, but the AC output voltage is reported by the UPS. It requires more than just a five-minute fix, though.

The DC battery voltage is the one that seems to be hiding somewhere else.

Does the vendor have firmware upgrades for this UPS?
Bill S
2014-04-05 01:52:07 UTC
Permalink
Post by Charles Lepple
Post by Bill S
It would appear that there is nothing that can be done to correct the
output voltage reading.
Nothing easy, but the AC output voltage is reported by the UPS. It requires more than just a five-minute fix, though.
The DC battery voltage is the one that seems to be hiding somewhere else.
Does the vendor have firmware upgrades for this UPS?
As I mentioned in my April 1 post, CyberPower indicated to me in an
email when I contacted them that battery voltage is not supported.in
this model of UPS. I am rather disappointed in that but there is not
much we can do about it.

I looked around the site for firmware upgrades and found none. There
are also no instructions in the manual on accomplishing a firmware
upgrade.

Just for grins I looked for firmware upgrades for a couple of other
models in a different series of UPS units and found no firmware
upgrades for any of those as well. It would appear that they either
do not believe in firmware upgrades or I am looking in the wrong spot.
I suspect the former as there is nothing in the sales literature as
well and normally when it is possible for a piece of equipment to
accept firmware upgrades, the manufacturer lists it as a feature.

As an aside, is it possible that using the RS-232 port would produce
different results? I would think both drivers would expect the data
to be in the same format so the results would be the same as well but
thought I would ask to be sure.
Charles Lepple
2014-04-05 02:14:23 UTC
Permalink
Post by Bill S
As an aside, is it possible that using the RS-232 port would produce
different results? I would think both drivers would expect the data
to be in the same format so the results would be the same as well but
thought I would ask to be sure.
That's an interesting point. The "powerpanel" driver is marked as experimental, but it doesn't bear any relationship to the HID PDC code. Worth a try.

Note that some UPSes don't like switching between USB and serial without power-cycling. If you don't get any results from the serial driver, you may need to completely power down the UPS, and pull it from the wall long enough to let some of the power supply capacitors drain.
--
Charles Lepple
clepple at gmail
Bill S
2014-04-13 14:33:28 UTC
Permalink
Post by Charles Lepple
Post by Bill S
As an aside, is it possible that using the RS-232 port would produce
different results? I would think both drivers would expect the data
to be in the same format so the results would be the same as well but
thought I would ask to be sure.
That's an interesting point. The "powerpanel" driver is marked as experimental, but it doesn't bear any relationship to the HID PDC code. Worth a try.
Note that some UPSes don't like switching between USB and serial without power-cycling. If you don't get any results from the serial driver, you may need to completely power down the UPS, and pull it from the wall long enough to let some of the power supply capacitors drain.
--
Charles Lepple
clepple at gmail
Good thought but after trying different cable configurations with a
breakout box without even a hint of success I emailed CyberPower and
asked for a pinout of the serial cable. After looking at what they
sent me it was obvious that the serial port despite what you might
expect is not really meant for communication at all. All it does set
a few pins high or low to signal low battery and power out. Pins 2
and 3 are not even used. A complete waste of time. At this point I
don't think I would recommend CyberPower units for any server
application Their serial communication is serial with no
communication and the provided USB software does not have a web
interface for remote monitoring. They say the CP1500 is for low mid
to size server use but it really isn't. It is just for the home
market where it sits next to a Windows PC in the same location as the
user.

Unless someone has another suggestion, my only hope is that sometime
NUT's usbhid-ups gets updated to work with it. I am certainly willing
to do any beta testing.

Loading...