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

Arnaud Quette aquette.dev at gmail.com
Fri Jun 6 08:15:15 UTC 2008


2008/6/6 Arjen de Korte <nut+users at de-korte.org <nut%2Busers at de-korte.org>>:

> > 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.
>

that will be fixed with the new libusb 1.0 project.
I haven't looked at it for sometime, but the API should not be far from
stable.


> > 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).
>

the problem is reverted since HAL is firing us up (ie loading itself the
driver, and pointing an UDI (unique dev id).
so you might have thousands of similar devices without problem.
the only thing is that it's not yet suitable for a server usage since it
requires something like Gnome Power Mgr to act according to the UPS state
and the user config.
but we (the HAL/GPM/NUT/... guys) will start to work soon on something more
generic, and suitable for any use (console, Gnome, KDE, ...) and related to
the HAL replacement (DeviceKit). This would be somehow similar to the
NetworkManager

Arnaud
-- 
Linux / Unix Expert R&D - MGE Office Protection Systems -
http://www.mgeops.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://people.debian.org/~aquette/
Free Software Developer - http://arnaud.quette.free.fr/
--
Conseiller Municipal - Saint Bernard du Touvet -
http://www.SaintBernardDuTouvet.fr/
en charge de la Communication, de l'Informatique et des Technologies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20080606/b5b1f0e5/attachment.htm 


More information about the Nut-upsuser mailing list