[Nut-upsuser] Multiple ups/Belkin 1500VA no serial number

Arjen de Korte nut+users at de-korte.org
Fri Jun 6 06:39:45 UTC 2008


> I hadn't previously looked into libusb, but is there a reason why the
> filename
> member of usb_device is't matched on?  On linux, they may not be unique or
> deterministic in theory --- but in practice they are, particularly for
> servers where you're not constantly plugging in and out devices.

The filename *will* change, even if you don't plug in and out devices.
This may happen as often as once every half hour. Therefor, the device
name can't be used in the matching. It may appear to work now, but if for
some reason the devices are enumerated again, the connection *will* be
lost.

> Am I missing something in the logic, or do I just have an unusual case?

Neither. These devices are just not suitable for use with NUT as long as
the libusb library doesn't expose the physical ports the UPS is attached
to.

> I've written up a patch that works for me -- it pulls out the filename
> from
> the usb_device, and matches it with a file= parameter for ups.conf. I'd
> guess
> that a better long-term solution would be to have upsdrv listen to hal for
> ups's that are connecting -- but that would obviously be a lot more work,
> and
> it requires mucking up the server with hal stuff.

We already have HAL enabled drivers, but I'm not sure if these use all the
information from HAL to match a UPS or if they need the devices to be
'unique' as well (like the classic ones).

Best regards, Arjen
-- 
Eindhoven - The Netherlands
Key fingerprint - 66 4E 03 2C 9D B5 CB 9B  7A FE 7E C1 EE 88 BC 57




More information about the Nut-upsuser mailing list