Had a 5+ hour utility outage - time to think about graceful shutdown when the UPS is exhausted...

JimS

Active Member
Had a storm roll though this morning and the power went off at about 5:30 AM.  Was restored a bit after 11 AM.  Very unusual.  We usually get a short, couple minutes at the most, outage every couple months.  Have a couple network nodes that use a Raspberry Pi so have possible SD card corruption issues if powered down without proper software shutdown.  These are powered by a UPS.  Have thought about detecting loss of AC power and sending a command over the network to shut down.  Need to do a few other adjustments too like figuring out what really needs to be on the UPS to maximize run time.
 

wkearney99

Senior Member
I have an assortment of UPS units around the house, supporting various DVRs, game console, computers and TVs.  Power hiccups around here often enough that having them dramatically cut down on the number of blown power supplies and other electronic device failures.  

It's been on my 'to do' list for ages to rig up something with a pi zero attached to the USB socket on all these to have more direct monitoring and control.   Something like NUT or apcupsd on them and it'd be possible to do network-wide monitoring via wifi.

It gets messy, though, as few devices have means to support being told to power back up again.  I'd have to get into an assortment of smart outlets or something to deal with the devices that don't have Wake-on-LAN functionality.  It's kind of a chicken/egg scenario as once you power off a UPS you can't really power it back up again unless you either tap the button or have the connected computer on the USB power do it.  But that won't have power because, presumably, it was running from the UPS.  

There's a couple of other factors to consider, namely how much capacity the UPS has and whether or not power is "really back" or not.  

The added hassle, for me anyway, is that our generator doesn't make a true sine wave that the UPS units want in order to recharge themselves. 

So power really has to be back 'for sure' otherwise the UPS units may not have enough capacity to handle a full power-on and power-off cycle again (or more than once if power is really intermittent).
 

JimS

Active Member
wkearney99 said:
I have an assortment of UPS units around the house, supporting various DVRs, game console, computers and TVs.  Power hiccups around here often enough that having them dramatically cut down on the number of blown power supplies and other electronic device failures.  

It's been on my 'to do' list for ages to rig up something with a pi zero attached to the USB socket on all these to have more direct monitoring and control.   Something like NUT or apcupsd on them and it'd be possible to do network-wide monitoring via wifi.

It gets messy, though, as few devices have means to support being told to power back up again.  I'd have to get into an assortment of smart outlets or something to deal with the devices that don't have Wake-on-LAN functionality.  It's kind of a chicken/egg scenario as once you power off a UPS you can't really power it back up again unless you either tap the button or have the connected computer on the USB power do it.  But that won't have power because, presumably, it was running from the UPS.  

There's a couple of other factors to consider, namely how much capacity the UPS has and whether or not power is "really back" or not.  

The added hassle, for me anyway, is that our generator doesn't make a true sine wave that the UPS units want in order to recharge themselves. 

So power really has to be back 'for sure' otherwise the UPS units may not have enough capacity to handle a full power-on and power-off cycle again (or more than once if power is really intermittent).
Yep.  The pi is like that - you can tell it to shut down and that works fine.  But to restart you need to turn the power off and on again.  If you shut it down and the utility comes back on before the UPS quits it won't restart.  I had thought about it a few years back and think I had something figured out but never built.  
 

wkearney99

Senior Member
JimS said:
Yep.  The pi is like that - you can tell it to shut down and that works fine.  But to restart you need to turn the power off and on again.  If you shut it down and the utility comes back on before the UPS quits it won't restart.  I had thought about it a few years back and think I had something figured out but never built.  
Yeah, if it was an enterprise server situation I'd "do something about it" but it's just the house and it never really rises above the noise level of everything else that "needs doing".
 

pete_c

Guru
Recently over the last year purchased new batteries for my UPS's and redid all my UPS management stuff to using extra RPi's that I had sitting around unused.
 
Followed this a bit.
 
Network UPS Tools (NUT) Ultimate Guide
 
[youtube]http://youtu.be/vyBP7wpN72c[/youtube]
 
One old Cyberpower 1500 was giving me problems and I was able to repair it.
 
Wrote up my repairs here ==>
 
CyberPower 1350AVR and 1500AVR - Repair (did not need to fix the Cyberpower 1350 AVR)
 
I used the Home Assistant Network UPS Tools add on for this.
 
I have two UPS's on the rack, TV UPS, Telco UPS (PFSense) and office UPS.

[sharedmedia=gallery:images:1535]
 

[sharedmedia=gallery:images:1534]
[sharedmedia=gallery:images:1533]
 
 
 

pete_c

Guru
I was originally going to throw out the Cyberpower 1500 UPS and it cost less than $10 to fix it.  I did purchase two new Cyberpower 1500's and retired two older Tripplite UPS's.

The telco panel now has two PFSense boxes (one is a backup), XFinity modem, T-Mobile modem, managed Gb switch and managed Gb POE switch. It does go for hours now providing internet and telephone (Ruckus WAP is also plugged in) should the power go down. Using a Ooma and Obi202 VOIP box there plus powered up the two Panasonic 2 line DECT bases off of the telco part of the basement.
 
Top