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

Fix nut-scanner device naming in sanity-check reports #2317

Merged
merged 5 commits into from
Feb 21, 2024

Conversation

jimklimov
Copy link
Member

@jimklimov jimklimov commented Feb 19, 2024

Avoid this sort of mismatch:

Scanning USB bus.
[nutdev-usb1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "0463"
        productid = "FFFF"
        product = "Ellipse ECO"
        serial = "000000000"
        vendor = "EATON"
        # bus = "003"
        # device = "002"
        # busport = "002"

# WARNING: all-same character "serial" with 9 copies of '0' (0x30) reported in some devices: nutdev-serial1
  • (note [nutdev-usb1] vs. ...some devices: nutdev-serial1)

It should rather be like this:

Scanning USB bus.
[nutdev-usb1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "0463"
        productid = "FFFF"
        product = "Ellipse ECO"
        serial = "000000000"
        vendor = "EATON"
        # bus = "003"
        # device = "002"
        # busport = "002"

# WARNING: all-same character "serial" with 9 copies of '0' (0x30) reported in some devices: nutdev-usb1

Fallout of #2243 / #2247.

Note: some testing with multiple devices would be welcome. I am not convinced if the sanity checker had a bug about starting nutdev_num from the last_nutdev_num (and moving the number upwards... to where the list has no entries to number?) - it could have reported bogus device numbers in fact. But that's a gut feeling, hopefully fixed by this PR if the bug was there...

CC @desertwitch :)

@jimklimov jimklimov added this to the 2.8.2 milestone Feb 19, 2024
@jimklimov jimklimov added the USB-duplicate-devices Track bugs and issues about monitoring several devices that seem identical to NUT or libusb label Feb 19, 2024
@jimklimov
Copy link
Member Author

Had a CI agent reboot... Restarted build.

… NOT always a "nut-serialX"!)

Signed-off-by: Jim Klimov <[email protected]>
…erating WHOLE lists, not just parsing one "device"

Signed-off-by: Jim Klimov <[email protected]>
@AppVeyorBot
Copy link

…can_display_sanity_check_serial()

Actually rewind it back to the number which the first entry for this
device type had in the "continuous numbering" we track for this scan report.

Signed-off-by: Jim Klimov <[email protected]>
@AppVeyorBot
Copy link

@jimklimov jimklimov merged commit 566a80a into networkupstools:master Feb 21, 2024
11 of 13 checks passed
@jimklimov jimklimov deleted the nutscan-naming branch February 21, 2024 10:17
@desertwitch
Copy link
Contributor

Looks good - don't have multiple devices to test with right now, but will follow up if a problem should appear.
Generally very happy with the direction nut-scanner is taking, should alleviate some support volume on my end. 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug nut-scanner USB-duplicate-devices Track bugs and issues about monitoring several devices that seem identical to NUT or libusb
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants