[Nut-upsdev] telling apart USB devices

Peter Selinger selinger at mathstat.dal.ca
Sun Nov 6 03:06:37 UTC 2005


I just noticed the following curious behavior when using newhidups
with upsdrvctl and two different USB devices:

My ups.conf contains two devices, both using newhidups:

[belkinusb]
        driver = newhidups
        port = auto
        desc = "Belkin UPS, USB interface"
        vendorid=050d

[mgeusb]
        driver = newhidups
        port = auto
        desc = "MGE UPS, USB interface"
        vendor = "MGE.*"

If I start one of them, say belkinusb, with upsdrvctl,

$ upsdrvctl start belkinusb

then *both* "upsc mgeusb at localhost" and "upsc belkinusb at localhost" give
the same output:

$ upsc mgeusb at localhost
battery.charge: 100
...
driver.name: newhidups
driver.parameter.port: auto
driver.parameter.vendorid: 050d
driver.version: 2.1.0
driver.version.data: Belkin HID 0.1
driver.version.internal: 0.28
...

$ upsc belkinusb at localhost
battery.charge: 100
...
driver.name: newhidups
driver.parameter.port: auto
driver.parameter.vendorid: 050d
driver.version: 2.1.0
driver.version.data: Belkin HID 0.1
driver.version.internal: 0.28
...

On the other hand, if I assign two different dummy "ports" to these
devices:

[belkinusb]
        driver = newhidups
        port = auto1
        desc = "Belkin UPS, USB interface"
        vendorid=050d

[mgeusb]
        driver = newhidups
        port = auto2
        desc = "MGE UPS, USB interface"
        vendor = "MGE.*"

then the two devices will be distinguished correctly. Is this behavior
documented? The man page currently says:

IMPLEMENTATION
       newhidups only support 1 UPS at this time. You can put the "auto" value
       for port in ups.conf, i.e.:

            [newhidups]
                 driver = newhidups
                 port = auto

This is now most definitely outdated. But the fact that the "port" is
used in this way, although it does not mean anything, should probably
be documented.

Arnaud, any thoughts on this? -- Peter




More information about the Nut-upsdev mailing list