[Nut-upsuser] Supporting a DIY UPS with minimal effort but maximum gain

Kiril Zyapkov kiril.zyapkov at gmail.com
Wed May 15 21:47:26 BST 2024


Hello,

I found out about NUT just days ago while searching for a solution for my
home setup. After some digging through the interwebs, I come to you with
questions.

I'm putting together a DIY 12V UPS, very similar to what this guy did:

[1]
https://baldpenguin.blogspot.com/2015/10/diy-12v-ups-for-home-network-equipment.html

The objective is to keep a bunch of mini PCs and network gear online for as
long as the battery lasts and then provide a mechanism for a graceful
shutdown of my NAS and other appliances for which cutting power would not
be healthy. The project above is missing the "connected" part. I want to
get mine to play with NUT nicely. Other prior art is this project:

[2] https://github.com/xm381/Raspberry-Pi-UPS

Mentioned in a previous thread here:

[3]
https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-August/011198.html

A valid approach -- emulates an existing protocol on an arduino.

Are there other similar projects that you know of? I found plenty of "DIY
UPS" projects, but none were "smart".

I am able to put together firmware for some micro which will take care of
measuring voltages, currents, possibly also turn on/off loads, serial or
USB or IP are options. Not sure yet what hardware features I'll put
together, but this depends somewhat on the approach for getting this thing
integrated with NUT. PSUs and batteries are already on the way, and my junk
drawers have most other parts I may need.

So, options found so far:

* Use genericups. Least favorite option, very limited features

* Use the same approach as [2]. If I were to go that route -- which is the
best protocol to pick for emulation? I'm looking for something simple,
extensible/flexible and well-documented.

But what I really wish was possible was the ability to describe my device
in some format, feed it to a generic driver in NUT and profit. I see some
efforts have been made in this direction, most notably:

[4] https://github.com/networkupstools/nut/wiki/Data-Mapping-File-(DMF)

What is the state there? Is it usable for USB HID? Or, how hard would it be
to make it usable? Even a modbus description will do -- implementing the
modbus server (yes, server, I'm being politically-correct) over serial or
even TCP is easy, if only there was a way to dump a CSV with register
descriptions in some magical driver...

And yet another approach which comes to mind is to implement my driver as
an external executable. This may be completely unfeasible and stupid, and
please let me know if it is. But, from what I gather, drivers run in their
own process and talk to the daemon via a UNIX socket. Why not make it
possible for the driver to be just any executable, built/deployed outside
of the NUT codebase? The socket protocol seems simple enough, and this will
allow for ... creativity. It could be implemented in any language
(including scripting languages) and need not depend on anything
NUT-specific, other than maybe some common CLI interface and/or
configuration.

I'm hoping the NUT masters will have some insight. Thanks for working on
this!

Cheers,
Kiril
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20240515/221351ca/attachment.htm>


More information about the Nut-upsuser mailing list