hassio-addons / addon-nut

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

Addon fails to start when connected to CP1500AVRLCD3 #363

Closed spiffyvmlab closed 3 months ago

spiffyvmlab commented 3 months ago

The addon starts, tries to load the usbhid-ups driver, then shuts down. Same config worked just fine on the older CyberPower UPS this one is replacing (CP1500AVR).

UPS make: CyberPower UPS model: CP1500AVRLCD3

Home Assistant:

Core:              2024.5.5
Supervisor:        2024.06.0
Operating System:  12.3
Frontend:          20240501.1

Running latest addon version available (0.13.0). I checked the Dockerfile in the addon repo to see what NUT version is being installed when the image is built, and it looks like it's 2.8.0-7. According to this thread this model does in fact work, even though it's not listed in the compatibility matrix.

Addon config:

users:

- username: nutadmin
  password: supersecurepassword
  instcmds:
    - all
  actions:
    - SET

devices:

- name: cyberpower
  driver: usbhid-ups
  #port: /dev/ttyUSB0 <--actual port name that worked previously
  port: auto
  config: []

Mode: netserver

Error:

libusb1: Could not open any HID devices: insufficient permissions on everything
No matching HID UPS found
Driver failed to start (exit status=1)

Log output:

-----------------------------------------------------------

 Add-on: Network UPS Tools
 Manage battery backup (UPS) devices
-----------------------------------------------------------
 Add-on version: 0.13.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.3  (amd64 / qemux86-64)
 Home Assistant Core: 2024.5.5
 Home Assistant Supervisor: 2024.06.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-timezone: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
[10:06:17] INFO: Configuring timezone (America/Denver)...
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service base-addon-timezone successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/nut.sh
[10:06:17] INFO: Setting mode to netserver...
[10:06:17] INFO: Connected USB devices:
Bus 007 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 006 Device 002: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU Tablet
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[10:06:17] INFO: Generating /etc/nut/upsd.users...
[10:06:17] INFO: Configuring user: nutadmin
[10:06:18] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[10:06:18] INFO: Configuring Device named cyberpower...
[10:06:18] INFO: Starting the UPS drivers...
Network UPS Tools - Generic HID driver 0.47 (2.8.0)
USB communication driver (libusb 1.0) 0.43
libusb1: Could not open any HID devices: insufficient permissions on everything
No matching HID UPS found
Driver failed to start (exit status=1)
Network UPS Tools - UPS driver controller 2.8.0
cont-init: info: /etc/cont-init.d/nut.sh exited 1
cont-init: info: running /etc/cont-init.d/nutclient.sh
cont-init: info: /etc/cont-init.d/nutclient.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-timezone: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-timezone successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
sinclairpaul commented 3 months ago
[10:06:17] INFO: Connected USB devices:
Bus 007 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 006 Device 002: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU Tablet
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The device doesn't appear to be in the list there.

spiffyvmlab commented 3 months ago
[10:06:17] INFO: Connected USB devices:
Bus 007 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 006 Device 002: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 006 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU Tablet
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The device doesn't appear to be in the list there.

Ugh... You're right. I'm guessing an issue with USB passthrough to the VM in PVE. Been banging my head against the wall on this for too long. I missed that entirely.

spiffyvmlab commented 3 months ago

Apparently, despite having used the same USB port on the host for the previous UPS, PVE was not passing the port through correctly for the new one. After fixing that NUT addon started up correctly. Thanks @sinclairpaul for pointing out the issue.