<div dir="ltr">Ok, my super long reply is waiting on moderation. In the meantime, I have started: <br><a href="https://github.com/networkupstools/nut/wiki/DIY-UPS-with-and-Arduino">https://github.com/networkupstools/nut/wiki/DIY-UPS-with-and-Arduino</a><br><br><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 16, 2024 at 10:59 AM gene heskett via Nut-upsuser <<a href="mailto:nut-upsuser@alioth-lists.debian.net">nut-upsuser@alioth-lists.debian.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 5/16/24 08:59, Jim Klimov via Nut-upsuser wrote:<br>
> I agree with earlier posters, such documentation can help future <br>
> tinkerers. There is probably more than just one to hold the hand and <br>
> walk through the ordeals :)<br>
> <br>
> Perhaps a new page at <a href="https://github.com/networkupstools/nut/wiki" rel="noreferrer" target="_blank">https://github.com/networkupstools/nut/wiki</a> <br>
> <<a href="https://github.com/networkupstools/nut/wiki" rel="noreferrer" target="_blank">https://github.com/networkupstools/nut/wiki</a>> can be a good location...<br>
> <br>
> Jim<br>
> <br>
Great Idea Jim.<br>
> <br>
> On Thu, May 16, 2024 at 1:29 PM Bill Gee <<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a> <br>
> <mailto:<a href="mailto:bgee@campercaver.net" target="_blank">bgee@campercaver.net</a>>> wrote:<br>
> <br>
> Hi Kelly -<br>
> <br>
> As an Arduino nerd, I am interested in this! I am sure others on the<br>
> list would be interested. If nothing else, it would be nice to have<br>
> some documentation in the archives.<br>
> <br>
> I assume you set it up as an online system rather than a standby<br>
> system.<br>
> Right? If true, then the choice of inverter is fairly critical. It<br>
> has to be bomb-proof reliable.<br>
> <br>
> What did you choose for battery voltage? What is the power capacity of<br>
> the inverter?<br>
> <br>
> Which Arduino did you use? All of my Arduino projects use the Pro<br>
> Mini,<br>
> though it would be quite easy to get some other model for this.<br>
> <br>
> Thanks -<br>
> ===============<br>
> Bill Gee<br>
> <br>
> On 5/15/24 20:11, Kelly Byrd wrote:<br>
> > I put together my own DIY UPS, it's a RV charger/converter, an<br>
> > inverter, and some batteries. I use an Arduino and the<br>
> HIDPowerDevice<br>
> > library (<a href="https://github.com/abratchik/HIDPowerDevice" rel="noreferrer" target="_blank">https://github.com/abratchik/HIDPowerDevice</a><br>
> <<a href="https://github.com/abratchik/HIDPowerDevice" rel="noreferrer" target="_blank">https://github.com/abratchik/HIDPowerDevice</a>><br>
> > <<a href="https://github.com/abratchik/HIDPowerDevice" rel="noreferrer" target="_blank">https://github.com/abratchik/HIDPowerDevice</a><br>
> <<a href="https://github.com/abratchik/HIDPowerDevice" rel="noreferrer" target="_blank">https://github.com/abratchik/HIDPowerDevice</a>>>) to get it to talk to<br>
> NUT.<br>
> > Been working great for months!<br>
> ><br>
> > The Arduino is connected to two modules:<br>
> > * AC detection circuit to measure mains power on/off<br>
> > * Voltage divider and an external ADC to get a reasonably good DC<br>
> > voltage level for the battery which I turn into the a charge<br>
> percentage.<br>
> ><br>
> > This uses the USBHID driver in NUT and "just works" as long as<br>
> you're<br>
> > using NUT 2.8.2 or later. I used the example code in the<br>
> HIDPowerDevice<br>
> > library as a starting point for running on my Arduino.<br>
> ><br>
> > I can share more specifics about the Arduino side of things off<br>
> list if<br>
> > you want, the NUT side of things is pretty boring and normal.<br>
> ><br>
> > On Wed, May 15, 2024 at 3:27 PM Kiril Zyapkov via Nut-upsuser<br>
> > <<a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a><br>
> <mailto:<a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a>><br>
> > <mailto:<a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a><br>
> <mailto:<a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a>>>> wrote:<br>
> ><br>
> > Hello,<br>
> ><br>
> > I found out about NUT just days ago while searching for a<br>
> solution<br>
> > for my home setup. After some digging through the interwebs,<br>
> I come<br>
> > to you with questions.<br>
> ><br>
> > I'm putting together a DIY 12V UPS, very similar to what this<br>
> guy did:<br>
> ><br>
> > [1]<br>
> ><br>
> <a href="https://baldpenguin.blogspot.com/2015/10/diy-12v-ups-for-home-network-equipment.html" rel="noreferrer" target="_blank">https://baldpenguin.blogspot.com/2015/10/diy-12v-ups-for-home-network-equipment.html</a> <<a href="https://baldpenguin.blogspot.com/2015/10/diy-12v-ups-for-home-network-equipment.html" rel="noreferrer" target="_blank">https://baldpenguin.blogspot.com/2015/10/diy-12v-ups-for-home-network-equipment.html</a>> <<a href="https://baldpenguin.blogspot.com/2015/10/diy-12v-ups-for-home-network-equipment.html" rel="noreferrer" target="_blank">https://baldpenguin.blogspot.com/2015/10/diy-12v-ups-for-home-network-equipment.html</a> <<a href="https://baldpenguin.blogspot.com/2015/10/diy-12v-ups-for-home-network-equipment.html" rel="noreferrer" target="_blank">https://baldpenguin.blogspot.com/2015/10/diy-12v-ups-for-home-network-equipment.html</a>>><br>
> ><br>
> > The objective is to keep a bunch of mini PCs and network gear<br>
> online<br>
> > for as long as the battery lasts and then provide a mechanism<br>
> for a<br>
> > graceful shutdown of my NAS and other appliances for which<br>
> cutting<br>
> > power would not be healthy. The project above is missing the<br>
> > "connected" part. I want to get mine to play with NUT nicely.<br>
> Other<br>
> > prior art is this project:<br>
> ><br>
> > [2] <a href="https://github.com/xm381/Raspberry-Pi-UPS" rel="noreferrer" target="_blank">https://github.com/xm381/Raspberry-Pi-UPS</a><br>
> <<a href="https://github.com/xm381/Raspberry-Pi-UPS" rel="noreferrer" target="_blank">https://github.com/xm381/Raspberry-Pi-UPS</a>><br>
> > <<a href="https://github.com/xm381/Raspberry-Pi-UPS" rel="noreferrer" target="_blank">https://github.com/xm381/Raspberry-Pi-UPS</a><br>
> <<a href="https://github.com/xm381/Raspberry-Pi-UPS" rel="noreferrer" target="_blank">https://github.com/xm381/Raspberry-Pi-UPS</a>>><br>
> ><br>
> > Mentioned in a previous thread here:<br>
> ><br>
> > [3]<br>
> ><br>
> <a href="https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-August/011198.html" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-August/011198.html</a> <<a href="https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-August/011198.html" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-August/011198.html</a>> <<a href="https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-August/011198.html" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-August/011198.html</a> <<a href="https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-August/011198.html" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/pipermail/nut-upsuser/2018-August/011198.html</a>>><br>
> ><br>
> > A valid approach -- emulates an existing protocol on an arduino.<br>
> ><br>
> > Are there other similar projects that you know of? I found<br>
> plenty of<br>
> > "DIY UPS" projects, but none were "smart".<br>
> ><br>
> > I am able to put together firmware for some micro which will take<br>
> > care of measuring voltages, currents, possibly also turn on/off<br>
> > loads, serial or USB or IP are options. Not sure yet what<br>
> hardware<br>
> > features I'll put together, but this depends somewhat on the<br>
> > approach for getting this thing integrated with NUT. PSUs and<br>
> > batteries are already on the way, and my junk drawers have most<br>
> > other parts I may need.<br>
> ><br>
> > So, options found so far:<br>
> ><br>
> > * Use genericups. Least favorite option, very limited features<br>
> ><br>
> > * Use the same approach as [2]. If I were to go that route --<br>
> which<br>
> > is the best protocol to pick for emulation? I'm looking for<br>
> > something simple, extensible/flexible and well-documented.<br>
> ><br>
> > But what I really wish was possible was the ability to<br>
> describe my<br>
> > device in some format, feed it to a generic driver in NUT and<br>
> > profit. I see some efforts have been made in this direction, most<br>
> > notably:<br>
> ><br>
> > [4]<br>
> ><br>
> <a href="https://github.com/networkupstools/nut/wiki/Data-Mapping-File-(DMF)" rel="noreferrer" target="_blank">https://github.com/networkupstools/nut/wiki/Data-Mapping-File-(DMF)</a><br>
> <<a href="https://github.com/networkupstools/nut/wiki/Data-Mapping-File-(DMF)" rel="noreferrer" target="_blank">https://github.com/networkupstools/nut/wiki/Data-Mapping-File-(DMF)</a>><br>
> > <br>
> <<a href="https://github.com/networkupstools/nut/wiki/Data-Mapping-File-(DMF)" rel="noreferrer" target="_blank">https://github.com/networkupstools/nut/wiki/Data-Mapping-File-(DMF)</a> <<a href="https://github.com/networkupstools/nut/wiki/Data-Mapping-File-(DMF)" rel="noreferrer" target="_blank">https://github.com/networkupstools/nut/wiki/Data-Mapping-File-(DMF)</a>>><br>
> ><br>
> > What is the state there? Is it usable for USB HID? Or, how hard<br>
> > would it be to make it usable? Even a modbus description will<br>
> do --<br>
> > implementing the modbus server (yes, server, I'm being<br>
> > politically-correct) over serial or even TCP is easy, if only<br>
> there<br>
> > was a way to dump a CSV with register descriptions in some<br>
> magical<br>
> > driver...<br>
> ><br>
> > And yet another approach which comes to mind is to implement my<br>
> > driver as an external executable. This may be completely<br>
> unfeasible<br>
> > and stupid, and please let me know if it is. But, from what I<br>
> > gather, drivers run in their own process and talk to the<br>
> daemon via<br>
> > a UNIX socket. Why not make it possible for the driver to be just<br>
> > any executable, built/deployed outside of the NUT codebase? The<br>
> > socket protocol seems simple enough, and this will allow for ...<br>
> > creativity. It could be implemented in any language (including<br>
> > scripting languages) and need not depend on anything<br>
> NUT-specific,<br>
> > other than maybe some common CLI interface and/or configuration.<br>
> ><br>
> > I'm hoping the NUT masters will have some insight. Thanks for<br>
> > working on this!<br>
> ><br>
> > Cheers,<br>
> > Kiril<br>
> > _______________________________________________<br>
> > Nut-upsuser mailing list<br>
> > <a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
> <mailto:<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a>><br>
> > <mailto:<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
> <mailto:<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a>>><br>
> ><br>
> <a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
> <<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a>><br>
> > <br>
> <<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a> <<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a>>><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Nut-upsuser mailing list<br>
> > <a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
> <mailto:<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a>><br>
> ><br>
> <a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
> <<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a>><br>
> <br>
> _______________________________________________<br>
> Nut-upsuser mailing list<br>
> <a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
> <mailto:<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a>><br>
> <a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
> <<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a>><br>
> <br>
> <br>
> _______________________________________________<br>
> Nut-upsuser mailing list<br>
> <a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
> <a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
<br>
Cheers, Gene Heskett, CET.<br>
-- <br>
"There are four boxes to be used in defense of liberty:<br>
soap, ballot, jury, and ammo. Please use in that order."<br>
-Ed Howdershelt (Author, 1940)<br>
If we desire respect for the law, we must first make the law respectable.<br>
- Louis D. Brandeis<br>
<br>
<br>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</blockquote></div>