[Nut-upsdev] Some questions on driver implementation and variable
names
Arjen de Korte
nut+devel at de-korte.org
Sun Feb 25 19:57:56 CET 2007
Carlos Rodrigues wrote:
>> Clients can do exactly the same, with the benefit that this will work
>> for all drivers supporting the input variables needed, instead of just
>> one.
> Clients can't do it. Clients could only do it if the driver exposed
> all the gory details necessary, like minimum and maximum battery
> voltages,
We don't know these as far as I know, these are all (hardcoded)
assumptions. At least we should make these variables, so that if someone
knows the presumptions are wrong, they can override these with more
accurate numbers (with a warning about this in the driver man page).
> number of batteries, discharge curves...
Same here. We may figure out the number of batteries from the float
voltage of the battery string, but there is no way to know the battery
capacity and discharge curve unless the runtime calibration routine in
the UPS is telling us that. Someone might have replaced the stock
batteries by different ones, or added additional ones externally, who knows?
> This would mean even more variables, for something that a driver can do
> in only a few lines of code.
Based on made up 'information'. I'm not doubting your good intentions
here, but I'm quite worried that we're on a slippery slope. I'd rather
not present data if we're not sure it is reliable.
> "megatec", for example, calculates "battery.charge" itself, and it
> sucks at it too... clients would suck even more...
This is exactly why I think we should refrain from reporting anything
that is not coming from the UPS itself.
> Besides, some UPSes report these values themselves, others don't. It's
> the driver's job to abstract the hardware, and this means doing stuff
> in software that some UPSes do in hardware (firmware), thus
> "pretending the hardware is fancier than it is".
I don't like that at all, but if the majority here thinks this is a good
idea, I'll rest my case.
I think our job is to monitor the UPS and shutdown systems if it is
signaling that it is about to give up. Almost all other values are just
non essential bells-and-whistles. If you really need those, you're
better off by using a dedicated power quality meter, than by looking at
whatever a UPS is reporting.
Best regards, Arjen
More information about the Nut-upsdev
mailing list