Hi all, I'm writing the firmware for a home-made 12V UPS, which will be used to power low-voltage equipment in my home like my ADSL modem, router, switches and a Soekris net4801. The home-made UPS can run those devices on the same batteries as my 230V UPS, but last for several hours rather than a few minutes due to increased efficiency. The microcontroller I'm using has a serial interface that's presented using a USB to serial converter. I'd really like this UPS to interface with NUT so that I can use a variety of tools to monitor it, such as Nagios and cacti, etc... I really don't want to have to write my own driver for NUT if I can avoid doing so, so the main question is which serial interface is the most sane for me to implement in my controller. The megatec driver seems to be one of the most popular but I can't find much documentation about the protocol. In addition I'm wondering how much NUT looks at various parameters like input / battery / line voltage, since in my case it would be 12-18V and not the more common 110/230V. :-) Once finished I plan to open-source my firmware (written in a mix of C/C++ for the Arduino IDE for AVR microcontrollers) and document my build for all to see. Thanks, Chris
Arjen de Korte
2010-Apr-19 10:13 UTC
[Nut-upsdev] Best UPS protocol for home-made firmware?
Citeren Chris Boot <bootc op bootc.net>:> I'd really like this UPS to interface with NUT so that I can use a > variety of tools to monitor it, such as Nagios and cacti, etc... I > really don't want to have to write my own driver for NUT if I can > avoid doing so, so the main question is which serial interface is > the most sane for me to implement in my controller. The megatec > driver seems to be one of the most popular but I can't find much > documentation about the protocol.I don't think this is the most suitable protocol, but nevertheless: http://www.networkupstools.org/protocols/megatec.html> In addition I'm wondering how much NUT looks at various parameters > like input / battery / line voltage, since in my case it would be > 12-18V and not the more common 110/230V. :-)NUT basically only really cares about the flags in 'ups.status', all other variables are just bells-and-whistles and will not be used to determine when it is time to shutdown. So the values of input-, output- and battery voltage are irrelevant, they will be relayed as is. Best regards, Arjen -- Please keep list traffic on the list
Charles Lepple
2010-Apr-19 11:32 UTC
[Nut-upsdev] Best UPS protocol for home-made firmware?
On Apr 19, 2010, at 4:09 AM, Chris Boot wrote:> In addition I'm wondering how much NUT looks at various parameters > like input / battery / line voltage, since in my case it would be > 12-18V and not the more common 110/230V. :-)In the NUT developer documentation, there are some tables listing the variable names: http://buildbot.networkupstools.org/~buildbot/docs/latest/developer-guide.html#_variables (scroll down to the input and output tables) For user interfaces, clients should scale their graphs against the "input.voltage.nominal" and "output.voltage.nominal" variables. (This is what is done in the CGI scripts). Since you don't want to modify a driver, you probably want to pick a protocol which sends back the nominal voltages in an easy-to-parse fashion. (For instance, the Tripp Lite protocols encode the line voltage as an enumeration, so there would be no easy way to tell it that "line voltage" is not 120V or 230V.)> Once finished I plan to open-source my firmware (written in a mix of > C/C++ for the Arduino IDE for AVR microcontrollers) and document my > build for all to see.Sounds cool!