Re: [gpm] Re: ideas for a new UPS infrastructure



Hi,

I'm the HAL maintainer.

On Fri, 2006-03-10 at 00:29 +0000, Richard Hughes wrote:
> > Only in NUT:
> > - network UPS support

See below

> > - more UPSes, more machines policy

Yes. g-p-m relies on HAL to get this and I don't think this should
change for UPS's attached via e.g. USB. To give some perspective the HAL
support for UPS's is something I wrote in one or two evenings; it's a
very simple piece of code

 http://webcvs.freedesktop.org/hal/hal/hald/linux2/addons/addon-hid-ups.c?rev=1.12&view=markup
 (yes, this code could need some love.. I know!)

Hence, we only support USB UPS's supporting the HID protocol. I don't
really know how many that is (10%, 20%? Only home users?) but I'm
curious to know :-)

I think it could be really cool to use the code in NUT in HAL since we
would support a lot more devices. But I'm not really sure how we would
do that? Does it rely on kernel drivers? Userspace code? etc. I'd love
to know. 

Btw, I'm not sure how we would support UPS on the serial port in HAL.
One thing about HAL is that we can never have a configuration file
saying where to look for devices; the whole philosophy about HAL is to
detect your devices and present the desktop bits with an extremely
well-defined view. I got some ideas about serial ports if you're
interested in cooperating; basically I think it's doable the same way
e.g. Windows lets the user search for a modem on the serial port. I can
expand on that if you want me too.

> > - advanced UPS manipulation (temperature, voltage, EEPROM programming?)
> > http://www.networkupstools.org/features/

I think some of these features may make sense for gnome-power-manager.
Some of them are probably outside the scope of g-p-m though. That's
Richard's call I think :-)

> > upsd-network-hald-addon listens to network UPSes and provides HAL device
> > 

This is indeed possible, but hal-device(1) and the associated D-BUS
interfaces for creating HalDevice objects in HAL may disappear some day.

> > upsmon listens to D-BUS and provides interface for grafical old
> > fashioned NUT clients
> 
> I'm not sure how to integrate network UPS's into the current HAL
> framework, as hardware not attached to the computer is sort of anti-HAL.

I'm not sure HAL should know anything about networked devices... On the
other hand it does make some sense. But it's a slippery slope.. and how
would upsd-network-hald-addon even know which UPS's to monitor? Again,
it can't rely on a configuration file!

Not to flame, but I think it would make sense to take the user
experience into perspective before discussing technical issues.

How about this instead

 1. gnome-power-manager to include functionality for discovering
    networked UPS devices. I don't really know how this works but
    I expect some auth is necessary. Hence, you really want to
    run this in the desktop session as asking users to edit
    configuration files is just wrong. If the UPS is discoverable
    using Zeroconf/Bonjour etc. maybe g-p-m should use Avahi
    to discover them and prompt the user for auth when it finds
    an UPS.

 2. Maybe g-p-m should provide UI to share an UPS on the network
    so other g-p-m instances can monitor it. For this we could
    indeed use Avahi to publish the information. Then stuff would
    just work :-) ... Again, I don't know much about how this works, 
    I'm thinking out loud :-)

 3. upsmon to use an interface in g-p-m to get the information
    about the UPS and provides interface for graphical old
    fashioned NUT clients. This means g-p-m will have to export
    some of the info HAL already exports but I think this is
    cleaner as I don't really want HAL to know about networked
    UPS's.

> > Power manager must implement advanced UPS logic from upsmon (how many
> > UPSes must be running, signalling networked computers to shutdown,...)
> 
> Yes, g-p-m needs to do more for UPS. I'm considering a "Running on UPS"
> tab in the preferences so we can assign things like emailing the admin,
> and running arbitrary scripts, having options such as:
> 
> [x] Beep when on UPS.
> 
> But I guess other people might have better ideas.

Richard, that "Running on UPS" tab sounds like a cool idea!

So.. I guess I'm saying that at this point I'm very interested in the
driver code from NUT but not so much the other bits. I realize this may
come across as a bit offensive but I hope you guys are interested in
cooperating nonetheless. If we need any HAL changes to make this happen
(for e.g. serial ports) I'm more than happy to do my bit.

We could make UPS support rock with gnome-power-manager [1].

Thanks,
David

[1] : To be really useful, though, we need to have PolicyManager and
ConsoleTracker as described here http://blog.fubar.dk/?p=63
But that will probably happen before GNOME 2.16.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]