Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list_usb_devices also displays NUT addon configuration #335

Closed
wants to merge 1 commit into from

Conversation

aquette
Copy link

@aquette aquette commented Dec 9, 2023

Proposed Changes

When enabling list_usb_devices option, also call nut-scanner -U, beside from lsusb, to detect supported USB devices and output the expected configuration. This should improve NUT addon usability and supportability

Related Issues

([Github link][autolink-references] to related issues or pull requests)

[autolink-references]: #333 #322

By using the nut-scanner tool, to detect supported USB devices
and output the expected configuration, NUT addon use and
support should be improved

Signed-off-by: Arnaud Quette <[email protected]>
@aquette
Copy link
Author

aquette commented Dec 9, 2023

Additional notes:

  • only unit tested in a specific docker (I don't yet know how to clone a local container on rpi).
    Still, not much harm in blind coding and executing this :D
  • expected output:
...
[20:30:26] INFO: Connected USB devices:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 17ef:6018 Lenovo Lenovo Low Profile USB Keyboard
Bus 001 Device 004: ID 0463:ffff MGE UPS Systems UPS
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 0463:ffff ...
Bus 001 Device 004: ID 0463:ffff ...
NUT USB UPS configuration:
Scanning USB bus.
[nutdev1]
driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = "FFFF"
product = "Protection Station"
serial = "XXXXXXXXXXX"
vendor = "EATON"
bus = "001"
[nutdev2]
driver = "usbhid-ups"
port = "auto"
vendorid = "0463"
productid = "FFFF"
product = "Ellipse ECO"
serial = "YYYYYYYYYYY"
vendor = "EATON"
bus = "001"
...

@aquette
Copy link
Author

aquette commented Dec 10, 2023

Reference: networkupstools/nut#2220

@aquette
Copy link
Author

aquette commented Dec 17, 2023

closing in favor of the new SmartNUT Add-on: https://github.com/aquette/addon-smartnut/blob/main/smartnut/DOCS.md

@aquette aquette closed this Dec 17, 2023
@aquette aquette deleted the nut-scanner-usb branch December 17, 2023 08:58
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant