[Nut-upsdev] Fwd: RE New xanto driver for NUT
Andreas Thienemann
andreas at bawue.net
Tue Nov 15 20:28:32 UTC 2005
Hello Carlos,
On Tue, 15 Nov 2005, Carlos Rodrigues wrote:
> Hmmm, can you give some examples of commands that behave differently
> between "megatec" and "xanto"?
Sure:
Main differences in the commandset:
Q<cr> to switch off the buzzer is not implemented
F<cr> to gather information about the device is not implemented
F with parameters is used to switch the system to bypass and back to
on-line mode.
Especialle the inability to offer any device information together with the
fact that the device does not echo unknown commands back to the user, as
the megatec protocol usually does, would most likely result in many
special cases for the xanto series in the existing megatec drivers.
Thus I decided to just fork the driver, and force the user to specify the
model plus the number of installed battery packs on the commandline.
This comes down to about 20 models now, but as soon as I have the battery
and voltage data for the non-rackmountable versions, this means 62
different models, each with different ratings.
Maybe a bit much for a generic megatec driver.
> If it is sufficiently different I guess it cound be a separate driver.
> This protocol is used by many manufacturers, and most of them (beyond
> the low-end models) introduce variations of some sort, so there are
> going to be some special cases...
>
> The real question is: how does the current "megatec" driver handle it
> now? Does it barely work or doesn't it work at all (or behaves
> unacceptably wrong)?
It doesn't work at all, as the driver is looking to somehow identify the
model, which fails of course.
I guess the only way of adding the xanto series to the generic driver is
to offer the user to choose which of the 65 available models he has and
then use the data I gathered to show correct values.
> BTW, are you starting from scratch or did you fork an existing driver?
I started by forking the sms driver but changed most of the functions.
Right now, the xanto driver I have written works good enough:
http://sysiphus.bawue.net/cgi-bin/upsstats.cgi
I plan on cleaning it up a bit, especially as the sscanf calls are a bit
risky as no checking is implemented yet. I'll probably use a string
tokenizer call or something similar.
Furthermore, the min and max input voltage for the device and similar
data is not yet passed to nut, resulting in upsstats.cgi showing wrong
values for the "green" area of the input-power bar etc.
If you want to, we could adapt the generic megatec driver to support the
xanto models. It's your call. But I fear, the hassle is too much.
bye,
andreas
More information about the Nut-upsdev
mailing list