hassio-addons / addon-nut

Network UPS Tools - Home Assistant Community Add-ons
https://addons.community
MIT License
191 stars 37 forks source link

NUT fails to start reporting insufficient permissions on libusb #322

Open halcyonz80 opened 1 year ago

halcyonz80 commented 1 year ago

Problem/Motivation

NUT fails to start on RiPi using standard HA image due to USB permissions

Expected behavior

NUT can scan the USB bus to find the UPS

Actual behavior

libusb1: Could not open any HID devices: insufficient permissions on everything

Steps to reproduce

Install the NUT addon to 10.4 and try to start it using basic config

trudheim commented 3 months ago

root@debian:~# lsusb Bus 001 Device 010: ID 06da:ffff Phoenixtec Power Co., Ltd Offline UPS

So far so good, still connected and no errors in the logs.

trudheim commented 3 months ago

Well, it wasn't that. USB device for the UPS has disappeared, though it took four days for it to happen. I will look at other USB kernel stack settings to see if there is something else I can tweak to resolve this.

fab512 commented 2 months ago

I was trying to connect to my Serioux LD600LI UPS which shows up on lsusb as: Bus 001 Device 005: ID 0001:0000 and discovered by the HA NUT Addon at startup with list_usb_devices option enabled as: Bus 001 Device 005: ID 0001:0000 Fry's Electronics MEC0003 I was using this config:

- name: Serioux_LD600LI
  driver: usbhid-ups
  port: auto
  config:
    - vendorid = 0001
    - productid = 0000
    - desc = "Serioux LD600LI UPS"

I was getting the same error:

USB communication driver (libusb 1.0) 0.43
libusb1: Could not open any HID devices: insufficient permissions on everything

My guess is that because this is a cheap UPS, it doesn't feature a proper USB HID implementation and so the driver usbhid-ups is not the right option. So after going down the rabbit hole, I figured out this type of ups should connect with a megatec-usb driver which has been deprecated and replaced by blazer_usb driver which again was deprecated and replaced with nutdrv_qx driver. So after switching my config to this, everything works.

- name: Serioux_LD600LI
  driver: nutdrv_qx
  port: auto
  config:
    - vendorid = 0001
    - productid = 0000
    - desc = "Serioux LD600LI UPS"

image

This worked for me !

epserra commented 2 months ago

Well after seeing a suggestion regarding autosuspend, and the information in the url: https://community.home-assistant.io/t/how-to-disable-usb-autosuspend/392320/14 I have included the following in the 90-nut-ups.rules file (nano /etc/udev/rules.d/90-nut-ups.rules): TEST==”power/control”, ATTR={power/control}=”on” and it is now like this:

Rule for a Salicru UPS

ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="06da", ATTR{idProduct}=="ffff", MODE="0660", GROUP="nut", TEST==”power/control”, ATTR={power/control}=”on” Several days have passed and the connection to the SALICRU UPS continues to work.

epserra commented 2 months ago

I have also applied the information to have the autosupend value = -1, but after several days the error returns, for the moment the only solution is reboot proxmox.

github-actions[bot] commented 1 month ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

pkozlowski1 commented 1 month ago

same issue: [10:33:05] INFO: Configuring Device named BE850G2-GR... [10:33:05] INFO: Starting the UPS drivers... libusb1: Could not open any HID devices: insufficient permissions on everything

epserra commented 1 month ago

Apologies for the delay, I am changing the structure of my installation and I cannot dedicate time to this situation. I have changed the old mini PC for a Chuwi with 12GB of RAM and 500GB of disk and although NUT has gone down it has taken a few days to give the error. I hope to be able to continue with the issue in a few days.

github-actions[bot] commented 6 days ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!