Skip to content

The parameters "usb_hid_rep_index = 1" and "usb_hid_desc_index = 1" are incorrectly handled if the driver 'usbhid-ups' does not start in debug mode. #3340

Open

Description

@philipperollin

Hello Gentlemen
I'm not a programmer, but I know how to compile Linux software. I own a Vertiv Edge 3kVA UPS that I'm trying to use with NUT UPS 2.8.4. After numerous attempts and searches, I've come to the following conclusion: if the parameter "debug_min = 1" is not set, the parameters "usb_hid_rep_index = 1" and "usb_hid_desc_index = 1" are ignored, and the reported data is incorrect.

Below is a file with the essential configuration and results.

#ups.conf
[ups]
driver = "usbhid-ups"
port = "auto"
vendorid = "10AF"
productid = "0002"
product = "Vertiv Edge"
serial = "2014010030ED18C"
vendor = "Vertiv Co."
usb_hid_rep_index = 1
usb_hid_desc_index = 1
pollonly = 1
debug_min = 1
#Bad data without debug_min
battery.charge: 100
battery.charge.warning: 20
battery.runtime: 6480
battery.type: PbAc
device.mfr: Vertiv Co.
device.model: Vertiv Edge
device.serial: 2014010030ED18C
device.type: ups
driver.debug: 0
driver.flag.allow_killpower: 0
driver.name: usbhid-ups
driver.parameter.interrupt_pipe_no_events_tolerance: -1
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.pollonly: 1
driver.parameter.port: auto
driver.parameter.product: Vertiv Edge
driver.parameter.productid: 0002
driver.parameter.serial: 2014010030ED18C
driver.parameter.synchronous: auto
driver.parameter.usb_hid_desc_index: 1
driver.parameter.usb_hid_rep_index: 1
driver.parameter.vendor: Vertiv Co.
driver.parameter.vendorid: 10AF
driver.state: quiet
driver.version: 2.8.4
driver.version.data: Belkin/Liebert HID 0.22
driver.version.internal: 0.67
driver.version.usb: libusb-1.0.26 (API: 0x01000109)
input.frequency: 50.0
input.voltage: 231.5
input.voltage.nominal: 230
output.frequency: 50.0
output.voltage: 231.6
output.voltage.nominal: 230
ups.mfr: Vertiv Co.
ups.model: Vertiv Edge
ups.productid: 0002
ups.serial: 2014010030ED18C
ups.status: OB
ups.vendorid: 10af
#Good data with debug_min (almost good execpt few fields)
battery.capacity: 3000
battery.charge: 100
battery.charge.warning: 20
battery.runtime: 6420
battery.type: 
battery.voltage: 82.0
battery.voltage.nominal: 72
device.mfr: Vertiv Co.
device.model: Vertiv Edge
device.serial: 2014010030ED18C
device.type: ups
driver.debug: 6
driver.flag.allow_killpower: 0
driver.name: usbhid-ups
driver.parameter.interrupt_pipe_no_events_tolerance: -1
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.pollonly: 1
driver.parameter.port: auto
driver.parameter.product: Vertiv Edge
driver.parameter.productid: 0002
driver.parameter.serial: 2014010030ED18C
driver.parameter.synchronous: auto
driver.parameter.usb_hid_desc_index: 1
driver.parameter.usb_hid_rep_index: 1
driver.parameter.vendor: Vertiv Co.
driver.parameter.vendorid: 10AF
driver.state: dumping
driver.version: 2.8.4
driver.version.data: Belkin/Liebert HID 0.22
driver.version.internal: 0.67
driver.version.usb: libusb-1.0.26 (API: 0x01000109)
input.frequency: 50.0
input.voltage: 232.2
input.voltage.nominal: 230
output.frequency: 50.0
output.voltage: 232.3
output.voltage.nominal: 230
ups.mfr: Vertiv Co.
ups.model: Vertiv Edge
ups.productid: 0002
ups.serial: 2014010030ED18C
ups.status: OL CHRG
ups.vendorid: 10af

I hope it will be useful
Best regards

Activity

  1. added
    USB non-zero interface numbersMost UPSes serve USB interactions on interface 0 which is default. Recent "composite devices" differ
    impacts-release-2.8.4Issues reported against NUT release 2.8.4 (maybe vanilla or with minor packaging tweaks)
    on Mar 5, 2026
  2. jimklimov commented on Mar 5, 2026

    @jimklimov
    Member

    Thanks, this sounds suspiciously similar to #3247 / #3116 ...

    Comparing your two outputs, the "bad" version includes battery.type: PbAc while it is empty in the "good" version. I wouldn't rule out however, that "PbAc" is in fact a default value setting (like ups.status: OB until recently), and maybe in the "good" case the driver did read something from the device even if it could not interpret that.

    Previously there were bugs like upsdebugx(1, "Some flag: %d", counter++) where the counter++ part never got evaluated when debugging is off. I think those cases were all found at the time, but can't help but wonder if anything similar happens here.

  3. jimklimov commented on Mar 5, 2026

    @jimklimov
    Member

    Also, since you get some apparently non-default data (like specific voltage numbers) in both cases, I can't confirm that

    parameters "usb_hid_rep_index = 1" and "usb_hid_desc_index = 1" are ignored

    If they were ignored, I think the driver would not have received the report descriptors with UPS HID data points.

  4. added a commit that references this issue on Mar 9, 2026
    4c8bdc3
  5. jimklimov commented on Mar 10, 2026

    @jimklimov
    Member

    Looking at investigation for PR #3345, got also a new question: did you verify that BOTH "usb_hid_rep_index=1" and "usb_hid_desc_index=1" settings are needed?

    @philipperollin : Comparing to that PR, would having just "usb_hid_rep_index=1" suffice to get some reasonable readings from the UPS?

  6. philipperollin commented on Mar 11, 2026

    @philipperollin
    Author

    Dear Jim,
    First, I started from scratch, going back to basics.
    My various research efforts had confused my understanding of exactly what I had done.

    My OS is:

    PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
    NAME="Debian GNU/Linux"
    VERSION_ID="12"
    VERSION="12 (bookworm)"
    VERSION_CODENAME=bookworm
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"
    

    I'm now using the tar archive "nut-2.8.4.tar.gz" instead of "git https://github.com/networkupstools/nut/" because the latter doesn't work at all.

    Here's the ups.conf file that gives me the best results. I'm removing "pollonly" because it doesn't detect mains voltage loss.

    [ups]
    driver = "usbhid-ups"
    port = "auto"
    vendorid = "10AF"
    productid = "0002"
    product = "Vertiv Edge"
    serial = "2014010030ED18C"
    vendor = "Vertiv Co."
    #      product = "Liebert PSI5"
    #      vendor = "Vertiv Co."
    #      ### These are the most important parameters
    #      ### Otherwise the UPS reports OB and no Battery %
    usb_hid_rep_index = 1
    usb_hid_desc_index = 1
    usb_hid_ep_in=2
    #pollonly = 1
    #debug_min = 1
    
    phil@debian:~$ upsc ups
    Init SSL without certificate database
    battery.charge: 100
    battery.charge.warning: 20
    battery.runtime: 17700
    battery.type: PbAc
    device.mfr: Vertiv Co.
    device.model: Vertiv Edge
    device.serial: 2014010030ED18C
    device.type: ups
    driver.debug: 0
    driver.flag.allow_killpower: 0
    driver.name: usbhid-ups
    driver.parameter.interrupt_pipe_no_events_tolerance: -1
    driver.parameter.pollfreq: 30
    driver.parameter.pollinterval: 2
    driver.parameter.port: auto
    driver.parameter.product: Vertiv Edge
    driver.parameter.productid: 0002
    driver.parameter.serial: 2014010030ED18C
    driver.parameter.synchronous: auto
    driver.parameter.usb_hid_desc_index: 1
    driver.parameter.usb_hid_ep_in: 2
    driver.parameter.usb_hid_rep_index: 1
    driver.parameter.vendor: Vertiv Co.
    driver.parameter.vendorid: 10AF
    driver.state: quiet
    driver.version: 2.8.4
    driver.version.data: Belkin/Liebert HID 0.22
    driver.version.internal: 0.67
    driver.version.usb: libusb-1.0.26 (API: 0x01000109)
    input.frequency: 50.0
    input.voltage: 241.3
    input.voltage.nominal: 230
    output.frequency: 50.0
    output.voltage: 241.2
    output.voltage.nominal: 230
    ups.mfr: Vertiv Co.
    ups.model: Vertiv Edge
    ups.productid: 0002
    ups.serial: 2014010030ED18C
    ups.status: OL CHRG
    ups.vendorid: 10af
    

    The three parameters "usb_hid_rep_index = 1, usb_hid_desc_index = 1, usb_hid_ep_in=2" are required together.

    If I set the debug parameter, I also get the field "battery.capacity: 3000" and I lose the value of "battery.type:"

    [ups]
    driver = "usbhid-ups"
    port = "auto"
    vendorid = "10AF"
    productid = "0002"
    product = "Vertiv Edge"
    serial = "2014010030ED18C"
    vendor = "Vertiv Co."
    #      product = "Liebert PSI5"
    #      vendor = "Vertiv Co."
    #      ### These are the most important parameters
    #      ### Otherwise the UPS reports OB and no Battery %
    usb_hid_rep_index = 1
    usb_hid_desc_index = 1
    usb_hid_ep_in=2
    #pollonly = 1
    debug_min = 1
    
    phil@debian:~$ upsc ups
    Init SSL without certificate database
    battery.capacity: 3000
    battery.charge: 100
    battery.charge.warning: 20
    battery.runtime: 17700
    battery.type:
    battery.voltage: 82.8
    battery.voltage.nominal: 72
    device.mfr: Vertiv Co.
    device.model: Vertiv Edge
    device.serial: 2014010030ED18C
    device.type: ups
    driver.debug: 1
    driver.flag.allow_killpower: 0
    driver.name: usbhid-ups
    driver.parameter.interrupt_pipe_no_events_tolerance: -1
    driver.parameter.pollfreq: 30
    driver.parameter.pollinterval: 2
    driver.parameter.port: auto
    driver.parameter.product: Vertiv Edge
    driver.parameter.productid: 0002
    driver.parameter.serial: 2014010030ED18C
    driver.parameter.synchronous: auto
    driver.parameter.usb_hid_desc_index: 1
    driver.parameter.usb_hid_ep_in: 2
    driver.parameter.usb_hid_rep_index: 1
    driver.parameter.vendor: Vertiv Co.
    driver.parameter.vendorid: 10AF
    driver.state: quiet
    driver.version: 2.8.4
    driver.version.data: Belkin/Liebert HID 0.22
    driver.version.internal: 0.67
    driver.version.usb: libusb-1.0.26 (API: 0x01000109)
    input.frequency: 50.0
    input.voltage: 233.8
    input.voltage.nominal: 230
    output.frequency: 50.0
    output.voltage: 234.1
    output.voltage.nominal: 230
    ups.mfr: Vertiv Co.
    ups.model: Vertiv Edge
    ups.productid: 0002
    ups.serial: 2014010030ED18C
    ups.status: OL CHRG
    ups.vendorid: 10af
    

    I plan to work with the traces I've retrieved, namely the Wireshark usbmon dump when Vertiv's native "powerassist" software is used, the Wireshark usbmon dump when NUT is used, and the usbhid-ups traces with debugging enabled. I can share them with you if you'd like.

    My 2cts

  7. jimklimov commented on Mar 11, 2026

    @jimklimov
    Member

    Thanks, the interaction with debug is odd. I hope to have time to drill into it, but maybe not very soon.

    I'm now using the tar archive "nut-2.8.4.tar.gz" instead of "git https://github.com/networkupstools/nut/" because the latter doesn't work at all.

    You meant git clone https://github.com/networkupstools/nut/, or did you really miss the clone part?

  8. philipperollin commented on Mar 11, 2026

    @philipperollin
    Author

    I did not miss the clone part ;-)
    regards

  9. philipperollin commented on Jun 2, 2026

    @philipperollin
    Author

    Hello,
    in order to close this request, here is ups.conf file I use with my Vertiv Edge device EDGE_3000IRT2U without any trouble with at least 2.8.4.

    [ups]
    driver = "usbhid-ups"
    port = "auto"
    vendorid = "10AF"
    productid = "0002"
    product = "Vertiv Edge"
    serial = "2014010030ED18C"
    vendor = "Vertiv Co."
    usb_hid_rep_index = 1
    usb_hid_desc_index = 1
    maxreport

    Best regards

  10. jimklimov commented on Jun 2, 2026

    @jimklimov
    Member

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DDLHCLUSBUSB non-zero interface numbersMost UPSes serve USB interactions on interface 0 which is default. Recent "composite devices" differVertiv/Liebertbugimpacts-release-2.8.4Issues reported against NUT release 2.8.4 (maybe vanilla or with minor packaging tweaks)

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions