hassio-addons / addon-nut

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

Fails with 2 UPSes #340

Closed hryamzik closed 8 months ago

hryamzik commented 10 months ago

Problem/Motivation

I have 2 different UPS units. Each of them works fine but if I put both service fails.

Actual behavior

[19:09:50] INFO: Starting the UPS drivers...
Please note that this driver is deprecated and will not receive
new development. If it works for managing your devices - fine,
but if you are running it to try setting up a new device, please
consider the newer nutdrv_qx instead, which should handle all 'Qx'
protocol variants for NUT. (Please also report if your device works
with this driver, but nutdrv_qx would not actually support it with
any subdriver!)

Supported UPS detected with megatec protocol
Vendor information unavailable
No values provided for battery high/low voltages in ups.conf

Using 'guestimation' (low: 10.400000, high: 13.000000)!
Battery runtime will not be calculated (runtimecal not set)
Can't claim USB device [0665:5161]@0/0: Entity not found
Network UPS Tools - Megatec/Q1 protocol USB driver 0.14 (2.8.0)
Network UPS Tools - UPS driver controller 2.8.0
Driver failed to start (exit status=1)
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

It complains about missing USB device but lsusb shows it.

Steps to reproduce

Plug in 2 Ippon UPSes, Power Pro II Euro and Ippon Back Basic.

Configure as follows:

- name: ippon-pro
  driver: blazer_usb
  port: auto
  vendorid: 06da
  productid: ffff
  desc: "Ippon Power Pro II Euro 650"
  config: []

- name: ippon-basic
  driver: blazer_usb
  subdriver: cypress
  protocol: megatec
  port: auto
  vendorid: "0665"
  productid: 5161
  desc: "Ippon Back Basic 850 Euro"
  config: []
sinclairpaul commented 10 months ago

Can't claim USB device [0665:5161]@0/0: Entity not found

Can you show the output with the list_usb_devices option set to true

seblang commented 10 months ago

Hi the same for me!

Setting :

LOOG :


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 11.4 (amd64 / generic-x86-64) Home Assistant Core: 2024.1.5 Home Assistant Supervisor: 2023.12.1

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 [18:20:27] INFO: Configuring timezone (Europe/Paris)... 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 [18:20:28] INFO: Setting mode to netserver... [18:20:28] INFO: Generating /etc/nut/upsd.users... [18:20:28] INFO: Configuring user: Slangolf [18:20:29] INFO: Password is NOT in the Have I Been Pwned database! Nice! [18:20:30] INFO: Configuring Device named eaton... [18:20:31] INFO: Configuring Device named eaton2... [18:20:31] INFO: Starting the UPS drivers... Using subdriver: MGE HID 1.46 Network UPS Tools - Generic HID driver 0.47 (2.8.0) USB communication driver (libusb 1.0) 0.43 Can't claim USB device [0463:ffff]@0/0: Entity not found Network UPS Tools - Generic HID driver 0.47 (2.8.0) USB communication driver (libusb 1.0) 0.43 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 10 months ago

@seblang You have nothing in your config that uniquely identifies the devices.

seblang commented 10 months ago

@sinclairpaul what that mean, the 2 devices have another name! what should I change in config?

sinclairpaul commented 10 months ago

I would suggest looking at the NUT documentation https://networkupstools.org/docs/man/usbhid-ups.html for the driver, the preferred method would be to use the serial number of the device (which should be labelled physically on the device itself).

seblang commented 10 months ago

Hi thank you for your feedback I will check the doc! Previously I have try to add the usb path instead of port : auto

seblang commented 10 months ago

@sinclairpaul It's me again, i have checked the info from the USB :

DRIVER: usb ID_BUS: usb ID_FOR_SEAT: usb-pci-0000_00_10_0-usb-0_2 ID_MODEL: Ellipse_ECO ID_MODEL_ENC: Ellipse\x20ECO ID_MODEL_ID: ffff ID_PATH: pci-0000:00:10.0-usb-0:2 ID_PATH_TAG: pci-0000_00_10_0-usb-0_2 ID_REVISION: '0100' ID_SERIAL: EATON_Ellipse_ECO_000000000 ID_SERIAL_SHORT: '000000000' ID_USB_INTERFACES: ':030000:' ID_USB_MODEL: Ellipse_ECO ID_USB_MODEL_ENC: Ellipse\x20ECO ID_USB_MODEL_ID: ffff ID_USB_REVISION: '0100' ID_USB_SERIAL: EATON_Ellipse_ECO_000000000 ID_USB_SERIAL_SHORT: '000000000' ID_USB_VENDOR: EATON ID_USB_VENDOR_ENC: EATON ID_USB_VENDOR_ID: '0463' ID_VENDOR: EATON ID_VENDOR_ENC: EATON ID_VENDOR_ID: '0463' MAJOR: '189' MINOR: '154' PRODUCT: 463/ffff/100

Can you please help me to to find what is what !

identifiant du produit = regex vendeur = regex produit = expression régulière série = regex bus = expression régulière

I have add this in my config this

hryamzik commented 10 months ago

@sinclairpaul good point, maybe I get just the same single UPS working no matter what's in the config. Here's the output:

Bus 001 Device 077: ID 06da:ffff Phoenixtec Power Co., Ltd Offline UPS
Bus 001 Device 005: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 001 Device 004: ID 0665:5161 Cypress Semiconductor USB to Serial
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
sinclairpaul commented 10 months ago

@hryamzik The option just runs lsusb in the container (it is irrelevant from the config), if it only see's one device it can't configure more than one.

Edit - From looking at the output, it looks like there is a USB to Serial convertor involved Bus 001 Device 004: ID 0665:5161 Cypress Semiconductor USB to Serial I would validate upstream that the driver can support this.

hryamzik commented 10 months ago

@sinclairpaul yep both devices are there however I don't have a physical access to unplug one of them and check if something is picked and data is flowing.

I'd expect serial device to be presented at /dev/tty<...> but it's not.

github-actions[bot] commented 9 months 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!