networkupstools / nut

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

Salicru Twin Pro 2 #1312

Closed drunkly closed 2 years ago

drunkly commented 2 years ago

Hi

Did someone get this UPS to work?, I have tried the debian package with apt and also installing from binaries but no luck:

I have this UPS installed in a Proxmox machine so I don't know if this is related. Here are some info I gathered:

root@PROXMOX:/usr/local/ups/bin# ./nut-scanner
Scanning USB bus.
No start IP, skipping NUT bus (old connect method)
[nutdev1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "2E66"
        productid = "0201"
        product = "SLC TWIN PRO2<=3KVA"
        serial = "232019D70264"
        vendor = "Salicru"
        bus = "002"
root@PROXMOX:/usr/local/ups/bin# ./usbhid-ups -DD -a salicru -u root
Network UPS Tools - Generic HID driver 0.45 (2.7.4-4698-g381a81fc)
USB communication driver (libusb 0.1) 0.42
   0.000000     [D1] Built-in default or configured user for drivers 'nut' was ignored due to 'root' specified on command line
   0.000017     [D1] debug level is '2'
   0.001716     [D2] Initializing an USB-connected UPS with library libusb-0.1 (or compat) (NUT subdriver name='USB communication driver (libusb 0.1)' ver='0.42')
   0.001732     [D1] upsdrv_initups (non-SHUT)...
   0.139629     [D2] Checking device (8087/8002) (003/002)
   0.207815     [D2] - VendorID: 8087
   0.207844     [D2] - ProductID: 8002
   0.207847     [D2] - Manufacturer: unknown
   0.207850     [D2] - Product: unknown
   0.207856     [D2] - Serial Number: unknown
   0.207887     [D2] - Bus: 003
   0.207894     [D2] - Device: 002
   0.207902     [D2] - Device release number: 0005
   0.207911     [D2] Trying to match device
   0.207919     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.207932     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.207940     [D2] Device does not match - skipping
   0.207963     [D2] Checking device (1D6B/0002) (003/001)
   0.208072     [D2] - VendorID: 1d6b
   0.208084     [D2] - ProductID: 0002
   0.208098     [D2] - Manufacturer: Linux 5.4.162-1-pve ehci_hcd
   0.208105     [D2] - Product: EHCI Host Controller
   0.208113     [D2] - Serial Number: 0000:00:1d.0
   0.208120     [D2] - Bus: 003
   0.208127     [D2] - Device: 001
   0.208135     [D2] - Device release number: 0504
   0.208142     [D2] Trying to match device
   0.208149     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.208159     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.208166     [D2] Device does not match - skipping
   0.208179     [D2] Checking device (1D6B/0003) (004/001)
   0.208372     [D2] - VendorID: 1d6b
   0.208383     [D2] - ProductID: 0003
   0.208388     [D2] - Manufacturer: Linux 5.4.162-1-pve xhci-hcd
   0.208395     [D2] - Product: xHCI Host Controller
   0.208402     [D2] - Serial Number: 0000:00:14.0
   0.208405     [D2] - Bus: 004
   0.208408     [D2] - Device: 001
   0.208413     [D2] - Device release number: 0504
   0.208418     [D2] Trying to match device
   0.208423     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.208432     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.208437     [D2] Device does not match - skipping
   0.208538     [D2] Checking device (2E66/0201) (002/010)
   0.210053     [D2] - VendorID: 2e66
   0.210064     [D2] - ProductID: 0201
   0.210071     [D2] - Manufacturer: Salicru
   0.210078     [D2] - Product: SLC TWIN PRO2<=3KVA
   0.210084     [D2] - Serial Number: 232019D70264
   0.210091     [D2] - Bus: 002
   0.210097     [D2] - Device: 010
   0.210104     [D2] - Device release number: 0129
   0.210110     [D2] Trying to match device
   0.210116     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.210218     [D2] Device matches
   0.210381     [D2] Warning: HID descriptor, method 1 failed
   0.210390     [D2] Warning: HID descriptor, method 2 failed
   0.210396     [D2] Unable to retrieve any HID descriptor
   0.210415     [D2] Checking device (0E6A/02C0) (002/003)
   0.214274     [D2] - VendorID: 0e6a
   0.214289     [D2] - ProductID: 02c0
   0.214294     [D2] - Manufacturer: dakai
   0.214300     [D2] - Product: PS/2+USB Keyboard
   0.214304     [D2] - Serial Number: unknown
   0.214309     [D2] - Bus: 002
   0.214316     [D2] - Device: 003
   0.214321     [D2] - Device release number: 4e01
   0.214325     [D2] Trying to match device
   0.214328     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.214339     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.214346     [D2] Device does not match - skipping
   0.214358     [D2] Checking device (046D/C05A) (002/002)
   0.216372     [D2] - VendorID: 046d
   0.216380     [D2] - ProductID: c05a
   0.216388     [D2] - Manufacturer: Logitech
   0.216394     [D2] - Product: USB Optical Mouse
   0.216399     [D2] - Serial Number: unknown
   0.216406     [D2] - Bus: 002
   0.216413     [D2] - Device: 002
   0.216419     [D2] - Device release number: 6300
   0.216426     [D2] Trying to match device
   0.216437     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.216448     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.216456     [D2] Device does not match - skipping
   0.216468     [D2] Checking device (1D6B/0002) (002/001)
   0.216565     [D2] - VendorID: 1d6b
   0.216575     [D2] - ProductID: 0002
   0.216581     [D2] - Manufacturer: Linux 5.4.162-1-pve xhci-hcd
   0.216586     [D2] - Product: xHCI Host Controller
   0.216590     [D2] - Serial Number: 0000:00:14.0
   0.216595     [D2] - Bus: 002
   0.216600     [D2] - Device: 001
   0.216606     [D2] - Device release number: 0504
   0.216610     [D2] Trying to match device
   0.216618     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.216627     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.216635     [D2] Device does not match - skipping
   0.216648     [D2] Checking device (8087/800A) (001/002)
   0.283444     [D2] - VendorID: 8087
   0.283463     [D2] - ProductID: 800a
   0.283471     [D2] - Manufacturer: unknown
   0.283484     [D2] - Product: unknown
   0.283491     [D2] - Serial Number: unknown
   0.283498     [D2] - Bus: 001
   0.283505     [D2] - Device: 002
   0.283511     [D2] - Device release number: 0005
   0.283519     [D2] Trying to match device
   0.283524     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.283534     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.283540     [D2] Device does not match - skipping
   0.283552     [D2] Checking device (1D6B/0002) (001/001)
   0.283654     [D2] - VendorID: 1d6b
   0.283660     [D2] - ProductID: 0002
   0.283664     [D2] - Manufacturer: Linux 5.4.162-1-pve ehci_hcd
   0.283669     [D2] - Product: EHCI Host Controller
   0.283674     [D2] - Serial Number: 0000:00:1a.0
   0.283682     [D2] - Bus: 001
   0.283689     [D2] - Device: 001
   0.283696     [D2] - Device release number: 0504
   0.283707     [D2] Trying to match device
   0.283715     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.283724     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.283730     [D2] Device does not match - skipping
   0.283737     [D2] libusb0: No appropriate HID device found
   0.283750     No matching HID UPS found
root@PROXMOX:/usr/local/ups/bin# sudo ./upsc salicru@127.0.0.1 -u root
Error: Connection failure: Connection refused
root@PROXMOX:/usr/local/ups/bin#
root@PROXMOX:/usr/local/ups/bin# lsusb -v

.....
Bus 002 Device 010: ID 2e66:0201
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x2e66
  idProduct          0x0201
  bcdDevice            1.29
  iManufacturer           1 Salicru
  iProduct                2 SLC TWIN PRO2<=3KVA
  iSerial                 4 232019D70264
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength    1436
          Report Descriptor: (length is 1436)
            Item(Global): Usage Page, data= [ 0x84 ] 132
                            Power Device Page
            Item(Local ): Usage, data= [ 0x04 ] 4
                            UPS
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Local ): Usage, data= [ 0x10 ] 16
                            Battery System
            Item(Main  ): Collection, data= [ 0x00 ] 0
                            Physical
            Item(Local ): Usage, data= [ 0x12 ] 18
                            Battery
            Item(Main  ): Collection, data= [ 0x00 ] 0
                            Physical
            Item(Local ): Usage, data= [ 0x13 ] 19
                            Battery ID
            Item(Global): Report ID, data= [ 0x20 ] 32
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Unit, data= [ 0x00 ] 0
                            System: None, Unit: (None)
            Item(Global): Unit Exponent, data= [ 0x00 ] 0
                            Unit Exponent: 0
            Item(Main  ): Feature, data= [ 0x03 ] 3
                            Constant Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Global): Usage Page, data= [ 0xff 0xff ] 65535
                            (null)
            Item(Local ): Usage, data= [ 0x90 ] 144
                            (null)
            Item(Global): Report ID, data= [ 0x21 ] 33
            Item(Main  ): Feature, data= [ 0x82 ] 130
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile Bitfield
            Item(Global): Usage Page, data= [ 0x84 ] 132
                            Power Device Page
            Item(Local ): Usage, data= [ 0x02 ] 2
                            Present Status
            Item(Main  ): Collection, data= [ 0x02 ] 2
                            Logical
            Item(Local ): Usage, data= [ 0x60 ] 96
                            Present
            Item(Global): Report ID, data= [ 0x27 ] 39
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Unit, data= [ 0x00 ] 0
                            System: None, Unit: (None)
            Item(Main  ): Feature, data= [ 0x83 ] 131
                            Constant Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile Bitfield
            Item(Local ): Usage, data= [ 0x60 ] 96
            ....
                            Preferred_State No_Null_Position Volatile Bitfield
            Item(Local ): Usage, data= [ 0xf1 ] 241
                            (null)
            Item(Global): Report ID, data= [ 0xf1 ] 241
            Item(Global): Report Count, data= [ 0x04 ] 4
            Item(Main  ): Feature, data= [ 0x82 ] 130
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile Bitfield
            Item(Local ): Usage, data= [ 0xff ] 255
                            (null)
            Item(Global): Report ID, data= [ 0xff ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Unit, data= [ 0x00 ] 0
                            System: None, Unit: (None)
            Item(Global): Unit Exponent, data= [ 0x00 ] 0
                            Unit Exponent: 0
            Item(Main  ): Feature, data= [ 0x82 ] 130
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile Bitfield
            Item(Main  ): End Collection, data=none
            Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval              20
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

.......
root@PROXMOX:/usr/local/ups/bin# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

With debian package it just shows the message: "Driver failed to start". I assume it is due the debian package verison is outdated (2.7.4) so I tried to install from binaries with the otpion "--with-usb".

I guess my main problem is related to the fact that driver can't find HID descriptor but I don't know how to continue from this point.

Can someone provide some tip please?

jimklimov commented 2 years ago

Permissions issues could be about udev or upower setup, to make the devfs node accessible to nut daemon account (driver).

There was a salicru-specific subdriver merged recebtly yo master branch, but there was no NUT release for a while so you'd have to build a custom replacement.

At least for a quick test to see if the new usbhid-ups dtiver recognizes the device, it would suffice to just build the git checkout and run the driver in-place (perhaps with debug and -u root options), without intruding into packaged set-up. If the bew driver works, then fuss about building with same configure script options as in OS packaging, so sudo make install would replace that.

On Tue, Feb 22, 2022, 09:57 drunkly @.***> wrote:

Hi

Did someone get this to work, I have tried the deiban package with apt and also installing from binaries but no luck:

I have this UPS installed in a Proxmox machine so I don't know if this is related. Here are some info I gathered:

@.***:/usr/local/ups/bin# ./nut-scanner Scanning USB bus. No start IP, skipping NUT bus (old connect method) [nutdev1] driver = "usbhid-ups" port = "auto" vendorid = "2E66" productid = "0201" product = "SLC TWIN PRO2<=3KVA" serial = "232019D70264" vendor = "Salicru" bus = "002"

@.***:/usr/local/ups/bin# ./usbhid-ups -DD -a salicru -u root Network UPS Tools - Generic HID driver 0.45 (2.7.4-4698-g381a81fc) USB communication driver (libusb 0.1) 0.42 0.000000 [D1] Built-in default or configured user for drivers 'nut' was ignored due to 'root' specified on command line 0.000017 [D1] debug level is '2' 0.001716 [D2] Initializing an USB-connected UPS with library libusb-0.1 (or compat) (NUT subdriver name='USB communication driver (libusb 0.1)' ver='0.42') 0.001732 [D1] upsdrv_initups (non-SHUT)... 0.139629 [D2] Checking device (8087/8002) (003/002) 0.207815 [D2] - VendorID: 8087 0.207844 [D2] - ProductID: 8002 0.207847 [D2] - Manufacturer: unknown 0.207850 [D2] - Product: unknown 0.207856 [D2] - Serial Number: unknown 0.207887 [D2] - Bus: 003 0.207894 [D2] - Device: 002 0.207902 [D2] - Device release number: 0005 0.207911 [D2] Trying to match device 0.207919 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.207932 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.207940 [D2] Device does not match - skipping 0.207963 [D2] Checking device (1D6B/0002) (003/001) 0.208072 [D2] - VendorID: 1d6b 0.208084 [D2] - ProductID: 0002 0.208098 [D2] - Manufacturer: Linux 5.4.162-1-pve ehci_hcd 0.208105 [D2] - Product: EHCI Host Controller 0.208113 [D2] - Serial Number: 0000:00:1d.0 0.208120 [D2] - Bus: 003 0.208127 [D2] - Device: 001 0.208135 [D2] - Device release number: 0504 0.208142 [D2] Trying to match device 0.208149 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.208159 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.208166 [D2] Device does not match - skipping 0.208179 [D2] Checking device (1D6B/0003) (004/001) 0.208372 [D2] - VendorID: 1d6b 0.208383 [D2] - ProductID: 0003 0.208388 [D2] - Manufacturer: Linux 5.4.162-1-pve xhci-hcd 0.208395 [D2] - Product: xHCI Host Controller 0.208402 [D2] - Serial Number: 0000:00:14.0 0.208405 [D2] - Bus: 004 0.208408 [D2] - Device: 001 0.208413 [D2] - Device release number: 0504 0.208418 [D2] Trying to match device 0.208423 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.208432 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.208437 [D2] Device does not match - skipping 0.208538 [D2] Checking device (2E66/0201) (002/010) 0.210053 [D2] - VendorID: 2e66 0.210064 [D2] - ProductID: 0201 0.210071 [D2] - Manufacturer: Salicru 0.210078 [D2] - Product: SLC TWIN PRO2<=3KVA 0.210084 [D2] - Serial Number: 232019D70264 0.210091 [D2] - Bus: 002 0.210097 [D2] - Device: 010 0.210104 [D2] - Device release number: 0129 0.210110 [D2] Trying to match device 0.210116 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.210218 [D2] Device matches 0.210381 [D2] Warning: HID descriptor, method 1 failed 0.210390 [D2] Warning: HID descriptor, method 2 failed 0.210396 [D2] Unable to retrieve any HID descriptor 0.210415 [D2] Checking device (0E6A/02C0) (002/003) 0.214274 [D2] - VendorID: 0e6a 0.214289 [D2] - ProductID: 02c0 0.214294 [D2] - Manufacturer: dakai 0.214300 [D2] - Product: PS/2+USB Keyboard 0.214304 [D2] - Serial Number: unknown 0.214309 [D2] - Bus: 002 0.214316 [D2] - Device: 003 0.214321 [D2] - Device release number: 4e01 0.214325 [D2] Trying to match device 0.214328 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.214339 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.214346 [D2] Device does not match - skipping 0.214358 [D2] Checking device (046D/C05A) (002/002) 0.216372 [D2] - VendorID: 046d 0.216380 [D2] - ProductID: c05a 0.216388 [D2] - Manufacturer: Logitech 0.216394 [D2] - Product: USB Optical Mouse 0.216399 [D2] - Serial Number: unknown 0.216406 [D2] - Bus: 002 0.216413 [D2] - Device: 002 0.216419 [D2] - Device release number: 6300 0.216426 [D2] Trying to match device 0.216437 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.216448 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.216456 [D2] Device does not match - skipping 0.216468 [D2] Checking device (1D6B/0002) (002/001) 0.216565 [D2] - VendorID: 1d6b 0.216575 [D2] - ProductID: 0002 0.216581 [D2] - Manufacturer: Linux 5.4.162-1-pve xhci-hcd 0.216586 [D2] - Product: xHCI Host Controller 0.216590 [D2] - Serial Number: 0000:00:14.0 0.216595 [D2] - Bus: 002 0.216600 [D2] - Device: 001 0.216606 [D2] - Device release number: 0504 0.216610 [D2] Trying to match device 0.216618 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.216627 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.216635 [D2] Device does not match - skipping 0.216648 [D2] Checking device (8087/800A) (001/002) 0.283444 [D2] - VendorID: 8087 0.283463 [D2] - ProductID: 800a 0.283471 [D2] - Manufacturer: unknown 0.283484 [D2] - Product: unknown 0.283491 [D2] - Serial Number: unknown 0.283498 [D2] - Bus: 001 0.283505 [D2] - Device: 002 0.283511 [D2] - Device release number: 0005 0.283519 [D2] Trying to match device 0.283524 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.283534 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.283540 [D2] Device does not match - skipping 0.283552 [D2] Checking device (1D6B/0002) (001/001) 0.283654 [D2] - VendorID: 1d6b 0.283660 [D2] - ProductID: 0002 0.283664 [D2] - Manufacturer: Linux 5.4.162-1-pve ehci_hcd 0.283669 [D2] - Product: EHCI Host Controller 0.283674 [D2] - Serial Number: 0000:00:1a.0 0.283682 [D2] - Bus: 001 0.283689 [D2] - Device: 001 0.283696 [D2] - Device release number: 0504 0.283707 [D2] Trying to match device 0.283715 [D2] match_function_subdriver (non-SHUT mode): matching a device... 0.283724 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID 0.283730 [D2] Device does not match - skipping 0.283737 [D2] libusb0: No appropriate HID device found 0.283750 No matching HID UPS found

@.:/usr/local/ups/bin# sudo ./upsc @. -u root Error: Connection failure: Connection refused @.***:/usr/local/ups/bin#

@.***:/usr/local/ups/bin# lsusb -v

..... Bus 002 Device 010: ID 2e66:0201 Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x2e66 idProduct 0x0201 bcdDevice 1.29 iManufacturer 1 Salicru iProduct 2 SLC TWIN PRO2<=3KVA iSerial 4 232019D70264 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0022 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.11 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 1436 Report Descriptor: (length is 1436) Item(Global): Usage Page, data= [ 0x84 ] 132 Power Device Page Item(Local ): Usage, data= [ 0x04 ] 4 UPS Item(Main ): Collection, data= [ 0x01 ] 1 Application Item(Local ): Usage, data= [ 0x10 ] 16 Battery System Item(Main ): Collection, data= [ 0x00 ] 0 Physical Item(Local ): Usage, data= [ 0x12 ] 18 Battery Item(Main ): Collection, data= [ 0x00 ] 0 Physical Item(Local ): Usage, data= [ 0x13 ] 19 Battery ID Item(Global): Report ID, data= [ 0x20 ] 32 Item(Global): Report Size, data= [ 0x08 ] 8 Item(Global): Report Count, data= [ 0x01 ] 1 Item(Global): Logical Minimum, data= [ 0x00 ] 0 Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255 Item(Global): Unit, data= [ 0x00 ] 0 System: None, Unit: (None) Item(Global): Unit Exponent, data= [ 0x00 ] 0 Unit Exponent: 0 Item(Main ): Feature, data= [ 0x03 ] 3 Constant Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Non_Volatile Bitfield Item(Global): Usage Page, data= [ 0xff 0xff ] 65535 (null) Item(Local ): Usage, data= [ 0x90 ] 144 (null) Item(Global): Report ID, data= [ 0x21 ] 33 Item(Main ): Feature, data= [ 0x82 ] 130 Data Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Volatile Bitfield Item(Global): Usage Page, data= [ 0x84 ] 132 Power Device Page Item(Local ): Usage, data= [ 0x02 ] 2 Present Status Item(Main ): Collection, data= [ 0x02 ] 2 Logical Item(Local ): Usage, data= [ 0x60 ] 96 Present Item(Global): Report ID, data= [ 0x27 ] 39 Item(Global): Report Size, data= [ 0x08 ] 8 Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255 Item(Global): Unit, data= [ 0x00 ] 0 System: None, Unit: (None) Item(Main ): Feature, data= [ 0x83 ] 131 Constant Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Volatile Bitfield Item(Local ): Usage, data= [ 0x60 ] 96 .... Preferred_State No_Null_Position Volatile Bitfield Item(Local ): Usage, data= [ 0xf1 ] 241 (null) Item(Global): Report ID, data= [ 0xf1 ] 241 Item(Global): Report Count, data= [ 0x04 ] 4 Item(Main ): Feature, data= [ 0x82 ] 130 Data Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Volatile Bitfield Item(Local ): Usage, data= [ 0xff ] 255 (null) Item(Global): Report ID, data= [ 0xff ] 255 Item(Global): Report Size, data= [ 0x08 ] 8 Item(Global): Report Count, data= [ 0x01 ] 1 Item(Global): Logical Minimum, data= [ 0x00 ] 0 Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255 Item(Global): Unit, data= [ 0x00 ] 0 System: None, Unit: (None) Item(Global): Unit Exponent, data= [ 0x00 ] 0 Unit Exponent: 0 Item(Main ): Feature, data= [ 0x82 ] 130 Data Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Volatile Bitfield Item(Main ): End Collection, data=none Item(Main ): End Collection, data=none Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 20 can't get device qualifier: Resource temporarily unavailable can't get debug descriptor: Resource temporarily unavailable Device Status: 0x0000 (Bus Powered)

....... ....`

@.***:/usr/local/ups/bin# cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian HOME_URL=" https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

With debian package it just shows the message: "Driver failed to start". I assume it is due the debian package verison is outdated (2.7.4) so I tried to install from binaries with the otpion "--with-usb".

I guess my main problem is related to the fact that driver can't find HID descriptor but I don't know how to continue from this point.

Can someone provide some tip please?

— Reply to this email directly, view it on GitHub https://github.com/networkupstools/nut/issues/1312, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMPTFHDIIWBAC5YZWUKRTTU4NFX5ANCNFSM5PAXBNGQ . 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: @.***>

drunkly commented 2 years ago

I'm not sure to understand, I am on the branch master on the last commit and made the "sudo make install". Is like this?

About the driver do you mean this?:

root@PROXMOX:~/nut# /usr/local/ups/bin/usbhid-ups -a salicru -u root
Network UPS Tools - Generic HID driver 0.45 (2.7.4-4698-g381a81fc)
USB communication driver (libusb 0.1) 0.42
No matching HID UPS found
jimklimov commented 2 years ago

Sort of "is like this" :) Default configure places files under /usr/local/ups/... tree to not conflict with packages; including an /usr/local/ups/etc/ for config. A non-default build would ask for sysconfigroot=/etc (to use same config as packages, conveniently for experiments) or even more options to replace the packaged files (distro-dependent, everyone places them differently).

For the driver start-up, can you add more -DDDDDDebugs? :)

Possibly you would have to spell out subdriver = salicru option in ups.conf (or via -x on driver command line while testing).

drunkly commented 2 years ago

Hi, first of all thanks for spend your time on me.

I have tried with the subdriver with the next settings:

[salicru]
driver = usbhid-ups
port = auto
vendorid = 2E66
productid = 0201
product = "SLC TWIN PRO2<=3KVA"
serial = 232019D70264
vendor = Salicru
bus = 002
subdriver = salicru
root@PROXMOX:~# /usr/local/ups/bin/usbhid-ups -a salicru -u root
Network UPS Tools - Generic HID driver 0.45 (2.7.4-4698-g381a81fc)
USB communication driver (libusb 0.1) 0.42

Fatal error: 'subdriver' is not a valid variable name for this driver.

Look in the man page or call this driver with -h for a list of
valid variable names and flags.

Also with -x flag:

root@PROXMOX:~# /usr/local/ups/bin/usbhid-ups -a salicru -u root -x salicru
Network UPS Tools - Generic HID driver 0.45 (2.7.4-4698-g381a81fc)
USB communication driver (libusb 0.1) 0.42

Fatal error: 'subdriver' is not a valid variable name for this driver.

Look in the man page or call this driver with -h for a list of
valid variable names and flags.

Then I remvoed to subdriver setting and run it with more debug flags:

root@PROXMOX:/tmp/package/usr/local/ups/bin# ./usbhid-ups -DDDDDD -a salicru -u root
Network UPS Tools - Generic HID driver 0.45 (2.7.4-4698-g381a81fc)
USB communication driver (libusb 0.1) 0.42
   0.000000     [D3] do_global_args: var='maxretry' val='3'
   0.000029     [D3] main_arg: var='driver' val='usbhid-ups'
   0.000041     [D3] main_arg: var='port' val='auto'
   0.000053     [D5] send_to_all: SETINFO driver.parameter.port "auto"
   0.000066     [D3] main_arg: var='vendorid' val='2E66'
   0.000081     [D5] send_to_all: SETINFO driver.parameter.vendorid "2E66"
   0.000096     [D3] main_arg: var='productid' val='0201'
   0.000121     [D5] send_to_all: SETINFO driver.parameter.productid "0201"
   0.000137     [D3] main_arg: var='product' val='SLC TWIN PRO2<=3KVA'
   0.000150     [D5] send_to_all: SETINFO driver.parameter.product "SLC TWIN PRO2<=3KVA"
   0.000166     [D3] main_arg: var='serial' val='232019D70264'
   0.000179     [D5] send_to_all: SETINFO driver.parameter.serial "232019D70264"
   0.000189     [D3] main_arg: var='vendor' val='Salicru'
   0.000199     [D5] send_to_all: SETINFO driver.parameter.vendor "Salicru"
   0.000209     [D3] main_arg: var='bus' val='002'
   0.000218     [D5] send_to_all: SETINFO driver.parameter.bus "002"
   0.000236     [D1] Built-in default or configured user for drivers 'nut' was ignored due to 'root' specified on command line
   0.000252     [D1] debug level is '6'
   0.001452     [D5] send_to_all: SETINFO device.type "ups"
   0.001469     [D2] Initializing an USB-connected UPS with library libusb-0.1 (or compat) (NUT subdriver name='USB communication driver (libusb 0.1)' ver='0.42')
   0.001480     [D1] upsdrv_initups (non-SHUT)...
   0.142371     [D3] usb_busses=0x561c99c298b0
   0.142390     [D2] Checking device (8087/8002) (004/002)
   0.210705     [D2] - VendorID: 8087
   0.210730     [D2] - ProductID: 8002
   0.210747     [D2] - Manufacturer: unknown
   0.210754     [D2] - Product: unknown
   0.210777     [D2] - Serial Number: unknown
   0.210785     [D2] - Bus: 004
   0.210793     [D2] - Device: 002
   0.210800     [D2] - Device release number: 0005
   0.210807     [D2] Trying to match device
   0.210815     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.210829     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.210837     [D2] Device does not match - skipping
   0.210862     [D2] Checking device (1D6B/0002) (004/001)
   0.211021     [D2] - VendorID: 1d6b
   0.211033     [D2] - ProductID: 0002
   0.211041     [D2] - Manufacturer: Linux 5.4.166-1-pve ehci_hcd
   0.211048     [D2] - Product: EHCI Host Controller
   0.211055     [D2] - Serial Number: 0000:00:1d.0
   0.211062     [D2] - Bus: 004
   0.211070     [D2] - Device: 001
   0.211077     [D2] - Device release number: 0504
   0.211084     [D2] Trying to match device
   0.211091     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.211100     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.211108     [D2] Device does not match - skipping
   0.211125     [D2] Checking device (1D6B/0003) (003/001)
   0.211336     [D2] - VendorID: 1d6b
   0.211354     [D2] - ProductID: 0003
   0.211363     [D2] - Manufacturer: Linux 5.4.166-1-pve xhci-hcd
   0.211371     [D2] - Product: xHCI Host Controller
   0.211379     [D2] - Serial Number: 0000:00:14.0
   0.211387     [D2] - Bus: 003
   0.211394     [D2] - Device: 001
   0.211402     [D2] - Device release number: 0504
   0.211410     [D2] Trying to match device
   0.211418     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.211429     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.211437     [D2] Device does not match - skipping
   0.211579     [D2] Checking device (2E66/0201) (002/004)
   0.213133     [D2] - VendorID: 2e66
   0.213142     [D2] - ProductID: 0201
   0.213149     [D2] - Manufacturer: Salicru
   0.213156     [D2] - Product: SLC TWIN PRO2<=3KVA
   0.213162     [D2] - Serial Number: 232019D70264
   0.213168     [D2] - Bus: 002
   0.213173     [D2] - Device: 004
   0.213193     [D2] - Device release number: 0129
   0.213202     [D2] Trying to match device
   0.213206     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.213214     [D3] match_function_regex: matching a device...
   0.213364     [D2] Device matches
   0.213403     [D3] nut_usb_set_altinterface: skipped usb_set_altinterface(udev, 0)
   0.213570     [D3] HID descriptor, method 1: (9 bytes) => 09 21 11 01 00 01 22 9c 05
   0.213584     [D2] Warning: HID descriptor, method 1 failed
   0.213594     [D3] HID descriptor length (method 1) -100
   0.213605     [D4] i=0, extra[i]=09, extra[i+1]=21
   0.213616     [D3] HID descriptor, method 2: (9 bytes) => 09 21 11 01 00 01 22 9c 05
   0.213624     [D2] Warning: HID descriptor, method 2 failed
   0.213632     [D3] HID descriptor length (method 2) -100
   0.213642     [D2] Unable to retrieve any HID descriptor
   0.213663     [D2] Checking device (0E6A/02C0) (002/003)
   0.217386     [D2] - VendorID: 0e6a
   0.217396     [D2] - ProductID: 02c0
   0.217399     [D2] - Manufacturer: dakai
   0.217404     [D2] - Product: PS/2+USB Keyboard
   0.217410     [D2] - Serial Number: unknown
   0.217418     [D2] - Bus: 002
   0.217425     [D2] - Device: 003
   0.217431     [D2] - Device release number: 4e01
   0.217438     [D2] Trying to match device
   0.217444     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.217453     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.217459     [D2] Device does not match - skipping
   0.217471     [D2] Checking device (046D/C05A) (002/002)
   0.219381     [D2] - VendorID: 046d
   0.219397     [D2] - ProductID: c05a
   0.219405     [D2] - Manufacturer: Logitech
   0.219414     [D2] - Product: USB Optical Mouse
   0.219423     [D2] - Serial Number: unknown
   0.219434     [D2] - Bus: 002
   0.219441     [D2] - Device: 002
   0.219449     [D2] - Device release number: 6300
   0.219457     [D2] Trying to match device
   0.219465     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.219476     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.219486     [D2] Device does not match - skipping
   0.219499     [D2] Checking device (1D6B/0002) (002/001)
   0.219625     [D2] - VendorID: 1d6b
   0.219636     [D2] - ProductID: 0002
   0.219643     [D2] - Manufacturer: Linux 5.4.166-1-pve xhci-hcd
   0.219653     [D2] - Product: xHCI Host Controller
   0.219660     [D2] - Serial Number: 0000:00:14.0
   0.219669     [D2] - Bus: 002
   0.219677     [D2] - Device: 001
   0.219686     [D2] - Device release number: 0504
   0.219693     [D2] Trying to match device
   0.219701     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.219710     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.219718     [D2] Device does not match - skipping
   0.219735     [D2] Checking device (8087/800A) (001/002)
   0.290439     [D2] - VendorID: 8087
   0.290457     [D2] - ProductID: 800a
   0.290462     [D2] - Manufacturer: unknown
   0.290465     [D2] - Product: unknown
   0.290482     [D2] - Serial Number: unknown
   0.290489     [D2] - Bus: 001
   0.290499     [D2] - Device: 002
   0.290506     [D2] - Device release number: 0005
   0.290514     [D2] Trying to match device
   0.290521     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.290533     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.290541     [D2] Device does not match - skipping
   0.290557     [D2] Checking device (1D6B/0002) (001/001)
   0.290686     [D2] - VendorID: 1d6b
   0.290696     [D2] - ProductID: 0002
   0.290704     [D2] - Manufacturer: Linux 5.4.166-1-pve ehci_hcd
   0.290712     [D2] - Product: EHCI Host Controller
   0.290717     [D2] - Serial Number: 0000:00:1a.0
   0.290722     [D2] - Bus: 001
   0.290727     [D2] - Device: 001
   0.290732     [D2] - Device release number: 0504
   0.290738     [D2] Trying to match device
   0.290743     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.290750     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.290755     [D2] Device does not match - skipping
   0.290767     [D2] libusb0: No appropriate HID device found
   0.290781     No matching HID UPS found

I guess the error about subdriver is related to a mistake on my side running the configure/make install so I will re-read all the documentation again to see if I'm missing some path/flag.

Please let me know if you have a more ideas I can try.

drunkly commented 2 years ago

I have read the help of usbhidups and runned again with right sintax but I'm getting the same error.

root@PROXMOX:~# /usr/local/ups/bin/usbhid-ups -a salicru -u root -x subdriver=salicru
Network UPS Tools - Generic HID driver 0.45 (2.7.4-4698-g381a81fc)
USB communication driver (libusb 0.1) 0.42

Fatal error: 'subdriver' is not a valid variable name for this driver.

Look in the man page or call this driver with -h for a list of
valid variable names and flags.

It is interesting that sub driver is not on the help message:

root@PROXMOX:~# /usr/local/ups/bin/usbhid-ups -h
Network UPS Tools - Generic HID driver 0.45 (2.7.4-4698-g381a81fc)
USB communication driver (libusb 0.1) 0.42

usage: usbhid-ups (-a <id>|-s <id>) [OPTIONS]
  -a <id>        - autoconfig using ups.conf section <id>
                 - note: -x after -a overrides ups.conf settings

  -s <id>        - configure directly from cmd line arguments
                 - note: must specify all driver parameters with successive -x
                 - note: at least 'port' variable should be set
                 - note: to explore the current values on a device from an
                   unprivileged user account (with sufficient media access in
                   the OS - e.g. to query networked devices), you can specify
                   '-d 1' argument and `export NUT_STATEPATH=/tmp` beforehand

  -V             - print version, then exit
  -L             - print parseable list of driver variables
  -D             - raise debugging level (and stay foreground by default)
  -d <count>     - dump data to stdout after 'count' updates loop and exit
  -F             - stay foregrounded even if no debugging is enabled
  -B             - stay backgrounded even if debugging is bumped
  -q             - raise log level threshold
  -h             - display this help
  -k             - force shutdown
  -i <int>       - poll interval
  -r <dir>       - chroot to <dir>
  -u <user>      - switch to <user> (if started as root)
  -g <group>     - set pipe access to <group> (if started as root)
  -x <var>=<val> - set driver variable <var> to <val>
                 - example: -x cable=940-0095B

Acceptable values for -x or ups.conf in this driver:

Set low battery level, in % (default=30) : -x lowbatt=<value>
Set shutdown delay, in seconds (default=20) : -x offdelay=<value>
Set startup delay, in seconds (default=30) : -x ondelay=<value>
Set polling frequency, in seconds, to reduce data flow (default=30) : -x pollfreq=<value>
Don't use interrupt pipe, only use polling : -x pollonly
Regular expression to match UPS Manufacturer string : -x vendor=<value>
Regular expression to match UPS Product string : -x product=<value>
Regular expression to match UPS Serial number : -x serial=<value>
Regular expression to match UPS Manufacturer numerical ID (4 digits hexadecimal) : -x vendorid=<value>
Regular expression to match UPS Product numerical ID (4 digits hexadecimal) : -x productid=<value>
Regular expression to match USB bus name : -x bus=<value>
Regular expression to match USB device name : -x device=<value>
Force redundant call to usb_set_altinterface() (value=bAlternateSetting; default=0) : -x usb_set_altinterface=<value>
  Diagnostic matching of unsupported UPS : -x explore
Activate tweak for buggy APC Back-UPS firmware : -x maxreport
Don't use polling, only use interrupt pipe : -x interruptonly
Number of bytes to read from interrupt pipe : -x interruptsize=<value>

That make me think I'm not running the last version of nut so I will try to remove everything and re-instlal it again.

drunkly commented 2 years ago

Added some debug lines to check the problem was related to subdriver:

  0.216510     [D2] Checking device (2E66/0201) (002/004)
   0.218023     [D2] - VendorID: 2e66
   0.218032     [D2] - ProductID: 0201
   0.218038     [D2] - Manufacturer: Salicru
   0.218041     [D2] - Product: SLC TWIN PRO2<=3KVA
   0.218046     [D2] - Serial Number: 232019D70264
   0.218051     [D2] - Bus: 002
   0.218056     [D2] - Device: 004
   0.218061     [D2] - Device release number: 0129
   0.218067     [D2] Trying to match device
   0.218072     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.218078     [D2] (non-SHUT mode): trying EXPLORE HID 0.2 subdriver...
   0.218084     [D2] trying EXPLORE HID 0.2 subdriver failed
   0.218089     [D2] (non-SHUT mode): trying MGE HID 1.45 subdriver...
   0.218095     [D2]  463 compare vendor id with 2e66
   0.218100     [D2]  463 compare vendor id with 2e66
   0.218104     [D2]  47c compare vendor id with 2e66
   0.218108     [D2]  592 compare vendor id with 2e66
   0.218118     [D2]  3f0 compare vendor id with 2e66
   0.218138     [D2]  3f0 compare vendor id with 2e66
   0.218146     [D2]  3f0 compare vendor id with 2e66
   0.218152     [D2]  3f0 compare vendor id with 2e66
   0.218160     [D2] 2b2d compare vendor id with 2e66
   0.218168     [D2]  6da compare vendor id with 2e66
   0.218176     [D2]  4b3 compare vendor id with 2e66
   0.218183     [D2] trying MGE HID 1.45 subdriver failed
   0.218191     [D2] (non-SHUT mode): trying APC HID 0.98 subdriver...
   0.218199     [D2]  51d compare vendor id with 2e66
   0.218206     [D2]  51d compare vendor id with 2e66
   0.218214     [D2]  51d compare vendor id with 2e66
   0.218221     [D2] trying APC HID 0.98 subdriver failed
   0.218228     [D2] (non-SHUT mode): trying Arduino HID 0.2 subdriver...
   0.218235     [D2] 2341 compare vendor id with 2e66
   0.218240     [D2] 2341 compare vendor id with 2e66
   0.218246     [D2] 2a03 compare vendor id with 2e66
   0.218251     [D2] 2a03 compare vendor id with 2e66
   0.218256     [D2] 2a03 compare vendor id with 2e66
   0.218261     [D2] 2a03 compare vendor id with 2e66
   0.218266     [D2] trying Arduino HID 0.2 subdriver failed
   0.218271     [D2] (non-SHUT mode): trying Belkin/Liebert HID 0.18 subdriver...
   0.218277     [D2]  50d compare vendor id with 2e66
   0.218281     [D2]  50d compare vendor id with 2e66
   0.218286     [D2]  50d compare vendor id with 2e66
   0.218291     [D2]  50d compare vendor id with 2e66
   0.218295     [D2]  50d compare vendor id with 2e66
   0.218299     [D2]  50d compare vendor id with 2e66
   0.218304     [D2]  50d compare vendor id with 2e66
   0.218309     [D2]  50d compare vendor id with 2e66
   0.218314     [D2]  50d compare vendor id with 2e66
   0.218319     [D2]  50d compare vendor id with 2e66
   0.218324     [D2] 10af compare vendor id with 2e66
   0.218329     [D2] 10af compare vendor id with 2e66
   0.218334     [D2] 10af compare vendor id with 2e66
   0.218339     [D2] 10af compare vendor id with 2e66
   0.218343     [D2] trying Belkin/Liebert HID 0.18 subdriver failed
   0.218347     [D2] (non-SHUT mode): trying CyberPower HID 0.6 subdriver...
   0.218352     [D2]  764 compare vendor id with 2e66
   0.218356     [D2]  764 compare vendor id with 2e66
   0.218361     [D2]  764 compare vendor id with 2e66
   0.218366     [D2] trying CyberPower HID 0.6 subdriver failed
   0.218371     [D2] (non-SHUT mode): trying Delta UPS HID 0.6 subdriver...
   0.218375     [D2]  5dd compare vendor id with 2e66
   0.218380     [D2] trying Delta UPS HID 0.6 subdriver failed
   0.218384     [D2] (non-SHUT mode): trying Ever HID 0.1 subdriver...
   0.218390     [D2]  483 compare vendor id with 2e66
   0.218395     [D2] 2e51 compare vendor id with 2e66
   0.218400     [D2] trying Ever HID 0.1 subdriver failed
   0.218406     [D2] (non-SHUT mode): trying iDowell HID 0.2 subdriver...
   0.218411     [D2]  75d compare vendor id with 2e66
   0.218415     [D2] trying iDowell HID 0.2 subdriver failed
   0.218419     [D2] (non-SHUT mode): trying Legrand HID 0.2 subdriver...
   0.218424     [D2] 1cb0 compare vendor id with 2e66
   0.218429     [D2] 1cb0 compare vendor id with 2e66
   0.218434     [D2] trying Legrand HID 0.2 subdriver failed
   0.218439     [D2] (non-SHUT mode): trying Phoenixtec/Liebert HID 0.4 subdriver...
   0.218444     [D2]  6da compare vendor id with 2e66
   0.218449     [D2] trying Phoenixtec/Liebert HID 0.4 subdriver failed
   0.218457     [D2] (non-SHUT mode): trying openUPS HID 0.5 subdriver...
   0.218464     [D2]  4d8 compare vendor id with 2e66
   0.218472     [D2]  4d8 compare vendor id with 2e66
   0.218480     [D2] trying openUPS HID 0.5 subdriver failed
   0.218488     [D2] (non-SHUT mode): trying PowerCOM HID 0.6 subdriver...
   0.218495     [D2]  d9f compare vendor id with 2e66
   0.218503     [D2]  d9f compare vendor id with 2e66
   0.218510     [D2]  d9f compare vendor id with 2e66
   0.218517     [D2]  d9f compare vendor id with 2e66
   0.218524     [D2]  d9f compare vendor id with 2e66
   0.218530     [D2]  d9f compare vendor id with 2e66
   0.218536     [D2]  d9f compare vendor id with 2e66
   0.218542     [D2] trying PowerCOM HID 0.6 subdriver failed
   0.218548     [D2] (non-SHUT mode): trying Powervar HID 0.20 subdriver...
   0.218555     [D2] 4234 compare vendor id with 2e66
   0.218561     [D2] trying Powervar HID 0.20 subdriver failed
   0.218567     [D2] (non-SHUT mode): trying Salicru HID 0.3 subdriver...
   0.218574     [D2] 2e66 compare vendor id with 2e66
   0.218580     [D2] claim status: 2  for salicru subdriver failed
   0.218587     [D3] match_function_regex: matching a device...
   0.218702     [D2] Device matches
   0.218729     [D3] nut_usb_set_altinterface: skipped usb_set_altinterface(udev, 0)
   0.218888     [D3] HID descriptor, method 1: (9 bytes) => 09 21 11 01 00 01 22 9c 05
   0.218895     [D2] Warning: HID descriptor, method 1 failed
   0.218898     [D3] HID descriptor length (method 1) -100
   0.218904     [D4] i=0, extra[i]=09, extra[i+1]=21
   0.218911     [D3] HID descriptor, method 2: (9 bytes) => 09 21 11 01 00 01 22 9c 05
   0.218917     [D2] Warning: HID descriptor, method 2 failed
   0.218922     [D3] HID descriptor length (method 2) -100
   0.218928     [D2] Unable to retrieve any HID descriptor

In my eyes loos like a problem with lisusb0.1/libusb1.0 but knoweledges are not arriving so far to be sure. I have tried to force the usb lib 1.0 but I had no luck so if can give me some advice about how to continue from this point would be great.

jimklimov commented 2 years ago

Sorry, my bad, dealt too much with Qx drivers lately, and an explicit keyword to select a subdriver is their specialty (like a choice of mibs is for snmp-ups driver). The current usbhid-ups driver should just pick what it deems a best fit:

drunkly commented 2 years ago

Don't have to aplogizes. We are on the same boat :)

Looking deeply I think the subdriver is working but there is a problem related to HID descriptor

HID descriptor, method N: (9 bytes) => 09 21 11 01 00 01 22 9c 05
HID descriptor length (method N) -100

On lines https://github.com/networkupstools/nut/blob/master/drivers/libusb0.c#L383 https://github.com/networkupstools/nut/blob/master/drivers/libusb0.c#L415

I will read some book about HID descriptors to learn how they works and get why are not working and publish the results if get some results.

drunkly commented 2 years ago

I could get somehow more info about HID descriptor and looks like is reperting well the data but can't get to root of the issue.

I saw there is some kind of validation here to prevent issues with usb. Could you please explain why is doing this or how is working or where can I get more information about this please?:

rdlen2 = p[7] | (p[8] << 8); https://github.com/networkupstools/nut/blob/master/drivers/libusb0.c#L383#410

Here are the info I got until now in case is for someone useful:

root@PROXMOX:~/hidrd# usbhid-dump -d 2E66:0201 | grep -v : | xxd -r -p | hidrd-convert -o spec
Usage Page (Power Device),                                          ; Power device (84h, power page)
Usage (04h),
Collection (Application),
    Usage (10h),
    Collection (Physical),
        Usage (12h),
        Collection (Physical),
            Usage (13h),
            Report ID (32),
            Report Size (8),
            Report Count (1),
            Logical Minimum (0),
            Logical Maximum (255),
            Unit,
            Unit Exponent (0),
            Feature (Constant, Variable),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (90h),
            Report ID (33),
            Feature (Variable, Volatile),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (02h),
            Collection (Logical),
                Usage (60h),
                Report ID (39),
                Report Size (8),
                Logical Maximum (255),
                Unit,
                Feature (Constant, Variable, Volatile),
                Usage (60h),
                Input (Constant, Variable, Bit7),
                Usage Page (FFFFh),                                 ; FFFFh, vendor-defined
                Usage (74h),
                Feature (Constant, Variable, Volatile),
                Usage (74h),
                Input (Constant, Variable, Bit7),
            End Collection,
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (58h),
            Report ID (36),
            Feature (Variable, Volatile),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (E3h),
            Report ID (227),
            Feature (Variable, Volatile),
            Usage (45h),
            Report ID (37),
            Report Size (32),
            Logical Maximum (2147483647),
            Unit (Seconds),
            Feature (Variable, Volatile),
        End Collection,
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (11h),
        Report ID (32),
        Report Size (8),
        Logical Maximum (255),
        Unit,
        Feature (Constant, Variable),
        Usage (14h),
        Collection (Physical),
            Usage (15h),
            Feature (Constant, Variable),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (02h),
            Collection (Logical),
                Usage Page (FFFFh),                                 ; FFFFh, vendor-defined
                Usage (79h),
                Report ID (39),
                Feature (Constant, Variable, Volatile),
                Usage (79h),
                Input (Constant, Variable, Bit7),
                Usage Page (Power Device),                          ; Power device (84h, power page)
                Usage (62h),
                Feature (Constant, Variable, Volatile),
                Usage (62h),
                Input (Constant, Variable, Bit7),
                Usage (6Dh),
                Feature (Constant, Variable, Volatile),
                Usage (6Dh),
                Input (Constant, Variable, Bit7),
            End Collection,
        End Collection,
    End Collection,
    Usage Page (Power Device),                                      ; Power device (84h, power page)
    Usage (1Eh),
    Collection (129),
        Usage (42h),
        Report ID (20),
        Unit (Seconds^-1),
        Feature (Constant, Variable, Volatile),
        Usage (40h),
        Report ID (21),
        Unit (Centimeter^2 * Gram * Seconds^-3 * Ampere^-1),
        Unit Exponent (7),
        Feature (Constant, Variable, Volatile),
        Usage (1Fh),
        Report ID (11),
        Unit,
        Unit Exponent (0),
        Feature (Constant, Variable),
    End Collection,
    Usage (1Eh),
    Collection (132),
        Usage (44h),
        Report ID (116),
        Report Size (16),
        Logical Maximum (65535),
        Unit (Centimeter^2 * Gram * Seconds^-3),
        Unit Exponent (7),
        Feature (Constant, Variable, Volatile),
        Usage (43h),
        Unit (Centimeter^2 * Gram * Seconds^-3),
        Feature (Constant, Variable, Volatile),
        Usage (42h),
        Report ID (54),
        Report Size (8),
        Logical Maximum (255),
        Unit (Seconds^-1),
        Unit Exponent (0),
        Feature (Variable, Volatile),
        Usage (45h),
        Report ID (22),
        Unit,
        Feature (Constant, Variable, Volatile),
        Usage (40h),
        Report ID (114),
        Unit (Centimeter^2 * Gram * Seconds^-3 * Ampere^-1),
        Unit Exponent (7),
        Feature (Variable, Volatile),
        Usage (1Fh),
        Report ID (11),
        Unit,
        Unit Exponent (0),
        Feature (Constant, Variable),
    End Collection,
    Usage (16h),
    Collection (Physical),
        Usage Page (FFFFh),                                         ; FFFFh, vendor-defined
        Usage (41h),
        Report ID (74),
        Feature (Constant, Variable),
        Usage (42h),
        Report ID (76),
        Feature (Constant, Variable, Volatile),
        Usage (4Fh),
        Report ID (75),
        Feature (Variable, Volatile),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (1Ah),
        Collection (129),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (43h),
            Report ID (115),
            Feature (Variable, Volatile),
            Usage (94h),
            Report ID (193),
            Feature (Variable, Volatile),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (1Fh),
            Report ID (48),
            Feature (Constant, Variable),
            Usage (32h),
            Report ID (49),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Seconds^-1),
            Unit Exponent (15),
            Feature (Constant, Variable, Volatile),
            Usage (1Bh),
            Report ID (48),
            Report Size (8),
            Logical Maximum (255),
            Unit,
            Unit Exponent (0),
            Feature (Constant, Variable),
            Usage (02h),
            Collection (Logical),
                Usage (64h),
                Report ID (50),
                Feature (Constant, Variable, Volatile),
                Usage (64h),
                Input (Constant, Variable, Bit7),
                Usage (63h),
                Feature (Constant, Variable, Volatile),
                Usage (63h),
                Input (Constant, Variable, Bit7),
                Usage Page (FFFFh),                                 ; FFFFh, vendor-defined
                Usage (78h),
                Feature (Constant, Variable, Volatile),
                Usage (78h),
                Input (Constant, Variable, Bit7),
            End Collection,
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (30h),
            Report ID (49),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Centimeter^2 * Gram * Seconds^-3 * Ampere^-1),
            Unit Exponent (7),
            Feature (Constant, Variable, Volatile),
        End Collection,
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (1Ah),
        Collection (130),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (72h),
            Report ID (81),
            Report Size (8),
            Logical Maximum (255),
            Unit,
            Feature (Variable, Volatile),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (1Fh),
            Report ID (47),
            Report Size (8),
            Logical Maximum (255),
            Unit,
            Unit Exponent (0),
            Feature (Constant, Variable),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (32h),
            Report ID (55),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Seconds^-1),
            Unit Exponent (15),
            Feature (Constant, Variable, Volatile),
            Usage (1Bh),
            Report ID (47),
            Report Size (8),
            Logical Maximum (255),
            Unit,
            Unit Exponent (0),
            Feature (Constant, Variable),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (54h),
            Report ID (52),
            Feature (Variable, Volatile),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (02h),
            Collection (Logical),
                Usage (64h),
                Report ID (56),
                Feature (Constant, Variable, Volatile),
                Usage (64h),
                Input (Constant, Variable, Bit7),
                Usage (61h),
                Feature (Constant, Variable, Volatile),
                Usage (61h),
                Input (Constant, Variable, Bit7),
                Usage (65h),
                Feature (Constant, Variable, Volatile),
                Usage (65h),
                Input (Constant, Variable, Bit7),
                Usage Page (Power Device),                          ; Power device (84h, power page)
                Usage (6Dh),
                Feature (Constant, Variable, Volatile),
                Usage (6Dh),
                Input (Constant, Variable, Bit7),
                Usage (63h),
                Feature (Constant, Variable, Volatile),
                Usage (63h),
                Input (Constant, Variable, Bit7),
            End Collection,
            Usage (6Ch),
            Report ID (45),
            Feature (Variable, Volatile),
            Usage (30h),
            Report ID (55),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Centimeter^2 * Gram * Seconds^-3 * Ampere^-1),
            Unit Exponent (7),
            Feature (Constant, Variable, Volatile),
        End Collection,
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (1Ah),
        Collection (131),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (46h),
            Report ID (57),
            Report Size (8),
            Logical Maximum (255),
            Unit,
            Unit Exponent (0),
            Feature (Variable, Volatile),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (1Fh),
            Report ID (48),
            Feature (Constant, Variable),
            Usage (1Bh),
            Feature (Constant, Variable),
            Usage (02h),
            Collection (Logical),
                Usage (6Dh),
                Report ID (59),
                Feature (Constant, Variable, Volatile),
                Usage (6Dh),
                Input (Constant, Variable, Bit7),
            End Collection,
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (47h),
            Report ID (58),
            Feature (Variable, Volatile),
        End Collection,
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (1Ah),
        Collection (133),
            Usage (1Fh),
            Report ID (48),
            Feature (Constant, Variable),
            Usage (1Bh),
            Feature (Constant, Variable),
            Usage (02h),
            Collection (Logical),
                Usage (6Dh),
                Report ID (60),
                Feature (Constant, Variable, Volatile),
                Usage (6Dh),
                Input (Constant, Variable, Bit7),
            End Collection,
            Usage (6Ch),
            Report ID (63),
            Feature (Variable, Volatile),
        End Collection,
        Usage (14h),
        Collection (Physical),
            Usage (15h),
            Report ID (64),
            Feature (Constant, Variable),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (02h),
            Collection (Logical),
                Usage (6Dh),
                Report ID (65),
                Feature (Constant, Variable, Volatile),
                Usage (6Dh),
                Input (Constant, Variable, Bit7),
                Usage Page (FFFFh),                                 ; FFFFh, vendor-defined
                Usage (74h),
                Report ID (62),
                Feature (Constant, Variable, Volatile),
                Usage (74h),
                Input (Constant, Variable, Bit7),
                Usage (75h),
                Feature (Constant, Variable, Volatile),
                Usage (75h),
                Input (Constant, Variable, Bit7),
            End Collection,
        End Collection,
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (1Ch),
        Collection (Physical),
            Usage (34h),
            Report ID (66),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Centimeter^2 * Gram * Seconds^-3),
            Unit Exponent (7),
            Feature (Constant, Variable, Volatile),
            Usage (33h),
            Unit (Centimeter^2 * Gram * Seconds^-3),
            Feature (Constant, Variable, Volatile),
            Usage (1Fh),
            Report ID (64),
            Report Size (8),
            Logical Maximum (255),
            Unit,
            Unit Exponent (0),
            Feature (Constant, Variable),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (32h),
            Report ID (66),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Seconds^-1),
            Unit Exponent (15),
            Feature (Constant, Variable, Volatile),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (F8h),
            Report ID (248),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Seconds^-1),
            Unit Exponent (15),
            Feature (Variable, Volatile),
            Usage (F9h),
            Report ID (249),
            Feature (Variable, Volatile),
            Usage (FBh),
            Report ID (251),
            Report Size (8),
            Logical Maximum (255),
            Unit,
            Unit Exponent (0),
            Feature (Variable, Volatile),
            Usage (FCh),
            Report ID (252),
            Feature (Variable, Volatile),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (58h),
            Report ID (70),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Centimeter^2 * Gram * Seconds^-3 * Ampere^-1),
            Unit Exponent (7),
            Feature (Variable, Volatile),
            Usage (57h),
            Report ID (69),
            Feature (Variable, Volatile),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Usage (5Bh),
            Report ID (104),
            Report Size (8),
            Logical Minimum (0),
            Logical Maximum (255),
            Unit,
            Unit Exponent (0),
            Feature (Variable, Volatile),
            Usage (5Ah),
            Report ID (105),
            Feature (Variable, Volatile),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (54h),
            Report ID (72),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Centimeter^2 * Gram * Seconds^-3 * Ampere^-1),
            Unit Exponent (7),
            Feature (Variable, Volatile),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (53h),
            Report ID (71),
            Feature (Variable, Volatile),
            Usage (1Dh),
            Report ID (64),
            Report Size (8),
            Logical Maximum (255),
            Unit,
            Unit Exponent (0),
            Feature (Constant, Variable),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (02h),
            Collection (Logical),
                Usage Page (FFFFh),                                 ; FFFFh, vendor-defined
                Usage (4Ah),
                Report ID (73),
                Unit,
                Feature (Constant, Variable, Volatile),
                Usage (4Ah),
                Input (Constant, Variable, Bit7),
            End Collection,
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (30h),
            Report ID (66),
            Report Size (16),
            Logical Maximum (65535),
            Unit (Centimeter^2 * Gram * Seconds^-3 * Ampere^-1),
            Unit Exponent (7),
            Feature (Constant, Variable, Volatile),
        End Collection,
        Usage (17h),
        Report ID (64),
        Report Size (8),
        Logical Maximum (255),
        Unit,
        Unit Exponent (0),
        Feature (Constant, Variable),
    End Collection,
    Usage (24h),
    Collection (Physical),
        Usage (5Ah),
        Report ID (19),
        Feature (Variable, Volatile),
        Usage Page (Power Batsys),                                  ; Power battery system (85h, power page)
        Usage (8Dh),
        Report ID (12),
        Feature (Constant, Variable),
        Usage (2Ch),
        Feature (Constant, Variable),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (40h),
        Report ID (13),
        Unit (Centimeter^2 * Gram * Seconds^-3 * Ampere^-1),
        Unit Exponent (7),
        Feature (Constant, Variable),
        Usage Page (FFFFh),                                         ; FFFFh, vendor-defined
        Usage (95h),
        Report ID (11),
        Unit,
        Unit Exponent (0),
        Feature (Constant, Variable),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (57h),
        Report ID (9),
        Report Size (32),
        Logical Minimum (-1),
        Logical Maximum (2147483647),
        Unit (Seconds),
        Feature (Variable, Volatile),
        Usage (56h),
        Report ID (10),
        Feature (Variable, Volatile),
        Usage Page (Power Batsys),                                  ; Power battery system (85h, power page)
        Usage (83h),
        Report ID (12),
        Report Size (8),
        Logical Minimum (0),
        Logical Maximum (255),
        Unit,
        Feature (Constant, Variable),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (1Fh),
        Report ID (11),
        Unit,
        Feature (Constant, Variable),
        Usage Page (Power Batsys),                                  ; Power battery system (85h, power page)
        Usage (67h),
        Report ID (12),
        Unit,
        Feature (Constant, Variable),
        Usage (89h),
        Report ID (16),
        Unit,
        Feature (Constant, Variable),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (FDh),
        Feature (Constant, Variable),
        Usage Page (FFFFh),                                         ; FFFFh, vendor-defined
        Usage (F0h),
        Feature (Constant, Variable),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (FEh),
        Feature (Constant, Variable),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (FFh),
        Feature (Constant, Variable),
        Usage Page (FFFFh),                                         ; FFFFh, vendor-defined
        Usage (F1h),
        Feature (Constant, Variable),
        Usage (F2h),
        Feature (Constant, Variable),
        Usage (E2h),
        Report ID (226),
        Feature (Constant, Variable, Volatile),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (35h),
        Report ID (7),
        Unit,
        Feature (Constant, Variable, Volatile),
        Usage (25h),
        Report ID (11),
        Unit,
        Feature (Constant, Variable),
        Usage Page (FFFFh),                                         ; FFFFh, vendor-defined
        Usage (94h),
        Report ID (225),
        Unit,
        Feature (Constant, Variable, Volatile),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (02h),
        Collection (Logical),
            Usage Page (Power Batsys),                              ; Power battery system (85h, power page)
            Usage (D0h),
            Report ID (1),
            Feature (Constant, Variable, Volatile),
            Usage (D0h),
            Input (Constant, Variable, Bit7),
            Usage (42h),
            Feature (Constant, Variable, Volatile),
            Usage (42h),
            Input (Constant, Variable, Bit7),
            Usage (44h),
            Feature (Constant, Variable, Volatile),
            Usage (44h),
            Input (Constant, Variable, Bit7),
            Usage (45h),
            Report ID (1),
            Feature (Constant, Variable, Volatile),
            Usage (45h),
            Input (Constant, Variable, Bit7),
            Usage Page (FFFFh),                                     ; FFFFh, vendor-defined
            Report ID (3),
            Usage (77h),
            Feature (Constant, Variable, Volatile),
            Usage (77h),
            Input (Constant, Variable, Bit7),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (61h),
            Report ID (1),
            Feature (Constant, Variable, Volatile),
            Usage (61h),
            Input (Constant, Variable, Bit7),
            Usage (62h),
            Report ID (2),
            Feature (Constant, Variable, Volatile),
            Usage (62h),
            Input (Constant, Variable, Bit7),
            Usage Page (Power Batsys),                              ; Power battery system (85h, power page)
            Usage (4Bh),
            Feature (Constant, Variable, Volatile),
            Usage (4Bh),
            Input (Constant, Variable, Bit7),
            Usage Page (Power Device),                              ; Power device (84h, power page)
            Usage (65h),
            Feature (Constant, Variable, Volatile),
            Usage (65h),
            Input (Constant, Variable, Bit7),
            Usage (67h),
            Report ID (3),
            Feature (Constant, Variable, Volatile),
            Usage (67h),
            Input (Constant, Variable, Bit7),
        End Collection,
        Usage Page (Power Batsys),                                  ; Power battery system (85h, power page)
        Usage (66h),
        Report ID (6),
        Unit,
        Feature (Constant, Variable, Volatile),
        Usage (66h),
        Input (Constant, Variable, Bit7),
        Usage Page (Power Batsys),                                  ; Power battery system (85h, power page)
        Usage (68h),
        Report ID (6),
        Report Size (32),
        Logical Maximum (2147483647),
        Unit (Seconds),
        Feature (Constant, Variable, Volatile),
        Usage (68h),
        Input (Constant, Variable, Bit7),
        Usage Page (Power Device),                                  ; Power device (84h, power page)
        Usage (30h),
        Report ID (7),
        Report Size (16),
        Report Count (1),
        Logical Maximum (65535),
        Unit (Centimeter^2 * Gram * Seconds^-3 * Ampere^-1),
        Unit Exponent (6),
        Feature (Constant, Variable, Volatile),
    End Collection,
    Usage Page (FFFFh),                                             ; FFFFh, vendor-defined
    Usage (10h),
    Collection (129),
        Usage (F0h),
        Report ID (240),
        Report Size (8),
        Report Count (1),
        Logical Minimum (0),
        Logical Maximum (255),
        Unit,
        Unit Exponent (0),
        Feature (Variable, Volatile),
        Usage (F1h),
        Report ID (241),
        Report Count (4),
        Feature (Variable, Volatile),
        Usage (FFh),
        Report ID (255),
        Report Size (8),
        Report Count (1),
        Logical Minimum (0),
        Logical Maximum (255),
        Unit,
        Unit Exponent (0),
        Feature (Variable, Volatile),
    End Collection,
End Collection
jimklimov commented 2 years ago

Wondering if this is (one of? the only?) point @nbriggs recommended to check recently, where I tried to cater to the two generations of libusb APIs and got it handling maths with signed/unsigned char buffers, so rdlen might come out -87 or some such.

I was busy with other fixes and did not get around to looking at this yet... and this might be the last currently known blocker for a release.

nbriggs commented 2 years ago

Yes, I think this is the same problem as #1261.

   0.213616     [D3] HID descriptor, method 2: (9 bytes) => 09 21 11 01 00 01 22 9c 05

My sense is that if the high bit is set in either of the last two bytes (above, 9c 05) then the computed descriptor length will be wrong. I would expect this to affect all USB connected devices using the HID code with libusb 0.1, so this would be a good thing to fix ASAP. I'll have a look at this again in a few hours and perhaps propose a fix.

nbriggs commented 2 years ago

A minimal fix would be:

diff --git a/drivers/libusb0.c b/drivers/libusb0.c
index adf098ba..e7f16c90 100644
--- a/drivers/libusb0.c
+++ b/drivers/libusb0.c
@@ -377,7 +377,7 @@ static int libusb_open(usb_dev_handle **udevp,

                                upsdebug_hex(3, "HID descriptor, method 1", buf, 9);

-                               rdlen1 = buf[7] | (buf[8] << 8);
+                               rdlen1 = (uint8_t)buf[7] | ((uint8_t)buf[8] << 8);
                        }

                        if (rdlen1 < -1) {

so that the code is being explicit about the interpretation of the bytes it is getting back from the call. @drunkly are you in a position to try this and let us know if it works better for you?

drunkly commented 2 years ago

Hi. Yes. I will try it and provide a feedback tomorrow early when I arrive to the office. Thanks for your efforts.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Nick Briggs @.> Sent: Monday, February 28, 2022 9:25:06 PM To: networkupstools/nut @.> Cc: drunkly @.>; Mention @.> Subject: Re: [networkupstools/nut] Salicru Twin Pro 2 (Issue #1312)

A minimal fix would be:

diff --git a/drivers/libusb0.c b/drivers/libusb0.c index adf098ba..e7f16c90 100644 --- a/drivers/libusb0.c +++ b/drivers/libusb0.c @@ -377,7 +377,7 @@ static int libusb_open(usb_dev_handle **udevp,

                            upsdebug_hex(3, "HID descriptor, method 1", buf, 9);

so that the code is being explicit about the interpretation of the bytes it is getting back from the call. @drunklyhttps://github.com/drunkly are you in a position to try this and let us know if it works better for you?

— Reply to this email directly, view it on GitHubhttps://github.com/networkupstools/nut/issues/1312#issuecomment-1054632125, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACJBQJLHQ6PRCIFDXU725HLU5PK2FANCNFSM5PAXBNGQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://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: @.***>

drunkly commented 2 years ago

I updated rdlen1 and test and after that did the same change for rdlen2. This are the resutls:

root@PROXMOX:~/nut# sudo ./drivers/usbhid-ups -DDDDDD -u root -x productid=0201 -a salicru
.....
   0.209795     [D2] Device does not match - skipping
   0.209905     [D2] Checking device (2E66/0201) (002/005)
   0.211532     [D2] - VendorID: 2e66
   0.211547     [D2] - ProductID: 0201
   0.211559     [D2] - Manufacturer: Salicru
   0.211566     [D2] - Product: SLC TWIN PRO2<=3KVA
   0.211574     [D2] - Serial Number: 232019D70264
   0.211582     [D2] - Bus: 002
   0.211589     [D2] - Device: 005
   0.211595     [D2] - Device release number: 0129
   0.211602     [D2] Trying to match device
   0.211610     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.211619     [D2] claim status: 2  for salicru subdriver failed
   0.211627     [D3] match_function_regex: matching a device...
   0.211751     [D2] Device matches
   0.211787     [D3] nut_usb_set_altinterface: skipped usb_set_altinterface(udev, 0)
   0.211950     [D3] HID descriptor, method 1: (9 bytes) => 09 21 11 01 00 01 22 9c 05
   0.211958     [D3] HID descriptor length (method 1) 1436
   0.211964     [D4] i=0, extra[i]=09, extra[i+1]=21
   0.211971     [D3] HID descriptor, method 2: (9 bytes) => 09 21 11 01 00 01 22 9c 05
   0.211974     [D3] HID descriptor length (method 2) 1436
   0.211978     [D2] HID descriptor length 1436
   0.219426     [D2] Report Descriptor size = 1436
   0.219446     [D3] Report Descriptor: (1436 bytes) => 05 84 09 04 a1 01 09 10 a1 00 09 12 a1
   0.219469     [D3]  00 09 13 85 20 75 08 95 01 15 00 26 ff 00 65 00 55 00 b1 03 06 ff ff 09 90
   0.219478     [D3]  85 21 b1 82 05 84 09 02 a1 02 09 60 85 27 75 08 26 ff 00 65 00 b1 83 09 60
   0.219488     [D3]  81 83 06 ff ff 09 74 b1 83 09 74 81 83 c0 05 84 09 58 85 24 b1 82 06 ff ff
   0.219498     [D3]  09 e3 85 e3 b1 82 09 45 85 25 75 20 27 ff ff ff 7f 66 01 10 b1 82 c0 05 84
   0.219507     [D3]  09 11 85 20 75 08 26 ff 00 65 00 b1 03 09 14 a1 00 09 15 b1 03 05 84 09 02
   0.219523     [D3]  a1 02 06 ff ff 09 79 85 27 b1 83 09 79 81 83 05 84 09 62 b1 83 09 62 81 83
   0.219538     [D3]  09 6d b1 83 09 6d 81 83 c0 c0 c0 05 84 09 1e a1 81 09 42 85 14 66 01 f0 b1
   0.219555     [D3]  83 09 40 85 15 67 21 d1 f0 00 55 07 b1 83 09 1f 85 0b 65 00 55 00 b1 03 c0
   0.219568     [D3]  09 1e a1 84 09 44 85 74 75 10 27 ff ff 00 00 66 21 d1 55 07 b1 83 09 43 66
   0.219581     [D3]  21 d1 b1 83 09 42 85 36 75 08 26 ff 00 66 01 f0 55 00 b1 82 09 45 85 16 65
   0.219595     [D3]  00 b1 83 09 40 85 72 67 21 d1 f0 00 55 07 b1 82 09 1f 85 0b 65 00 55 00 b1
   0.219609     [D3]  03 c0 09 16 a1 00 06 ff ff 09 41 85 4a b1 03 09 42 85 4c b1 83 09 4f 85 4b
   0.219622     [D3]  b1 82 05 84 09 1a a1 81 06 ff ff 09 43 85 73 b1 82 09 94 85 c1 b1 82 05 84
   0.219636     [D3]  09 1f 85 30 b1 03 09 32 85 31 75 10 27 ff ff 00 00 66 01 f0 55 0f b1 83 09
   0.219649     [D3]  1b 85 30 75 08 26 ff 00 65 00 55 00 b1 03 09 02 a1 02 09 64 85 32 b1 83 09
   0.219663     [D3]  64 81 83 09 63 b1 83 09 63 81 83 06 ff ff 09 78 b1 83 09 78 81 83 c0 05 84
   0.219676     [D3]  09 30 85 31 75 10 27 ff ff 00 00 67 21 d1 f0 00 55 07 b1 83 c0 05 84 09 1a
   0.219693     [D3]  a1 82 06 ff ff 09 72 85 51 75 08 26 ff 00 65 00 b1 82 05 84 09 1f 85 2f 75
   0.219710     [D3]  08 26 ff 00 65 00 55 00 b1 03 05 84 09 32 85 37 75 10 27 ff ff 00 00 66 01
   0.219727     [D3]  f0 55 0f b1 83 09 1b 85 2f 75 08 26 ff 00 65 00 55 00 b1 03 06 ff ff 09 54
   0.219741     [D3]  85 34 b1 82 05 84 09 02 a1 02 09 64 85 38 b1 83 09 64 81 83 09 61 b1 83 09
   0.219754     [D3]  61 81 83 09 65 b1 83 09 65 81 83 05 84 09 6d b1 83 09 6d 81 83 09 63 b1 83
   0.219779     [D3]  09 63 81 83 c0 09 6c 85 2d b1 82 09 30 85 37 75 10 27 ff ff 00 00 67 21 d1
   0.219797     [D3]  f0 00 55 07 b1 83 c0 05 84 09 1a a1 83 06 ff ff 09 46 85 39 75 08 26 ff 00
   0.219812     [D3]  65 00 55 00 b1 82 05 84 09 1f 85 30 b1 03 09 1b b1 03 09 02 a1 02 09 6d 85
   0.219826     [D3]  3b b1 83 09 6d 81 83 c0 06 ff ff 09 47 85 3a b1 82 c0 05 84 09 1a a1 85 09
   0.219840     [D3]  1f 85 30 b1 03 09 1b b1 03 09 02 a1 02 09 6d 85 3c b1 83 09 6d 81 83 c0 09
   0.219854     [D3]  6c 85 3f b1 82 c0 09 14 a1 00 09 15 85 40 b1 03 05 84 09 02 a1 02 09 6d 85
   0.219866     [D3]  41 b1 83 09 6d 81 83 06 ff ff 09 74 85 3e b1 83 09 74 81 83 09 75 b1 83 09
   0.219878     [D3]  75 81 83 c0 c0 05 84 09 1c a1 00 09 34 85 42 75 10 27 ff ff 00 00 66 21 d1
   0.219891     [D3]  55 07 b1 83 09 33 66 21 d1 b1 83 09 1f 85 40 75 08 26 ff 00 65 00 55 00 b1
   0.219905     [D3]  03 05 84 09 32 85 42 75 10 27 ff ff 00 00 66 01 f0 55 0f b1 83 06 ff ff 09
   0.219917     [D3]  f8 85 f8 75 10 27 ff ff 00 00 66 01 f0 55 0f b1 82 09 f9 85 f9 b1 82 09 fb
   0.219930     [D3]  85 fb 75 08 26 ff 00 65 00 55 00 b1 82 09 fc 85 fc b1 82 06 ff ff 09 58 85
   0.219942     [D3]  46 75 10 27 ff ff 00 00 67 21 d1 f0 00 55 07 b1 82 09 57 85 45 b1 82 06 ff
   0.219955     [D3]  ff 09 5b 85 68 75 08 15 00 26 ff 00 65 00 55 00 b1 82 09 5a 85 69 b1 82 05
   0.219969     [D3]  84 09 54 85 48 75 10 27 ff ff 00 00 67 21 d1 f0 00 55 07 b1 82 05 84 09 53
   0.219978     [D3]  85 47 b1 82 09 1d 85 40 75 08 26 ff 00 65 00 55 00 b1 03 05 84 09 02 a1 02
   0.219986     [D3]  06 ff ff 09 4a 85 49 65 00 b1 83 09 4a 81 83 c0 05 84 09 30 85 42 75 10 27
   0.219994     [D3]  ff ff 00 00 67 21 d1 f0 00 55 07 b1 83 c0 09 17 85 40 75 08 26 ff 00 65 00
   0.220002     [D3]  55 00 b1 03 c0 09 24 a1 00 09 5a 85 13 b1 82 05 85 09 8d 85 0c b1 03 09 2c
   0.220011     [D3]  b1 03 05 84 09 40 85 0d 67 21 d1 f0 00 55 07 b1 03 06 ff ff 09 95 85 0b 65
   0.220018     [D3]  00 55 00 b1 03 05 84 09 57 85 09 75 20 15 ff 27 ff ff ff 7f 66 01 10 b1 82
   0.220026     [D3]  09 56 85 0a b1 82 05 85 09 83 85 0c 75 08 15 00 26 ff 00 65 00 b1 03 05 84
   0.220034     [D3]  09 1f 85 0b 65 00 b1 03 05 85 09 67 85 0c 65 00 b1 03 09 89 85 10 65 00 b1
   0.220041     [D3]  03 05 84 09 fd b1 03 06 ff ff 09 f0 b1 03 05 84 09 fe b1 03 05 84 09 ff b1
   0.220049     [D3]  03 06 ff ff 09 f1 b1 03 09 f2 b1 03 09 e2 85 e2 b1 83 05 84 09 35 85 07 65
   0.220057     [D3]  00 b1 83 09 25 85 0b 65 00 b1 03 06 ff ff 09 94 85 e1 65 00 b1 83 05 84 09
   0.220069     [D3]  02 a1 02 05 85 09 d0 85 01 b1 83 09 d0 81 83 09 42 b1 83 09 42 81 83 09 44
   0.220077     [D3]  b1 83 09 44 81 83 09 45 85 01 b1 83 09 45 81 83 06 ff ff 85 03 09 77 b1 83
   0.220084     [D3]  09 77 81 83 05 84 09 61 85 01 b1 83 09 61 81 83 09 62 85 02 b1 83 09 62 81
   0.220091     [D3]  83 05 85 09 4b b1 83 09 4b 81 83 05 84 09 65 b1 83 09 65 81 83 09 67 85 03
   0.220099     [D3]  b1 83 09 67 81 83 c0 05 85 09 66 85 06 65 00 b1 83 09 66 81 83 05 85 09 68
   0.220107     [D3]  85 06 75 20 27 ff ff ff 7f 66 01 10 b1 83 09 68 81 83 05 84 09 30 85 07 75
   0.220114     [D3]  10 95 01 27 ff ff 00 00 67 21 d1 f0 00 55 06 b1 83 c0 06 ff ff 09 10 a1 81
   0.220122     [D3]  09 f0 85 f0 75 08 95 01 15 00 26 ff 00 65 00 55 00 b1 82 09 f1 85 f1 95 04
   0.220129     [D3]  b1 82 09 ff 85 ff 75 08 95 01 15 00 26 ff 00 65 00 55 00 b1 82 c0 c0
   0.220207     [D2] claim status: 2  for salicru subdriver failed
   0.220214     Using subdriver: Salicru HID 0.3
   0.220221     [D1] 144 HID objects found
   0.220234     [D4] Entering libusb_get_report
   0.220381     [D3] Report[get]: (4 bytes) => 20 01 01 01
   0.220390     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.220395     [D5] Unit = 00000000, UnitExp = 0
   0.220400     [D5] Exponent = 0
   0.220406     [D5] hid_lookup_path: 00840004 -> UPS
   0.220410     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.220415     [D5] hid_lookup_path: 00840012 -> Battery
   0.220426     [D5] hid_lookup_path: 00840013 -> BatteryID
   0.220436     [D1] Path: UPS.BatterySystem.Battery.BatteryID, Type: Feature, ReportID: 0x20, Offset: 0, Size: 8, Value: 1
   0.220444     [D4] Entering libusb_get_report
   0.220583     [D3] Report[get]: (2 bytes) => 21 00
   0.220589     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.220593     [D5] Unit = 00000000, UnitExp = 0
   0.220599     [D5] Exponent = 0
   0.220604     [D5] hid_lookup_path: 00840004 -> UPS
   0.220608     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.220613     [D5] hid_lookup_path: 00840012 -> Battery
   0.220618     [D5] hid_lookup_path: ffff0090 -> not found in lookup table
   0.220628     [D1] Path: UPS.BatterySystem.Battery.ffff0090, Type: Feature, ReportID: 0x21, Offset: 0, Size: 8, Value: 0
   0.220637     [D4] Entering libusb_get_report
   0.220782     [D3] Report[get]: (6 bytes) => 27 01 00 00 00 01
   0.220789     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.220792     [D5] Unit = 00000000, UnitExp = 0
   0.220798     [D5] Exponent = 0
   0.220804     [D5] hid_lookup_path: 00840004 -> UPS
   0.220810     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.220817     [D5] hid_lookup_path: 00840012 -> Battery
   0.220823     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.220827     [D5] hid_lookup_path: 00840060 -> Present
   0.220837     [D1] Path: UPS.BatterySystem.Battery.PresentStatus.Present, Type: Feature, ReportID: 0x27, Offset: 0, Size: 8, Value: 1
   0.220847     [D3] Report[buf]: (6 bytes) => 27 01 00 00 00 01
   0.220856     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.220864     [D5] Unit = 00000000, UnitExp = 0
   0.220872     [D5] Exponent = 0
   0.220880     [D5] hid_lookup_path: 00840004 -> UPS
   0.220888     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.220896     [D5] hid_lookup_path: 00840012 -> Battery
   0.220904     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.220912     [D5] hid_lookup_path: 00840060 -> Present
   0.220921     [D1] Path: UPS.BatterySystem.Battery.PresentStatus.Present, Type: Input, ReportID: 0x27, Offset: 0, Size: 8, Value: 1
   0.220930     [D3] Report[buf]: (6 bytes) => 27 01 00 00 00 01
   0.220938     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.220946     [D5] Unit = 00000000, UnitExp = 0
   0.220954     [D5] Exponent = 0
   0.220962     [D5] hid_lookup_path: 00840004 -> UPS
   0.220970     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.220978     [D5] hid_lookup_path: 00840012 -> Battery
   0.220986     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.220994     [D5] hid_lookup_path: ffff0074 -> not found in lookup table
   0.221003     [D1] Path: UPS.BatterySystem.Battery.PresentStatus.ffff0074, Type: Feature, ReportID: 0x27, Offset: 8, Size: 8, Value: 0
   0.221012     [D3] Report[buf]: (6 bytes) => 27 01 00 00 00 01
   0.221018     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.221027     [D5] Unit = 00000000, UnitExp = 0
   0.221035     [D5] Exponent = 0
   0.221043     [D5] hid_lookup_path: 00840004 -> UPS
   0.221051     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.221062     [D5] hid_lookup_path: 00840012 -> Battery
   0.221070     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.221078     [D5] hid_lookup_path: ffff0074 -> not found in lookup table
   0.221087     [D1] Path: UPS.BatterySystem.Battery.PresentStatus.ffff0074, Type: Input, ReportID: 0x27, Offset: 8, Size: 8, Value: 0
   0.221094     [D4] Entering libusb_get_report
   0.221233     [D3] Report[get]: (2 bytes) => 24 01
   0.221239     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.221247     [D5] Unit = 00000000, UnitExp = 0
   0.221253     [D5] Exponent = 0
   0.221257     [D5] hid_lookup_path: 00840004 -> UPS
   0.221261     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.221266     [D5] hid_lookup_path: 00840012 -> Battery
   0.221271     [D5] hid_lookup_path: 00840058 -> Test
   0.221276     [D1] Path: UPS.BatterySystem.Battery.Test, Type: Feature, ReportID: 0x24, Offset: 0, Size: 8, Value: 1
   0.221281     [D4] Entering libusb_get_report
   0.221518     [D3] Report[get]: (2 bytes) => e3 00
   0.221523     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.221527     [D5] Unit = 00000000, UnitExp = 0
   0.221529     [D5] Exponent = 0
   0.221534     [D5] hid_lookup_path: 00840004 -> UPS
   0.221538     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.221544     [D5] hid_lookup_path: 00840012 -> Battery
   0.221549     [D5] hid_lookup_path: ffff00e3 -> not found in lookup table
   0.221555     [D1] Path: UPS.BatterySystem.Battery.ffff00e3, Type: Feature, ReportID: 0xe3, Offset: 0, Size: 8, Value: 0
   0.221559     [D4] Entering libusb_get_report
   0.221722     [D3] Report[get]: (5 bytes) => 25 00 ea 24 00
   0.221731     [D5] PhyMax = 0, PhyMin = 0, LogMax = 2147483647, LogMin = 0
   0.221735     [D5] Unit = 00001001, UnitExp = 0
   0.221740     [D5] Exponent = 0
   0.221746     [D5] hid_lookup_path: 00840004 -> UPS
   0.221752     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.221756     [D5] hid_lookup_path: 00840012 -> Battery
   0.221762     [D5] hid_lookup_path: ffff0045 -> not found in lookup table
   0.221771     [D1] Path: UPS.BatterySystem.Battery.ffff0045, Type: Feature, ReportID: 0x25, Offset: 0, Size: 32, Value: 2.4192e+06
   0.221777     [D3] Report[buf]: (4 bytes) => 20 01 01 01
   0.221782     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.221790     [D5] Unit = 00000000, UnitExp = 0
   0.221795     [D5] Exponent = 0
   0.221807     [D5] hid_lookup_path: 00840004 -> UPS
   0.221814     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.221821     [D5] hid_lookup_path: 00840011 -> BatterySystemID
   0.221827     [D1] Path: UPS.BatterySystem.BatterySystemID, Type: Feature, ReportID: 0x20, Offset: 8, Size: 8, Value: 1
   0.221833     [D3] Report[buf]: (4 bytes) => 20 01 01 01
   0.221839     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.221844     [D5] Unit = 00000000, UnitExp = 0
   0.221849     [D5] Exponent = 0
   0.221855     [D5] hid_lookup_path: 00840004 -> UPS
   0.221860     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.221866     [D5] hid_lookup_path: 00840014 -> Charger
   0.221871     [D5] hid_lookup_path: 00840015 -> ChargerID
   0.221877     [D1] Path: UPS.BatterySystem.Charger.ChargerID, Type: Feature, ReportID: 0x20, Offset: 16, Size: 8, Value: 1
   0.221883     [D3] Report[buf]: (6 bytes) => 27 01 00 00 00 01
   0.221888     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.221894     [D5] Unit = 00000000, UnitExp = 0
   0.221899     [D5] Exponent = 0
   0.221904     [D5] hid_lookup_path: 00840004 -> UPS
   0.221910     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.221915     [D5] hid_lookup_path: 00840014 -> Charger
   0.221921     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.221926     [D5] hid_lookup_path: ffff0079 -> not found in lookup table
   0.221940     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.ffff0079, Type: Feature, ReportID: 0x27, Offset: 16, Size: 8, Value: 0
   0.221946     [D3] Report[buf]: (6 bytes) => 27 01 00 00 00 01
   0.221952     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.221959     [D5] Unit = 00000000, UnitExp = 0
   0.221965     [D5] Exponent = 0
   0.221971     [D5] hid_lookup_path: 00840004 -> UPS
   0.221978     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.221985     [D5] hid_lookup_path: 00840014 -> Charger
   0.221991     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.221998     [D5] hid_lookup_path: ffff0079 -> not found in lookup table
   0.222005     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.ffff0079, Type: Input, ReportID: 0x27, Offset: 16, Size: 8, Value: 0
   0.222013     [D3] Report[buf]: (6 bytes) => 27 01 00 00 00 01
   0.222019     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.222025     [D5] Unit = 00000000, UnitExp = 0
   0.222031     [D5] Exponent = 0
   0.222036     [D5] hid_lookup_path: 00840004 -> UPS
   0.222044     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.222052     [D5] hid_lookup_path: 00840014 -> Charger
   0.222060     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.222069     [D5] hid_lookup_path: 00840062 -> InternalFailure
   0.222078     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.InternalFailure, Type: Feature, ReportID: 0x27, Offset: 24, Size: 8, Value: 0
   0.222087     [D3] Report[buf]: (6 bytes) => 27 01 00 00 00 01
   0.222095     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.222103     [D5] Unit = 00000000, UnitExp = 0
   0.222111     [D5] Exponent = 0
   0.222118     [D5] hid_lookup_path: 00840004 -> UPS
   0.222126     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.222133     [D5] hid_lookup_path: 00840014 -> Charger
   0.222139     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.222145     [D5] hid_lookup_path: 00840062 -> InternalFailure
   0.222152     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.InternalFailure, Type: Input, ReportID: 0x27, Offset: 24, Size: 8, Value: 0
   0.222161     [D3] Report[buf]: (6 bytes) => 27 01 00 00 00 01
   0.222167     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.222174     [D5] Unit = 00000000, UnitExp = 0
   0.222180     [D5] Exponent = 0
   0.222185     [D5] hid_lookup_path: 00840004 -> UPS
   0.222190     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.222195     [D5] hid_lookup_path: 00840014 -> Charger
   0.222200     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.222205     [D5] hid_lookup_path: 0084006d -> Used
   0.222210     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.Used, Type: Feature, ReportID: 0x27, Offset: 32, Size: 8, Value: 1
   0.222215     [D3] Report[buf]: (6 bytes) => 27 01 00 00 00 01
   0.222220     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.222225     [D5] Unit = 00000000, UnitExp = 0
   0.222230     [D5] Exponent = 0
   0.222235     [D5] hid_lookup_path: 00840004 -> UPS
   0.222239     [D5] hid_lookup_path: 00840010 -> BatterySystem
   0.222243     [D5] hid_lookup_path: 00840014 -> Charger
   0.222247     [D5] hid_lookup_path: 00840002 -> PresentStatus
   0.222251     [D5] hid_lookup_path: 0084006d -> Used
   0.222256     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.Used, Type: Input, ReportID: 0x27, Offset: 32, Size: 8, Value: 1
   0.222261     [D4] Entering libusb_get_report
   0.222402     [D3] Report[get]: (2 bytes) => 14 32
   0.222410     [D5] PhyMax = 0, PhyMin = 0, LogMax = 255, LogMin = 0
   0.222418     [D5] Unit = 0000f001, UnitExp = 0
   0.222424     [D5] Exponent = 0
   0.222431     [D5] hid_lookup_path: 00840004 -> UPS
   0.222437     [D5] hid_lookup_path: 0084001e -> Flow
   0.222444     [D5] hid_lookup_path: 00ff0001 -> not found in lookup table
   0.222451     [D5] hid_lookup_path: 00840042 -> ConfigFrequency
   0.222459     [D1] Path: UPS.Flow.[1].ConfigFrequency, Type: Feature, ReportID: 0x14, Offset: 0, Size: 8, Value: 50
   0.222465     [D4] Entering libusb_get_report
.....

Then the proccess enter like in a infinite loop retrieving info what I don't know if is expected.

I tested also the driverctl which looks like is detecting welll the ups:


root@PROXMOX:~/nut# ./drivers/upsdrvctl -DD -d start
Network UPS Tools - UPS driver controller 2.7.4-4755-ga1454772
   0.000000     [D1] Starting UPS: salicru
   0.000020     [D2] 3 remaining attempts
   0.000030     [D2] exec:  /usr/local/ups/bin/usbhid-ups -DD -a salicru
Network UPS Tools - Generic HID driver 0.45 (2.7.4-4755-ga1454772)
USB communication driver (libusb 0.1) 0.42
   0.000000     [D1] debug level is '2'
   0.001243     [D2] Initializing an USB-connected UPS with library libusb-0.1 (or compat) (NUT subdriver name='USB communication driver (libusb 0.1)' ver='0.42')
   0.001255     [D1] upsdrv_initups (non-SHUT)...
   0.137153     [D2] Checking device (8087/8002) (004/002)
   0.209299     [D2] - VendorID: 8087
   0.209316     [D2] - ProductID: 8002
   0.209321     [D2] - Manufacturer: unknown
   0.209335     [D2] - Product: unknown
   0.209345     [D2] - Serial Number: unknown
   0.209352     [D2] - Bus: 004
   0.209357     [D2] - Device: 002
   0.209363     [D2] - Device release number: 0005
   0.209368     [D2] Trying to match device
   0.209373     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.209383     [D2] claim status: 0  for salicru subdriver failed
   0.209389     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.209394     [D2] Device does not match - skipping
   0.209411     [D2] Checking device (1D6B/0002) (004/001)
   0.209444     [D2] - VendorID: 1d6b
   0.209450     [D2] - ProductID: 0002
   0.209455     [D2] - Manufacturer: unknown
   0.209472     [D2] - Product: unknown
   0.209497     [D2] - Serial Number: unknown
   0.209502     [D2] - Bus: 004
   0.209506     [D2] - Device: 001
   0.209510     [D2] - Device release number: 0504
   0.209515     [D2] Trying to match device
   0.209519     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.209525     [D2] claim status: 0  for salicru subdriver failed
   0.209530     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.209535     [D2] Device does not match - skipping
   0.209544     [D2] Checking device (1D6B/0003) (003/001)
   0.209705     [D2] - VendorID: 1d6b
   0.209714     [D2] - ProductID: 0003
   0.209717     [D2] - Manufacturer: unknown
   0.209720     [D2] - Product: unknown
   0.209724     [D2] - Serial Number: unknown
   0.209731     [D2] - Bus: 003
   0.209738     [D2] - Device: 001
   0.209745     [D2] - Device release number: 0504
   0.209751     [D2] Trying to match device
   0.209757     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.209766     [D2] claim status: 0  for salicru subdriver failed
   0.209774     [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.209782     [D2] Device does not match - skipping
   0.209791     [D2] Checking device (2E66/0201) (002/005)
   0.211338     [D2] - VendorID: 2e66
   0.211352     [D2] - ProductID: 0201
   0.211361     [D2] - Manufacturer: Salicru
   0.211368     [D2] - Product: SLC TWIN PRO2<=3KVA
   0.211375     [D2] - Serial Number: 232019D70264
   0.211381     [D2] - Bus: 002
   0.211388     [D2] - Device: 005
   0.211395     [D2] - Device release number: 0129
   0.211402     [D2] Trying to match device
   0.211409     [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.211419     [D2] claim status: 2  for salicru subdriver failed
   0.211551     [D2] Device matches
   0.211569     [D2] failed to claim USB device: could not claim interface 0: Device or resource busy
   0.211648     [D2] detached kernel driver from USB device...
   0.211835     [D2] HID descriptor length 1436
   0.219297     [D2] Report Descriptor size = 1436
   0.219379     [D2] claim status: 2  for salicru subdriver failed
   0.219390     Using subdriver: Salicru HID 0.3
   0.219398     [D1] 144 HID objects found
   0.219547     [D1] Path: UPS.BatterySystem.Battery.BatteryID, Type: Feature, ReportID: 0x20, Offset: 0, Size: 8, Value: 1
   0.219693     [D1] Path: UPS.BatterySystem.Battery.ffff0090, Type: Feature, ReportID: 0x21, Offset: 0, Size: 8, Value: 0
   0.219890     [D1] Path: UPS.BatterySystem.Battery.PresentStatus.Present, Type: Feature, ReportID: 0x27, Offset: 0, Size: 8, Value: 1
   0.219900     [D1] Path: UPS.BatterySystem.Battery.PresentStatus.Present, Type: Input, ReportID: 0x27, Offset: 0, Size: 8, Value: 1
   0.219907     [D1] Path: UPS.BatterySystem.Battery.PresentStatus.ffff0074, Type: Feature, ReportID: 0x27, Offset: 8, Size: 8, Value: 0
   0.219915     [D1] Path: UPS.BatterySystem.Battery.PresentStatus.ffff0074, Type: Input, ReportID: 0x27, Offset: 8, Size: 8, Value: 0
   0.220058     [D1] Path: UPS.BatterySystem.Battery.Test, Type: Feature, ReportID: 0x24, Offset: 0, Size: 8, Value: 1
   0.220317     [D1] Path: UPS.BatterySystem.Battery.ffff00e3, Type: Feature, ReportID: 0xe3, Offset: 0, Size: 8, Value: 0
   0.220462     [D1] Path: UPS.BatterySystem.Battery.ffff0045, Type: Feature, ReportID: 0x25, Offset: 0, Size: 32, Value: 2.4192e+06
   0.220473     [D1] Path: UPS.BatterySystem.BatterySystemID, Type: Feature, ReportID: 0x20, Offset: 8, Size: 8, Value: 1
   0.220482     [D1] Path: UPS.BatterySystem.Charger.ChargerID, Type: Feature, ReportID: 0x20, Offset: 16, Size: 8, Value: 1
   0.220490     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.ffff0079, Type: Feature, ReportID: 0x27, Offset: 16, Size: 8, Value: 0
   0.220498     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.ffff0079, Type: Input, ReportID: 0x27, Offset: 16, Size: 8, Value: 0
   0.220507     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.InternalFailure, Type: Feature, ReportID: 0x27, Offset: 24, Size: 8, Value: 0
   0.220515     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.InternalFailure, Type: Input, ReportID: 0x27, Offset: 24, Size: 8, Value: 0
   0.220525     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.Used, Type: Feature, ReportID: 0x27, Offset: 32, Size: 8, Value: 1
   0.220534     [D1] Path: UPS.BatterySystem.Charger.PresentStatus.Used, Type: Input, ReportID: 0x27, Offset: 32, Size: 8, Value: 1
   0.220675     [D1] Path: UPS.Flow.[1].ConfigFrequency, Type: Feature, ReportID: 0x14, Offset: 0, Size: 8, Value: 50
   0.220817     [D1] Path: UPS.Flow.[1].ConfigVoltage, Type: Feature, ReportID: 0x15, Offset: 0, Size: 8, Value: 230
   0.220931     [D1] Path: UPS.Flow.[1].FlowID, Type: Feature, ReportID: 0x0b, Offset: 0, Size: 8, Value: 1
   0.221158     [D1] Path: UPS.Flow.[4].ConfigActivePower, Type: Feature, ReportID: 0x74, Offset: 0, Size: 16, Value: 630
   0.221192     [D1] Path: UPS.Flow.[4].ConfigApparentPower, Type: Feature, ReportID: 0x74, Offset: 16, Size: 16, Value: 700
   0.221364     [D1] Path: UPS.Flow.[4].ConfigFrequency, Type: Feature, ReportID: 0x36, Offset: 0, Size: 8, Value: 50
   0.221509     [D1] Path: UPS.Flow.[4].ConfigPercentLoad, Type: Feature, ReportID: 0x16, Offset: 0, Size: 8, Value: 100
   0.221733     [D1] Path: UPS.Flow.[4].ConfigVoltage, Type: Feature, ReportID: 0x72, Offset: 0, Size: 8, Value: 230
   0.221752     [D1] Path: UPS.Flow.[4].FlowID, Type: Feature, ReportID: 0x0b, Offset: 8, Size: 8, Value: 4
   0.221950     [D1] Path: UPS.PowerConverter.ffff0041, Type: Feature, ReportID: 0x4a, Offset: 0, Size: 8, Value: 2
   0.222179     [D1] Path: UPS.PowerConverter.ffff0042, Type: Feature, ReportID: 0x4c, Offset: 0, Size: 8, Value: 1
   0.222373     [D1] Path: UPS.PowerConverter.ffff004f, Type: Feature, ReportID: 0x4b, Offset: 0, Size: 8, Value: 0
   0.222590     [D1] Path: UPS.PowerConverter.Input.[1].ffff0043, Type: Feature, ReportID: 0x73, Offset: 0, Size: 8, Value: 1
   0.222818     [D1] Path: UPS.PowerConverter.Input.[1].ffff0094, Type: Feature, ReportID: 0xc1, Offset: 0, Size: 8, Value: 0
   0.222989     [D1] Path: UPS.PowerConverter.Input.[1].FlowID, Type: Feature, ReportID: 0x30, Offset: 0, Size: 8, Value: 1
   0.223160     [D1] Path: UPS.PowerConverter.Input.[1].Frequency, Type: Feature, ReportID: 0x31, Offset: 0, Size: 16, Value: 50
   0.223171     [D1] Path: UPS.PowerConverter.Input.[1].InputID, Type: Feature, ReportID: 0x30, Offset: 8, Size: 8, Value: 1
   0.223344     [D1] Path: UPS.PowerConverter.Input.[1].PresentStatus.FrequencyOutOfRange, Type: Feature, ReportID: 0x32, Offset: 0, Size: 8, Value: 0
   0.223356     [D1] Path: UPS.PowerConverter.Input.[1].PresentStatus.FrequencyOutOfRange, Type: Input, ReportID: 0x32, Offset: 0, Size: 8, Value: 0
   0.223363     [D1] Path: UPS.PowerConverter.Input.[1].PresentStatus.VoltageOutOfRange, Type: Feature, ReportID: 0x32, Offset: 8, Size: 8, Value: 0
   0.223370     [D1] Path: UPS.PowerConverter.Input.[1].PresentStatus.VoltageOutOfRange, Type: Input, ReportID: 0x32, Offset: 8, Size: 8, Value: 0
   0.223378     [D1] Path: UPS.PowerConverter.Input.[1].PresentStatus.ffff0078, Type: Feature, ReportID: 0x32, Offset: 16, Size: 8, Value: 0
   0.223387     [D1] Path: UPS.PowerConverter.Input.[1].PresentStatus.ffff0078, Type: Input, ReportID: 0x32, Offset: 16, Size: 8, Value: 0
   0.223397     [D1] Path: UPS.PowerConverter.Input.[1].Voltage, Type: Feature, ReportID: 0x31, Offset: 16, Size: 16, Value: 236
   0.223623     [D1] Path: UPS.PowerConverter.Input.[2].ffff0072, Type: Feature, ReportID: 0x51, Offset: 0, Size: 8, Value: 1e+07
   0.223763     [D1] Path: UPS.PowerConverter.Input.[2].FlowID, Type: Feature, ReportID: 0x2f, Offset: 0, Size: 8, Value: 1
   0.223928     [D1] Path: UPS.PowerConverter.Input.[2].Frequency, Type: Feature, ReportID: 0x37, Offset: 0, Size: 16, Value: 50
   0.223938     [D1] Path: UPS.PowerConverter.Input.[2].InputID, Type: Feature, ReportID: 0x2f, Offset: 8, Size: 8, Value: 2
   0.224106     [D1] Path: UPS.PowerConverter.Input.[2].ffff0054, Type: Feature, ReportID: 0x34, Offset: 0, Size: 8, Value: 1
   0.224276     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.FrequencyOutOfRange, Type: Feature, ReportID: 0x38, Offset: 0, Size: 8, Value: 0
   0.224289     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.FrequencyOutOfRange, Type: Input, ReportID: 0x38, Offset: 0, Size: 8, Value: 0
   0.224305     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.Good, Type: Feature, ReportID: 0x38, Offset: 8, Size: 8, Value: 1
   0.224316     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.Good, Type: Input, ReportID: 0x38, Offset: 8, Size: 8, Value: 1
   0.224328     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.Overload, Type: Feature, ReportID: 0x38, Offset: 16, Size: 8, Value: 0
   0.224337     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.Overload, Type: Input, ReportID: 0x38, Offset: 16, Size: 8, Value: 0
   0.224343     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.Used, Type: Feature, ReportID: 0x38, Offset: 24, Size: 8, Value: 0
   0.224351     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.Used, Type: Input, ReportID: 0x38, Offset: 24, Size: 8, Value: 0
   0.224358     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.VoltageOutOfRange, Type: Feature, ReportID: 0x38, Offset: 32, Size: 8, Value: 0
   0.224364     [D1] Path: UPS.PowerConverter.Input.[2].PresentStatus.VoltageOutOfRange, Type: Input, ReportID: 0x38, Offset: 32, Size: 8, Value: 0
   0.224501     [D1] Path: UPS.PowerConverter.Input.[2].Switchable, Type: Feature, ReportID: 0x2d, Offset: 0, Size: 8, Value: 1
   0.224509     [D1] Path: UPS.PowerConverter.Input.[2].Voltage, Type: Feature, ReportID: 0x37, Offset: 16, Size: 16, Value: 236
   0.224671     [D1] Path: UPS.PowerConverter.Input.[3].ffff0046, Type: Feature, ReportID: 0x39, Offset: 0, Size: 8, Value: 0
   0.224679     [D1] Path: UPS.PowerConverter.Input.[3].FlowID, Type: Feature, ReportID: 0x30, Offset: 16, Size: 8, Value: 3
   0.224684     [D1] Path: UPS.PowerConverter.Input.[3].InputID, Type: Feature, ReportID: 0x30, Offset: 24, Size: 8, Value: 3
   0.224839     [D1] Path: UPS.PowerConverter.Input.[3].PresentStatus.Used, Type: Feature, ReportID: 0x3b, Offset: 0, Size: 8, Value: 0
   0.224845     [D1] Path: UPS.PowerConverter.Input.[3].PresentStatus.Used, Type: Input, ReportID: 0x3b, Offset: 0, Size: 8, Value: 0
   0.225005     [D1] Path: UPS.PowerConverter.Input.[3].ffff0047, Type: Feature, ReportID: 0x3a, Offset: 0, Size: 8, Value: 1
   0.225011     [D1] Path: UPS.PowerConverter.Input.[5].FlowID, Type: Feature, ReportID: 0x30, Offset: 32, Size: 8, Value: 1
   0.225016     [D1] Path: UPS.PowerConverter.Input.[5].InputID, Type: Feature, ReportID: 0x30, Offset: 40, Size: 8, Value: 5
   0.225173     [D1] Path: UPS.PowerConverter.Input.[5].PresentStatus.Used, Type: Feature, ReportID: 0x3c, Offset: 0, Size: 8, Value: 1
   0.225179     [D1] Path: UPS.PowerConverter.Input.[5].PresentStatus.Used, Type: Input, ReportID: 0x3c, Offset: 0, Size: 8, Value: 1
   0.225372     [D1] Path: UPS.PowerConverter.Input.[5].Switchable, Type: Feature, ReportID: 0x3f, Offset: 0, Size: 8, Value: 1
   0.225579     [D1] Path: UPS.PowerConverter.Charger.ChargerID, Type: Feature, ReportID: 0x40, Offset: 0, Size: 8, Value: 1
   0.225767     [D1] Path: UPS.PowerConverter.Charger.PresentStatus.Used, Type: Feature, ReportID: 0x41, Offset: 0, Size: 8, Value: 0
   0.225775     [D1] Path: UPS.PowerConverter.Charger.PresentStatus.Used, Type: Input, ReportID: 0x41, Offset: 0, Size: 8, Value: 0
   0.225935     [D1] Path: UPS.PowerConverter.Charger.PresentStatus.ffff0074, Type: Feature, ReportID: 0x3e, Offset: 0, Size: 8, Value: 0
   0.225941     [D1] Path: UPS.PowerConverter.Charger.PresentStatus.ffff0074, Type: Input, ReportID: 0x3e, Offset: 0, Size: 8, Value: 0
   0.225947     [D1] Path: UPS.PowerConverter.Charger.PresentStatus.ffff0075, Type: Feature, ReportID: 0x3e, Offset: 8, Size: 8, Value: 0
   0.225952     [D1] Path: UPS.PowerConverter.Charger.PresentStatus.ffff0075, Type: Input, ReportID: 0x3e, Offset: 8, Size: 8, Value: 0
   0.226176     [D1] Path: UPS.PowerConverter.Output.ActivePower, Type: Feature, ReportID: 0x42, Offset: 0, Size: 16, Value: 125
   0.226183     [D1] Path: UPS.PowerConverter.Output.ApparentPower, Type: Feature, ReportID: 0x42, Offset: 16, Size: 16, Value: 154
   0.226189     [D1] Path: UPS.PowerConverter.Output.FlowID, Type: Feature, ReportID: 0x40, Offset: 8, Size: 8, Value: 4
   0.226194     [D1] Path: UPS.PowerConverter.Output.Frequency, Type: Feature, ReportID: 0x42, Offset: 32, Size: 16, Value: 50
   0.226435     [D1] Path: UPS.PowerConverter.Output.ffff00f8, Type: Feature, ReportID: 0xf8, Offset: 0, Size: 16, Value: 55
   0.226673     [D1] Path: UPS.PowerConverter.Output.ffff00f9, Type: Feature, ReportID: 0xf9, Offset: 0, Size: 16, Value: 45
   0.226916     [D1] Path: UPS.PowerConverter.Output.ffff00fb, Type: Feature, ReportID: 0xfb, Offset: 0, Size: 8, Value: 10
   0.227168     [D1] Path: UPS.PowerConverter.Output.ffff00fc, Type: Feature, ReportID: 0xfc, Offset: 0, Size: 8, Value: 10
   0.227374     [D1] Path: UPS.PowerConverter.Output.ffff0058, Type: Feature, ReportID: 0x46, Offset: 0, Size: 16, Value: 264
   0.227574     [D1] Path: UPS.PowerConverter.Output.ffff0057, Type: Feature, ReportID: 0x45, Offset: 0, Size: 16, Value: 184
   0.227796     [D1] Path: UPS.PowerConverter.Output.ffff005b, Type: Feature, ReportID: 0x68, Offset: 0, Size: 8, Value: 10
   0.228015     [D1] Path: UPS.PowerConverter.Output.ffff005a, Type: Feature, ReportID: 0x69, Offset: 0, Size: 8, Value: 10
   0.228210     [D1] Path: UPS.PowerConverter.Output.HighVoltageTransfer, Type: Feature, ReportID: 0x48, Offset: 0, Size: 16, Value: 300
   0.228406     [D1] Path: UPS.PowerConverter.Output.LowVoltageTransfer, Type: Feature, ReportID: 0x47, Offset: 0, Size: 16, Value: 100
   0.228415     [D1] Path: UPS.PowerConverter.Output.OutputID, Type: Feature, ReportID: 0x40, Offset: 16, Size: 8, Value: 1
   0.228604     [D1] Path: UPS.PowerConverter.Output.PresentStatus.ffff004a, Type: Feature, ReportID: 0x49, Offset: 0, Size: 8, Value: 0
   0.228612     [D1] Path: UPS.PowerConverter.Output.PresentStatus.ffff004a, Type: Input, ReportID: 0x49, Offset: 0, Size: 8, Value: 0
   0.228618     [D1] Path: UPS.PowerConverter.Output.Voltage, Type: Feature, ReportID: 0x42, Offset: 48, Size: 16, Value: 236
   0.228626     [D1] Path: UPS.PowerConverter.PowerConverterID, Type: Feature, ReportID: 0x40, Offset: 24, Size: 8, Value: 1
   0.228763     [D1] Path: UPS.PowerSummary.AudibleAlarmControl, Type: Feature, ReportID: 0x13, Offset: 0, Size: 8, Value: 2
   0.228878     [D1] Path: UPS.PowerSummary.CapacityGranularity1, Type: Feature, ReportID: 0x0c, Offset: 0, Size: 8, Value: 1
   0.228888     [D1] Path: UPS.PowerSummary.CapacityMode, Type: Feature, ReportID: 0x0c, Offset: 8, Size: 8, Value: 2
   0.229002     [D1] Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x0d, Offset: 0, Size: 8, Value: 24
   0.229008     [D1] Path: UPS.PowerSummary.ffff0095, Type: Feature, ReportID: 0x0b, Offset: 16, Size: 8, Value: 0
   0.229118     [D1] Path: UPS.PowerSummary.DelayBeforeShutdown, Type: Feature, ReportID: 0x09, Offset: 0, Size: 32, Value: -1
   0.229228     [D1] Path: UPS.PowerSummary.DelayBeforeStartup, Type: Feature, ReportID: 0x0a, Offset: 0, Size: 32, Value: -1
   0.229235     [D1] Path: UPS.PowerSummary.DesignCapacity, Type: Feature, ReportID: 0x0c, Offset: 16, Size: 8, Value: 100
   0.229240     [D1] Path: UPS.PowerSummary.FlowID, Type: Feature, ReportID: 0x0b, Offset: 24, Size: 8, Value: 4
   0.229247     [D1] Path: UPS.PowerSummary.FullChargeCapacity, Type: Feature, ReportID: 0x0c, Offset: 24, Size: 8, Value: 100
   0.229396     [D1] Path: UPS.PowerSummary.iDeviceChemistry, Type: Feature, ReportID: 0x10, Offset: 0, Size: 8, Value: 5
   0.229409     [D1] Path: UPS.PowerSummary.iManufacturer, Type: Feature, ReportID: 0x10, Offset: 8, Size: 8, Value: 1
   0.229419     [D1] Path: UPS.PowerSummary.ffff00f0, Type: Feature, ReportID: 0x10, Offset: 16, Size: 8, Value: 3
   0.229428     [D1] Path: UPS.PowerSummary.iProduct, Type: Feature, ReportID: 0x10, Offset: 24, Size: 8, Value: 2
   0.229436     [D1] Path: UPS.PowerSummary.iSerialNumber, Type: Feature, ReportID: 0x10, Offset: 32, Size: 8, Value: 4
   0.229444     [D1] Path: UPS.PowerSummary.ffff00f1, Type: Feature, ReportID: 0x10, Offset: 40, Size: 8, Value: 6
   0.229452     [D1] Path: UPS.PowerSummary.ffff00f2, Type: Feature, ReportID: 0x10, Offset: 48, Size: 8, Value: 8
   0.229706     [D1] Path: UPS.PowerSummary.ffff00e2, Type: Feature, ReportID: 0xe2, Offset: 0, Size: 8, Value: 19
   0.229844     [D1] Path: UPS.PowerSummary.PercentLoad, Type: Feature, ReportID: 0x07, Offset: 0, Size: 8, Value: 21
   0.229860     [D1] Path: UPS.PowerSummary.PowerSummaryID, Type: Feature, ReportID: 0x0b, Offset: 32, Size: 8, Value: 1
   0.230113     [D1] Path: UPS.PowerSummary.ffff0094, Type: Feature, ReportID: 0xe1, Offset: 0, Size: 8, Value: 8
   0.230246     [D1] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x01, Offset: 0, Size: 8, Value: 1
   0.230263     [D1] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Input, ReportID: 0x01, Offset: 0, Size: 8, Value: 1
   0.230273     [D1] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x01, Offset: 8, Size: 8, Value: 0
   0.230284     [D1] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Input, ReportID: 0x01, Offset: 8, Size: 8, Value: 0
   0.230294     [D1] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x01, Offset: 16, Size: 8, Value: 1
   0.230303     [D1] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Input, ReportID: 0x01, Offset: 16, Size: 8, Value: 1
   0.230312     [D1] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x01, Offset: 24, Size: 8, Value: 0
   0.230322     [D1] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Input, ReportID: 0x01, Offset: 24, Size: 8, Value: 0
   0.230450     [D1] Path: UPS.PowerSummary.PresentStatus.ffff0077, Type: Feature, ReportID: 0x03, Offset: 0, Size: 8, Value: 0
   0.230464     [D1] Path: UPS.PowerSummary.PresentStatus.ffff0077, Type: Input, ReportID: 0x03, Offset: 0, Size: 8, Value: 0
   0.230472     [D1] Path: UPS.PowerSummary.PresentStatus.Good, Type: Feature, ReportID: 0x01, Offset: 32, Size: 8, Value: 1
   0.230483     [D1] Path: UPS.PowerSummary.PresentStatus.Good, Type: Input, ReportID: 0x01, Offset: 32, Size: 8, Value: 1
   0.230600     [D1] Path: UPS.PowerSummary.PresentStatus.InternalFailure, Type: Feature, ReportID: 0x02, Offset: 0, Size: 8, Value: 0
   0.230612     [D1] Path: UPS.PowerSummary.PresentStatus.InternalFailure, Type: Input, ReportID: 0x02, Offset: 0, Size: 8, Value: 0
   0.230627     [D1] Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Feature, ReportID: 0x02, Offset: 8, Size: 8, Value: 0
   0.230637     [D1] Path: UPS.PowerSummary.PresentStatus.NeedReplacement, Type: Input, ReportID: 0x02, Offset: 8, Size: 8, Value: 0
   0.230645     [D1] Path: UPS.PowerSummary.PresentStatus.Overload, Type: Feature, ReportID: 0x02, Offset: 16, Size: 8, Value: 0
   0.230652     [D1] Path: UPS.PowerSummary.PresentStatus.Overload, Type: Input, ReportID: 0x02, Offset: 16, Size: 8, Value: 0
   0.230658     [D1] Path: UPS.PowerSummary.PresentStatus.OverTemperature, Type: Feature, ReportID: 0x03, Offset: 8, Size: 8, Value: 0
   0.230671     [D1] Path: UPS.PowerSummary.PresentStatus.OverTemperature, Type: Input, ReportID: 0x03, Offset: 8, Size: 8, Value: 0
   0.230798     [D1] Path: UPS.PowerSummary.RemainingCapacity, Type: Feature, ReportID: 0x06, Offset: 0, Size: 8, Value: 100
   0.230809     [D1] Path: UPS.PowerSummary.RemainingCapacity, Type: Input, ReportID: 0x06, Offset: 0, Size: 8, Value: 100
   0.230821     [D1] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, ReportID: 0x06, Offset: 8, Size: 32, Value: 2907
   0.230827     [D1] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Input, ReportID: 0x06, Offset: 8, Size: 32, Value: 2907
   0.230833     [D1] Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x07, Offset: 8, Size: 16, Value: 27.5
   0.231074     [D1] Path: UPS.ffff0010.[1].ffff00f0, Type: Feature, ReportID: 0xf0, Offset: 0, Size: 8, Value: 0
   0.231353     [D2] refresh_report_buffer: expected 5 bytes, but got 2 instead
   0.231362     [D1] Path: UPS.ffff0010.[1].ffff00f1, Type: Feature, ReportID: 0xf1, Offset: 0, Size: 8, Value: 0
   0.231607     [D1] Path: UPS.ffff0010.[1].ffff00ff, Type: Feature, ReportID: 0xff, Offset: 0, Size: 8, Value: 0
   0.231633     [D2] Report descriptor retrieved (Reportlen = 1436)
   0.231639     [D2] Found HID device
   0.231646     [D1] Detected a UPS: Salicru/SLC TWIN PRO2<=3KVA
   0.231673     [D2] Path: UPS.PowerSummary.iDeviceChemistry, Type: Feature, ReportID: 0x10, Offset: 0, Size: 8, Value: 5
   0.232003     [D2] Path: UPS.PowerSummary.RemainingCapacity, Type: Feature, ReportID: 0x06, Offset: 0, Size: 8, Value: 100
   0.232025     [D2] Path: UPS.PowerSummary.RunTimeToEmpty, Type: Feature, ReportID: 0x06, Offset: 8, Size: 32, Value: 2907
   0.232051     [D2] Path: UPS.PowerSummary.ConfigVoltage, Type: Feature, ReportID: 0x0d, Offset: 0, Size: 8, Value: 24
   0.232067     [D2] Path: UPS.PowerSummary.Voltage, Type: Feature, ReportID: 0x07, Offset: 8, Size: 16, Value: 27.5
   0.232086     [D2] Path: UPS.PowerSummary.AudibleAlarmControl, Type: Feature, ReportID: 0x13, Offset: 0, Size: 8, Value: 2
   0.232112     [D2] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x01, Offset: 0, Size: 8, Value: 1
   0.232128     [D2] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x01, Offset: 16, Size: 8, Value: 1
   0.232143     [D2] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x01, Offset: 24, Size: 8, Value: 0
   0.232157     [D2] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x01, Offset: 8, Size: 8, Value: 0
   0.232203     [D2] Path: UPS.PowerConverter.Output.HighVoltageTransfer, Type: Feature, ReportID: 0x48, Offset: 0, Size: 16, Value: 300
   0.232221     [D2] Path: UPS.PowerConverter.Output.LowVoltageTransfer, Type: Feature, ReportID: 0x47, Offset: 0, Size: 16, Value: 100
   0.232243     [D2] find_nut_info: unknown info type: load.off.delay
   0.232255     [D2] find_nut_info: unknown info type: load.on.delay
   0.232264     [D2] find_nut_info: unknown info type: load.off.delay
   0.232281     [D1] upsdrv_initinfo...
   0.232293     [D1] upsdrv_updateinfo...
   0.983127     [D2] libusb_get_interrupt: Connection timed out
   0.983147     [D1] Got 0 HID objects...
   0.983154     [D1] Quick update...
   0.983173     [D2] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x01, Offset: 0, Size: 8, Value: 1
   0.983180     [D2] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x01, Offset: 16, Size: 8, Value: 1
   0.983188     [D2] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x01, Offset: 24, Size: 8, Value: 0
   0.983195     [D2] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x01, Offset: 8, Size: 8, Value: 0
   0.983305     [D2] dstate_init: sock /var/state/ups/usbhid-ups-salicru open on fd 5
   0.983324     [D1] upsdrv_updateinfo...
   1.733701     [D2] libusb_get_interrupt: Connection timed out
   1.733719     [D1] Got 0 HID objects...
   1.733726     [D1] Quick update...
   1.733858     [D2] Path: UPS.PowerSummary.PresentStatus.ACPresent, Type: Feature, ReportID: 0x01, Offset: 0, Size: 8, Value: 1
   1.733870     [D2] Path: UPS.PowerSummary.PresentStatus.Charging, Type: Feature, ReportID: 0x01, Offset: 16, Size: 8, Value: 1
   1.733890     [D2] Path: UPS.PowerSummary.PresentStatus.Discharging, Type: Feature, ReportID: 0x01, Offset: 24, Size: 8, Value: 0
   1.733907     [D2] Path: UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit, Type: Feature, ReportID: 0x01, Offset: 8, Size: 8, Value: 0
   2.984080     [D1] upsdrv_updateinfo...
   2.984118     libusb_get_interrupt: error submitting URB: Device or resource busy
   2.984130     Got disconnected by another driver: Device or resource busy

I will try to install on the system as service and keep running but it is looking very good.

Thanks all for your help :)

drunkly commented 2 years ago

I have installed nut and overwrite the files from my /tmp/package and now is working:

root@PROXMOX:~/nut/drivers# upsc salicru@192.168.1.2:3494
Init SSL without certificate database
battery.charge: 100
battery.runtime: 2829
battery.type: PbAc
battery.voltage: 27.40
battery.voltage.nominal: 24
device.mfr: Salicru
device.model: SLC TWIN PRO2<=3KVA
device.serial: 232019D70264
device.type: ups
driver.name: usbhid-ups
driver.parameter.bus: 002
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.product: SLC TWIN PRO2<=3KVA
driver.parameter.productid: 0201
driver.parameter.serial: 232019D70264
driver.parameter.synchronous: auto
driver.parameter.vendor: Salicru
driver.parameter.vendorid: 2E66
driver.version: 2.7.4-4755-ga1454772
driver.version.data: Salicru HID 0.3
driver.version.internal: 0.45
driver.version.usb: libusb-0.1 (or compat)
input.transfer.high: 300
input.transfer.low: 100
ups.beeper.status: enabled
ups.mfr: Salicru
ups.model: SLC TWIN PRO2<=3KVA
ups.productid: 0201
ups.serial: 232019D70264
ups.status: OL CHRG
ups.vendorid: 2e66
root@PROXMOX:~/nut/drivers#

The only thing is I miss some values like load/input voltage/output voltage, etc.

Do you think I can help somehow to extend this functionality to show more values/descriptors??

nbriggs commented 2 years ago

@drunkly thanks for noticing that rdlen2 had the same problem as rdlen1. I've updated my proposed fix.

Regarding the missing values -- I see quite a few unknown vendor-private fields are being reported, I wonder it is hiding some of the information you are looking for in those fields.

drunkly commented 2 years ago

Thanks I will research a little bit more about this to see if I can show them.

Btw @nbriggs I don't fully understand the architecture of the library and as far as I know only libusb0.1 is supported by nut however in my eyes it looks like this change should be also implemented on libusb1 to prepare it for future releases:

https://github.com/networkupstools/nut/blob/master/drivers/libusb1.c#L428 https://github.com/networkupstools/nut/blob/master/drivers/libusb1.c#L453

drunkly commented 2 years ago

Ok, I realize what is happening is related to the names (of the descriptors?). When I change some variables names then the results comes on the output. So I guess I will rename all the values I need.

diff --git a/drivers/salicru-hid.c b/drivers/salicru-hid.c
index c93f52a8..87438737 100644
--- a/drivers/salicru-hid.c
+++ b/drivers/salicru-hid.c
@@ -155,7 +155,7 @@ static hid_info_t salicru_hid2nut[] = {
   { "battery.voltage", 0, 0, "UPS.PowerSummary.Voltage", NULL, "%.2f", 0, NULL },

   /* UPS page */
-  { "ups.load", 0, 0, "UPS.Output.PercentLoad", NULL, "%.0f", 0, NULL },
+  { "ups.load", 0, 0, "UPS.PowerSummary.PercentLoad", NULL, "%.0f", 0, NULL },
   { "ups.beeper.status", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "%s", 0, beeper_info },
   { "ups.test.result", 0, 0, "UPS.Output.Test", NULL, "%s", 0, test_read_info },
   { "ups.realpower.nominal", 0, 0, "UPS.Output.ConfigActivePower", NULL, "%.0f", 0, NULL },
root@PROXMOX:~/nut# ./clients/upsc salicru@192.168.1.2:3494 ups.load
21
jimklimov commented 2 years ago

Thanks for the fix proposal and tests.

For mappings, it should work to specify several variants (e.g. add new ups.load and not delete the old one), first handled hit wins.

Message ID: @.***>

jimklimov commented 2 years ago

As for libusb 1.0 vs 0.1 - both should now be supported by codebase (one selected at build time), and the usb_ctrl_char(buf) type definitions allow NUT code to seem the same and simple while the backebd library APIs do differ. What bites here is that one handles and passes char buffers, and another - unsigned char buffers.

On Wed, Mar 2, 2022, 11:04 drunkly @.***> wrote:

Thanks I will research a little bit more about this to see if I can show them.

Btw @nbriggs https://github.com/nbriggs I don't fully understand the architecture of the librery and as far as I know only libusb0.1 is supported by nut however in my eyes it looks like this change should be also implemented on libusb1 to prepare it for future releases:

https://github.com/networkupstools/nut/blob/master/drivers/libusb1.c#L428 https://github.com/networkupstools/nut/blob/master/drivers/libusb1.c#L453

— Reply to this email directly, view it on GitHub https://github.com/networkupstools/nut/issues/1312#issuecomment-1056737659, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMPTFGMAO7S4Q5GFJY2JILU544K7ANCNFSM5PAXBNGQ . 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 commented.Message ID: @.***>

jimklimov commented 1 year ago

Historic note: additional mapping descriptors were added by #1331 before NUT v2.8.0 release.