Suche USV für einen RPi4

Dec 19, 2022 Last reply: 3 years ago 35 Replies

Hallo zusammen,



ich betreiben einen RPi4b mit 4GB, einer 120GB M1 SSD über USB (bootbar), Buster und Kernel 5.4.72-v7l+ (SMP) armv7l.



Jetzt hatte ich schon 2 Stromausfälle in diesem Jahr und jedes mal war das FS defekt. /boot ist vfat und /root ist ext4. OK, es konnte repariert werden, funktionierte nur nicht automatisch.



Meine Idee ist es nun, den Pi mit einer USV auszurüsten. Mein Interesse hat der StromPi3 geweckt, habe aber noch ein paar fragen dazu. Eventuell hat ja jemand von hier ein paar Antworten.



a) Kennt jemand eine Alternative?



b) Auf der Internetseite zum StromPi3 sieht es so aus, als wenn der Strom-Pi nur über eine GUI konfiguriert werden kann. Bei mir läuft aber kein Desktop. Kann ich den StromPi3 auch über das Terminal im Fernzugriff konfigurieren?



c) So wie ich die Anleitung lese, kann der StromPi den Rpi runter fahren. Das geht aber wohl nur zeitgesteuert und nicht in Abhängigkeit des Akku Ladezustands. Kann das jemand bestätigen oder kennt eine Lösung das in Abhängigkeit der Akkuspannung zu machen?



d) Der zugehörige Akkt hat eine Kapazität von 1000 bzw. 2000mAh. Kann mir jemand sagen, wie lange der RPi damit betrieben werden kann?



Danke und schöne Feiertage hawe


On a sunny day (Mon, 19 Dec 2022 07:02:50 +0100) it happened Hans-Werner Kneitinger snipped-for-privacy@gmx.de wrote in <tnouqa$78ad$ snipped-for-privacy@dont-email.me:

All my 24/7 on Pis including USB hubs and hardidsks run on a UPS.

Hello, everyone,

I run an RPI4B with 4GB, a 120GB M1 SSD via USB (bootbar), Buster and Kernel 5.4.72-V7L+ (SMP) ARMV7L.

Now I already had 2 power failures this year and every time the FS was defective. /Boot is VFAT and /ROOT is ext4. Ok, it could be repaired, just didn't work automatically.

My idea is now to equip the PI with a UPS. The StromPi3 sparked my interest, but I have a few more questions about it. Maybe someone from here has a few answers.

a) Does anyone know an alternative?

b) On the website to the StromPi3, it looks as if the electricity PI can only be configured via a GUI. But I don't run a desktop. Can I also configure the StromPi3 using the terminal in remote access?

c) As I read the instructions, the StromPi can drive down the RPI. But that is probably only time -controlled and not depending on the battery of the charge. Can someone confirm this or knows a solution that is depending on the battery voltage?

d) The associated accommodation has a capacity of 1000 or 2000mAh. Can someone tell me how long the RPI can be operated?

Thanks and nice holidays hawe

Am 19.12.22 um 08:17 schrieb Jan Panteltje:

Would you like to tell me which one you use? Is it a regular UPS or a HAT for the Pi?

One suggestion, Hawe, for a UPS are the so-called "Power Banks". There's no interaction with the RPi, it's just a source of 5V power, but some of those devices will deliver a continuous 5V when the "mains" power is removed. So you would have:

Wall socket => Power Bank => Raspberry Pi

Perhaps someone can recommend a suitable device - the one I have is long out of production? This might give a few hours, depending on the load.

If all you want to back up is a single Pi, no.

If you want to back up a cluster of devices (modem, router, etc) it might be worth looking at a standard inverter/charger of the kind used on boats and RVs. At 120 volts there's a ~250$ one from Ampinvt available on Amazon. The unit includes a transfer switch, inverter, battery charger and control logic. You connect a standard 12 volt battery and plug your mains power supplies in to the inverter charger.

This is just a dumb UPS setup, but a 100AH battery (~300$ for LiFePO4) will keep a 50 watt load running for about a day. It'll allow you to plug in more if needed. It's a lot more expensive than the StromPi3 but also more versatile. Pulling the mains plug while the system is running my refrigerator and a Pi4 with monitor results in a seamless transfer to battery with no disturbance to the Pi4.

I have two such setups, one for computers/network and one for the kitchen refrigerator. I can't really endorse Ampinvt's tech support but the devices are useful and relatively cheap.

Not sure what's available at 220 volt, that might be a problem.

HTH,

bob prohaska

Thank you for your answer and suggestion. It is a very easy solution. Will have a look, but it seems it is hard to find a powerbank with pass through. One thing I'm missing - save shutdown.

On a sunny day (Mon, 19 Dec 2022 09:22:35 +0100) it happened Hans-Werner Kneitinger snipped-for-privacy@gmx.de wrote in <tnp70b$7q6f$ snipped-for-privacy@dont-email.me:

It is a APC_UPS_700VA

That one is no longer made (bought it in 2019) It also runs a PC sometimes, as well as some other electronics I have:

formatting link
It does what it should do, almost every day here there are short (maybe less than one second) mains interruptions when the power company switches something.

Am 20.12.22 um 06:46 schrieb Jan Panteltje:

Thank you for answer

Am 19.12.22 um 10:41 schrieb Kees Nuyt:

Thank you for answer and suggestion. Stemdiy did not sell to Germany, but that's no problem. I found other solution based on what you wrote. Geekworm seems to have a lot of fine solutions. So I have to think about it.

Am 2022-12-19 hat Hans-Werner Kneitinger geschrieben:

Ja, das stimmt, geht nur nach Zeit. Aber Du kannst Dir für das Geld (StromPi + Akku) schon fast eine richtige USV anschaffen. Das muß ja keine mit mehreren kW Leistung sein, da reicht eine kleine die aussieht wie eine etwas dickere Steckdosenleiste. Die hat den Vorteil, daß auch andere Geräte überbrückt werden, beispielsweise ein Switch oder Peripherie, die am Raspi hängt. Die meisten USVs haben eine Schnittstelle, über die sie ihren Zustand preisgeben. Die läßt sich mit dem Raspi verbinden und Du hast eine Lösung, die Du nach eigenem Ermessen konfigurieren kannst.

Abseits davon: Wenn Du Akkuspannungsgesteuert runterfahren willst würde mir als erstes ein AD-Wandler einfallen, den man alle paar Sekunden nach der Akku- spannung fragen kann (max. 3.3V-Pegel der Raspi-Eingänge beachten!). Sinkt der Wert unter eine gewisse Schwelle -> "shutdown -h now". Dürfte mit ein paar Zeilen Python erledigt sein. Aber vermutlich gibt's auch hier fertige Lösungen, ich kann Dir leider mangels Kenntnis gerade keine nennen.

Yes, Hawe, if save on shutdown matters you need something better.

Cheers. David

Thanks to all for replies. It is much more clear what to do.

happy holidays hawe

I've been using a Riello UPS to power my house server and local LAN since

2014.

It uses a pair of 12v, 7.2 AH SLA batteries as its backup and can be run either with the batteries continuously in circuit or with them out of circuit but ready to switch in instantaneously if the mains drops. I've tried both modes: both work well, but its quieter with the batteries on standby (batteries continuously in circuit has the charging circuit and its fan running continuously). It has four mains outlet sockets, so can run a server, its display, and a network switch or two without and messing about with mains extensions or towers of plugs.

Its batteries got replaced last year, i.e. they lasted 8 years of continuous use in-circuit.

The UPS batteries will run my house server for 50 minutes, but I have the UPS configured to tell the house server to shut down after 10 minutes of no mains power because over here mains outages are generally less than a second, i.e. just long enough to dump a PC, except occasionally when mains power can be out for hours: having drained batteries still connected to a load is a good way to destroy them.

This setup is installed in the UK, so it is on 240v mains.

Riello UPSs aren't exactly cheap: but I'm happy I bought mine: it is about the same size and price as the server it provides power for and does exactly what I bought it to do.

NOTE: The small, cheap UPSs meant to power a single desktop PC are, IMO useless because they don't have the ability to tell a PC to shut down cleanly after a preset time or when the UPS battery is drained.

For small(ish) loads that sounds good. I had hopes of running my fridge, and wanted to "borrow" an automotive battery for testing purposes, as I didn't have a great deal of faith in the cheapest inverter charger on Amazon. The first unit purchased worked exceedingly well, but it quickly became apparent that a lead-acid battery, even though it was deep cycle, didn't perform very well. LiFePO4 is considerably better in terms of voltage sag and recharge rate.

The second inverter/charger purchased works correctly but seems prone to subtle instability in charging behavior and overload warning. That makes me hesitant to recommend it, though I've kept the second unit in service and have so far (6 months) observed no disqualifying behavior. Indeed, for the price it looks hard to beat.

[snip]

Outages here are usually caused by trees, which makes restoration slower. A half-day is fast, overnight more typical.

Understood, I'll admit I couldn't find any comparably cheap 220/240 volt inverter chargers, at least not in the US on Amazon. The 220/240 units on offer are typically over $500, which diminishes the appeal.

To my way of thinking it's simpler and easier to just give the UPS enough endurance so that most outages can be ignored for at least a few hours or overnight. For small loads it isn't expensive compared to the equipment being backed up.

Thanks for reading,

bob prohaska

A powerbank seems like a good idea, worth a test.

Save/shutdown could be initiated by a shell script monitoring "low voltage", from the powerbank. Or possibly using a failing heartbeat (ping) to another device which is connected to the same power socket, but without the intermediate powerbank, e.g. a router.

The OP only wants to run a Pi4 (but doesn't say how much power the stuff controlled by it uses, but it looks like thats just an SSD, so probably one of the Pi HAT UPS boards would do the trick, with an SLA as a backup would fit his requirement.

Understood. In most of the UK the falling tree problem is a non-issue because both power and phone lines tend to be in roadside trenches, specifically to avoid the falling tree problem: the 1987 storm accelerated the process of putting mains cables underground.

I originally bought the UPS when my (in-town) supply developed the habit of having sub-second power glitches - needless to say that problem was fixed about the time my UPS was unstalled.

Understood, but IMO anyway the UPS capability to tell the the system its powering to shut down cleanly if the UPS battery is depleted is well worth paying a bit extra for, particularly if your UPS power requirements and on-battery runtimes are long enough to sorta/somehow justify installing a small IC generator and configuring the UPS to tell your server to power up the generator and going back y sleep once that's running.

After all, a few litres of petrol or diesel fuel is a lot cheaper than the equivalent amount of battery capacity.

Indeed, it seems he only wanted to avoid corrupting the filesystem via an ungraceful shutdown or perhaps an interrupted restart. To that end it might suffice to just keep the system from restarting immediately to let the power settle down.

8-)

Whether one wants to maintain service or simply avoid damage makes a big difference. For the OP, who just wants to avoid damage, a manual restart device might be sufficient.

Fuel consuption on small generators is surprisingly high, around .1 gph per kW (capacity plus load). The smallest domestically useful generator (~2kW) will burn close to a litre per hour.

I started with a generator and gradually realized that a UPS is much more useful. A generator is necessarily intermittent and truly useful only if the UPS grants at least a few hours' operation, for example while waiting to see if the power will come back on. To some extent I'm suggesting the OP's original goal is likely to be incomplete: it's simpler ( not cheaper) to back up the entire connected system rather than protect a single element and let the rest go down. To that end, endurance is a useful feature.

Thanks for reading!

bob prohaska

Exactly. Power failure always happens when I was not at home. And then the FS (ext4, did not recover automaticity at boot. Even it is set via tune2fs to check every boot) is always corrupted so that the Pi cannot start.

Router and other things are always starting after power failure.

Happy holidays & qapla' hawe

On a sunny day (Tue, 20 Dec 2022 20:27:23 -0000 (UTC)) it happened bob prohaska snipped-for-privacy@www.zefox.net> wrote in <tnt5ra$pfcb$ snipped-for-privacy@dont-email.me:

For long outages I have a 250 Ah lifpo4 batery pack and a 2 kW pure sinewave converter it will run TV and fridge for hours, even allows you to use the microwave:

formatting link
top of that I have a set of flexible solar panels I can for example lay out in the garden, it has a charger converter for the Lifepo4 battery pack. Actually more for on a boat... One option, I have gas heating but it uses electricity to work I think I can flip off all mains switches and feed it my 230 V sine wave and still have gas heating!

Now I realy need an RTG!

:-)

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required