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.99k stars 349 forks source link

Eaton Ellipse 1200 Pro - No matching HID UPS found #1322

Open Impatience71 opened 2 years ago

Impatience71 commented 2 years ago

Hi all, I tried to connect my new Eaton Ellipse Pro 1200 with the standard installation of Nut. (UPS driver controller 2.7.4, Generic HID driver 0.41, USB communication driver 0.33) on a raspberry 4 (latest bullseye armhf version) lsusb shows:

Bus 001 Device 004: ID 0463:ffff MGE UPS Systems UPS

The ups.conf is configured very simple:

[eaton1]
       driver = usbhid-ups
       port = auto
       desc = "Eaton Ellipse Pro 1200"
       vendorid = "0643"
       productid = "FFFF"
       serial = "xxxxxxxxxx"

The problem is (guessing) already somewhere in the mapping:

/usr/local/ups/bin $ sudo ./usbhid-ups -u root -DD -a eaton1

... .034188 [D2] Checking device 3 of 6 (0463/FFFF)
   0.430337 [D2] - VendorID: 0463
   0.430417 [D2] - ProductID: ffff
   0.430480 [D2] - Manufacturer: EATON
   0.430539 [D2] - Product: Ellipse PRO
   0.430601 [D2] - Serial Number: G361M36084
   0.430660 [D2] - Bus: 001
   0.430719 [D2] - Device: unknown
   0.430772 [D2] - Device release number: 0100
   0.430825 [D2] Trying to match device
   0.430883 [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.431076 [D2] match_function_regex: failed match of VendorID:  463
   0.431137 [D2] Device does not match - skipping

Looks like he tries to map the VendorID: 0463 against the VendorID 463 - which is not the same (from a string perspective).

And the output of upsdrvctl is:

pi@raspberrypi:/etc/nut $ sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
No matching HID UPS found
Driver failed to start (exit status=1)
Network UPS Tools - Generic HID driver 0.41 (2.7.4)
USB communication driver 0.33
No matching HID UPS found
Driver failed to start (exit status=1)

When I run the lsusb on the appropriate port I get the following:

pi@raspberrypi:~ $ sudo lsusb -D /dev/bus/usb/001/008
Device: ID 0463:ffff MGE UPS Systems UPS
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x0463 MGE UPS Systems
  idProduct          0xffff UPS
  bcdDevice            1.00
  iManufacturer           1 EATON
  iProduct                2 Ellipse PRO
  iSerial                 4 G361M36084
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower               20mA
    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.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength    1145
         Report Descriptors: 
           ** UNAVAILABLE **
      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 debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Whats my mistake ? Thanks Peter

jimklimov commented 2 years ago

Some issues could be due to USB devfs permissions (are udev rules set up to let nut runtime user r/w access to the device?) which can be worked around by starting the driver with -u root in the worst case, or a user=root in ups.conf global section.

More errors and causes can be seen with added -D options for debug verbosity, but note that in case of upsdrvctl it means this wrapper's verbosity - not the driver programs' one (at some point wrapper logs the command it launches drivers by - try running that directly and add -DDDDD there).

Finally, the latest release (and so packages) is a bit dated, much work is wrapping up for a next one. If you can build custom NUT locally from current master branch (wiki and several recent issues detail how), that could be helpful too.

On Wed, Mar 2, 2022, 22:05 Impatience71 @.***> wrote:

Hi all, I tried to connect my new Eaton Ellipse Pro 1200 with the standard installation of Nut. (UPS driver controller 2.7.4, Generic HID driver 0.41, USB communication driver 0.33) on a raspberry 4 (latest bullseye armhf version) lsusb shows: Bus 001 Device 004: ID 0463:ffff MGE UPS Systems UPS

The ups.conf is configured very simple:

[eaton1] driver = usbhid-ups port = auto desc = "Eaton Ellipse Pro 1200" vendorid = "0643" productid = "FFFF" serial = "xxxxxxxxxx" And the output of upsdrvctl is:

@.***:/etc/nut $ sudo upsdrvctl start Network UPS Tools - UPS driver controller 2.7.4 Network UPS Tools - Generic HID driver 0.41 (2.7.4) USB communication driver 0.33 No matching HID UPS found Driver failed to start (exit status=1) Network UPS Tools - Generic HID driver 0.41 (2.7.4) USB communication driver 0.33 No matching HID UPS found Driver failed to start (exit status=1)

Whats my mistake ? Thanks Peter

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

Impatience71 commented 2 years ago

Hi Jim, many thanks for your thoughts. I made the following:

The permissions in /dev/bus/* are like this:

pi@raspberrypi:/dev/bus/usb/001 $ ls -al
insgesamt 0
drwxr-xr-x 2 root root    140  3. Mär 19:10 .
drwxr-xr-x 4 root root     80  1. Jan 1970  ..
crw-rw-r-- 1 root nut  189, 0  4. Mär 13:43 001
crw-rw-r-- 1 root nut  189, 1  4. Mär 13:43 002
crw-rw-r-- 1 root nut  189, 2  4. Mär 13:43 003
crw-rw-r-- 1 root nut  189, 3  4. Mär 13:46 004
crw-rw-r-- 1 root nut  189, 4  4. Mär 13:43 005

The nut-scanner gives the following (no surprise, worked also before)

pi@raspberrypi:/usr/local/ups/bin $ sudo ./nut-scanner 
Scanning USB bus.
No start IP, skipping NUT bus (old connect method)
[nutdev1]
    driver = "usbhid-ups"
    port = "auto"
    vendorid = "0463"
    productid = "FFFF"
    product = "Ellipse PRO"
    serial = "G361M36084"
    vendor = "EATON"
    bus = "001"

Then I tried to run the usbhid-ups driver direct:

pi@raspberrypi:/usr/local/ups/bin $ sudo ./usbhid-ups -u root -DDDDDDD -a eaton1
Network UPS Tools - Generic HID driver 0.45 (2.7.4-4757-g9e5e34d3)
USB communication driver (libusb 1.0) 0.42
   0.000000 [D3] do_global_args: var='pollintervall' val='1'
   0.000155 [D3] do_global_args: var='maxretry' val='3'
   0.000236 [D3] main_arg: var='driver' val='usbhid-ups'
   0.000306 [D3] main_arg: var='port' val='auto'
   0.000428 [D5] send_to_all: SETINFO driver.parameter.port "auto"
   0.000536 [D3] main_arg: var='desc' val='Eaton Ellipse Pro 1200'
   0.000631 [D3] main_arg: var='vendorid' val='643'
   0.000727 [D5] send_to_all: SETINFO driver.parameter.vendorid "643"
   0.000799 [D3] main_arg: var='productid' val='FFFF'
   0.000871 [D5] send_to_all: SETINFO driver.parameter.productid "FFFF"
   0.000934 [D3] main_arg: var='serial' val='G361M36084'
   0.001029 [D5] send_to_all: SETINFO driver.parameter.serial "G361M36084"
   0.001180 [D1] debug level is '7'
   0.003184 [D5] send_to_all: SETINFO device.type "ups"
   0.003273 [D2] Initializing an USB-connected UPS with library libusb-1.0.24 (API: 0x1000109) (NUT subdriver name='USB communication driver (libusb 1.0)' ver='0.42')
   0.003329 [D1] upsdrv_initups (non-SHUT)...
   0.031529 [D2] Checking device 1 of 6 (1D6B/0003)
   0.033036 [D2] - VendorID: 1d6b
   0.033106 [D2] - ProductID: 0003
   0.033163 [D2] - Manufacturer: Linux 5.10.63-v7l+ xhci-hcd
   0.033227 [D2] - Product: xHCI Host Controller
   0.033287 [D2] - Serial Number: 0000:01:00.0
   0.033342 [D2] - Bus: 002
   0.033401 [D2] - Device: unknown
   0.033458 [D2] - Device release number: 0510
   0.033519 [D2] Trying to match device
   0.033579 [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.033655 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.033716 [D2] Device does not match - skipping
   0.034246 [D2] Checking device 2 of 6 (1E7D/3201)
   0.038221 [D2] - VendorID: 1e7d
   0.038291 [D2] - ProductID: 3201
   0.038347 [D2] - Manufacturer: ROCCAT
   0.038406 [D2] - Product: ROCCAT Valo
   0.038464 [D2] - Serial Number: unknown
   0.038519 [D2] - Bus: 001
   0.038577 [D2] - Device: unknown
   0.038632 [D2] - Device release number: 0100
   0.038690 [D2] Trying to match device
   0.038747 [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.038818 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.038878 [D2] Device does not match - skipping
   0.038972 [D2] Checking device 3 of 6 (0463/FFFF)
   0.434543 [D2] - VendorID: 0463
   0.434628 [D2] - ProductID: ffff
   0.434684 [D2] - Manufacturer: EATON
   0.434744 [D2] - Product: Ellipse PRO
   0.434799 [D2] - Serial Number: G361M36084
   0.434858 [D2] - Bus: 001
   0.434948 [D2] - Device: unknown
0.435006    [D2] - Device release number: 0100
   0.435159 [D2] Trying to match device
   0.435221 [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.435282 [D3] match_function_regex: matching a device...
   0.435469 [D2] match_function_regex: failed match of VendorID:  463
   0.435559 [D2] Device does not match - skipping
   0.435816 [D2] Checking device 4 of 6 (046D/C52B)
   0.440655 [D2] - VendorID: 046d
   0.440751 [D2] - ProductID: c52b
   0.440988 [D2] - Manufacturer: Logitech
   0.441164 [D2] - Product: USB Receiver
   0.441410 [D2] - Serial Number: unknown
   0.441633 [D2] - Bus: 001
   0.441813 [D2] - Device: unknown
   0.441985 [D2] - Device release number: 2411
   0.442156 [D2] Trying to match device
   0.442327 [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.442521 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.442695 [D2] Device does not match - skipping
   0.442911 [D2] Checking device 5 of 6 (2109/3431)
   0.443955 [D2] - VendorID: 2109
   0.444138 [D2] - ProductID: 3431
   0.444309 [D2] - Manufacturer: unknown
   0.444488 [D2] - Product: USB2.0 Hub
   0.444660 [D2] - Serial Number: unknown
   0.444837 [D2] - Bus: 001
   0.445015 [D2] - Device: unknown
   0.445243 [D2] - Device release number: 0421
   0.445413 [D2] Trying to match device
   0.445585 [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.445764 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.445937 [D2] Device does not match - skipping
   0.446156 [D2] Checking device 6 of 6 (1D6B/0002)
   0.447089 [D2] - VendorID: 1d6b
   0.447269 [D2] - ProductID: 0002
   0.447442 [D2] - Manufacturer: Linux 5.10.63-v7l+ xhci-hcd
   0.447621 [D2] - Product: xHCI Host Controller
   0.447799 [D2] - Serial Number: 0000:01:00.0
   0.447970 [D2] - Bus: 001
   0.448141 [D2] - Device: unknown
   0.448320 [D2] - Device release number: 0510
   0.448497 [D2] Trying to match device
   0.448668 [D2] match_function_subdriver (non-SHUT mode): matching a device...
   0.448851 [D2] match_function_subdriver (non-SHUT mode): failed to match a subdriver to vendor and/or product ID
   0.449024 [D2] Device does not match - skipping
   0.449249 [D2] libusb1: No appropriate HID device found
   0.449415 No matching HID UPS found

Whats irritating me is that the vendor ID is one time "0463" and the second time just "463" Don't know if that plays a role bcs the strings are not identical.

Do you have an idea what I can try next ?

Thanks a lot for your help ! Kr Peter

Impatience71 commented 2 years ago

David Zomaya (from Eaton) gave me the hint to remove product and vendor ID from the ups.conf. I did that and I have no errors anymore when the usbhid-ups tries to talk with the UPS. Thats a huge step forward. Will try now to bring the other pieces to run.

Unfortunately the problem persists. The usbhid driver runs perfect and reads the HID objects like it should be. But upsdrvctl will not start:

pi@pi-hole:~ $ sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.4 Network UPS Tools - Generic HID driver 0.41 (2.7.4) USB communication driver 0.33 No matching HID UPS found Driver failed to start (exit status=1)

Kind regards Peter

Grandma-Betty commented 2 years ago

Seems you're having the same issue as me on ARM based OS: https://github.com/networkupstools/nut/issues/1004

Impatience71 commented 2 years ago

Yeah, think so. I have the issue on two different raspi 4. The driver itself (usbhid-ups) provides many HID objects. Everything looks ok. But the upsdrvctl runs into "No matching HID UPS found" error. No idea what can be the reason. I thought that the upsdrvctl is only a wrapper around the selected ups driver. But seems not.

jimklimov commented 2 years ago

Actually upsdrvctl should be just a wrapper... with added debug (several -D args) it should log the command it calls for the driver.

In your test above you succeeded with -u root, I wonder if your attempts with upsdrvctl pass that too.

Normally udev rules should let the nut run-time user access the USB device filesystem node, with running as root being a useful fallback.

Recent PRs added config-file options to set user per-driver, as well as debug_min for troubleshooting.

On Fri, Mar 11, 2022, 08:43 Impatience71 @.***> wrote:

Yeah, think so. I have the issue on two different raspi 4. The driver itself (usbhid-ups) provides many HID objects. Everything looks ok. But the upsdrvctl runs into "No matching HID UPS found" error. No idea what can be the reason. I thought that the upsdrvctl is only a wrapper around the selected ups driver. But seems not.

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

Impatience71 commented 2 years ago

Hi Jim, your hint was the real one ! I let the upsdrvctl run with " -u root" and it works. I thought the sudo is enough, but it was not. Need to make all start and stop procedures round on the weekend and integrate it with Grafana on my HA but then I am happy. Thanks a lot for your support and the time you spent ! Great community. Wish you a nice evening.

jimklimov commented 2 years ago

The original post was poorly formatted for markdown so I did not read it right the first time. Added backticks in the post and comments now

Seems there was a typo in original ups.conf section, with vendorid = "0643" (not 0463) so that did not match, I suppose.

jimklimov commented 2 years ago

Regarding running as root - that is a fallback option if nothing else helps easily, but not a "proper" one (and potentially not safe, to have a root daemon in the system when it does not require to be).

Usually you should configure the udev rules or equivalent, which would tell the OS to set permissions for the device-FS node for NUT run-time accounts; distro-packaged NUT usually installs that into the OS, docs in source should tell how to do the same.

Note that recent iterations of the master branch include #1342 for more efficiently parsed "hwdb" instead of text-format rules. Practical testing how this is supported across the board would be welcome :)