kot7k
Posts: 4
Joined: Sat Jan 11, 2020 4:01 pm

RPi4 wake up after power failure

Sat Jan 11, 2020 4:16 pm

Hi,
I just bought a RPi4 as an upgrade to my previous banana pi. I liked banana pi cause it had a 1Gbit ethernet port and now that Rpi4 also have it it was a good time for me to upgrade. The thing is i use it as a server and it has to be powered on all the time. The other day there was a short power failure in my town, the thing is my banana pi boot up itself when it noticed it had a power source again but raspberry pi 4 stayed on a shutdown state.
Is this the normal behaviour? I have an "argon one" case wich has a button to power it on, might it be because of that? and if it is... do i have any option to change this behaviour? I would like the Rpi4 to boot when the power is up.

W. H. Heydt
Posts: 15892
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: RPi4 wake up after power failure

Sat Jan 11, 2020 9:21 pm

Get a UPS. Short power outages can corrupt the filesystem for the usual reasons.

gkaiseril
Posts: 679
Joined: Mon Aug 08, 2016 9:27 pm
Location: Chicago, IL

Re: RPi4 wake up after power failure

Sat Jan 11, 2020 9:29 pm

The power button most likely prevents the restart after a power failure. Some consider this a benefit since the device is powered off during the period of many power spikes when power is restored and the many heavy draw devices power up causing power surges. As noted a ups can also help in this situation if it filters the power line supplied voltage.
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.

klricks
Posts: 8392
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: RPi4 wake up after power failure

Sat Jan 11, 2020 9:32 pm

kot7k wrote:
Sat Jan 11, 2020 4:16 pm
Hi,
I just bought a RPi4 as an upgrade to my previous banana pi. I liked banana pi cause it had a 1Gbit ethernet port and now that Rpi4 also have it it was a good time for me to upgrade. The thing is i use it as a server and it has to be powered on all the time. The other day there was a short power failure in my town, the thing is my banana pi boot up itself when it noticed it had a power source again but raspberry pi 4 stayed on a shutdown state.
Is this the normal behaviour? I have an "argon one" case wich has a button to power it on, might it be because of that? and if it is... do i have any option to change this behaviour? I would like the Rpi4 to boot when the power is up.
Normally the RPi will boot when the power comes back on. If the power outage is too short or a 'brown out', then it may or may not boot properly.
Does the RPi boot when you remove and replace the USB-C power connection? Or must you also press the power on button? If so then the power switch is to blame.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

kot7k
Posts: 4
Joined: Sat Jan 11, 2020 4:01 pm

Re: RPi4 wake up after power failure

Sun Jan 12, 2020 1:23 pm

klricks wrote:
Sat Jan 11, 2020 9:32 pm
kot7k wrote:
Sat Jan 11, 2020 4:16 pm
Hi,
I just bought a RPi4 as an upgrade to my previous banana pi. I liked banana pi cause it had a 1Gbit ethernet port and now that Rpi4 also have it it was a good time for me to upgrade. The thing is i use it as a server and it has to be powered on all the time. The other day there was a short power failure in my town, the thing is my banana pi boot up itself when it noticed it had a power source again but raspberry pi 4 stayed on a shutdown state.
Is this the normal behaviour? I have an "argon one" case wich has a button to power it on, might it be because of that? and if it is... do i have any option to change this behaviour? I would like the Rpi4 to boot when the power is up.
Normally the RPi will boot when the power comes back on. If the power outage is too short or a 'brown out', then it may or may not boot properly.
Does the RPi boot when you remove and replace the USB-C power connection? Or must you also press the power on button? If so then the power switch is to blame.
Thank you, thats what i wanted to know. I'm not currently where the pi is so i can't test it that right now but will report when i can. Even thou, i'm 90% sure that i will have to press power button for booting even if i unplug and plug the usb-c cable. It is really an inconvenient to me as i didn´t want this behavior, not sure if i could disable that power button someway...
Anyways will report again.

PD: about ups, i saw some posts here about people connecting pis to power banks and then the power banks to wall. It seemed like a good solution for me but i dont have much space where the pi is and i wouldnt want to have more things there.

W. H. Heydt
Posts: 15892
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: RPi4 wake up after power failure

Sun Jan 12, 2020 4:10 pm

kot7k wrote:
Sun Jan 12, 2020 1:23 pm
PD: about ups, i saw some posts here about people connecting pis to power banks and then the power banks to wall. It seemed like a good solution for me but i dont have much space where the pi is and i wouldnt want to have more things there.
That's a difficult solution. Most powerbanks can't be charging and discharging (that is, powering something) at the same time. And, indeed, powering a device, as opposed to recharging the battery in a device is NOT what they're designed to do. It's just convenient that many models of Pis have sufficiently low power requirements that it works at all.

kot7k
Posts: 4
Joined: Sat Jan 11, 2020 4:01 pm

Re: RPi4 wake up after power failure

Sun Jan 12, 2020 7:16 pm

Just tested unplugin and plugin back usb-c and pi4 doesnt boot automatically with argon one case. I have to press power button.
Any chance someone with same case know how to bypass this? I would prefer not having power button at all as i'm not even near the pi most of the time. Shame on me not thinking about this when i bought it... :/

gkaiseril
Posts: 679
Joined: Mon Aug 08, 2016 9:27 pm
Location: Chicago, IL

Re: RPi4 wake up after power failurean

Sun Jan 12, 2020 8:46 pm

One should be aware that power losses that result in an uncontrolled power down can cause a loss of data that includes the corruption of the boot process.
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.

Heater
Posts: 19101
Joined: Tue Jul 17, 2012 3:02 pm

Re: RPi4 wake up after power failure

Sun Jan 12, 2020 8:48 pm

kot7k,
Just tested unplugin and plugin back usb-c and pi4 doesnt boot automatically with argon one case.
Let me get this straight. You are not plugging/unplugging the USB C to the Pi board itself?

Rather through whatever connectivity there is in the case?

Why not ditch the case and be happy ?
Memory in C++ is a leaky abstraction .

BlackKnight_UK
Posts: 94
Joined: Mon Jan 02, 2017 10:51 am

Re: RPi4 wake up after power failure

Tue Feb 11, 2020 11:12 am

Keep the Argon One but ditch the board that extends the power socket, etc. to the back panel?

JesterSoft
Posts: 1
Joined: Sat May 09, 2020 11:39 am

Re: RPi4 wake up after power failure

Sat May 09, 2020 11:41 am

Faced the same problem, you need to manually turn on the device through the button Argone One Case. Did someone solve the auto start problem after powering up?

tanako
Posts: 2
Joined: Tue May 26, 2020 5:53 pm

Re: RPi4 wake up after power failure

Tue May 26, 2020 6:00 pm

I just got into this issue today. My first day with ArgonOne.

The case ventilation seems to be awesome according to many reviews but like others my Pi is, most of the time, not near me.

I already have UPS as power source but normally it lasted only 40 mins at best (I have other Home Server using the same UPS)

And for time to time, power outage take hours. So I would be very handy to be able to get it back up ASAP.

User avatar
peterscargill
Posts: 17
Joined: Fri Apr 17, 2015 10:40 pm
Location: Northumberland

Re: RPi4 wake up after power failure

Tue Jun 02, 2020 2:26 pm

W. H. Heydt wrote:
Sat Jan 11, 2020 9:21 pm
Get a UPS. Short power outages can corrupt the filesystem for the usual reasons.
Even with a UPS there might be a reason the power is lost - most cheap UPS are usless after several hours of lost power - lead acid ones end up dead as the batteries don't always recover. UPS on its own is not the solution for unmanned opetation, the unit must come back on when power is restored. Also UPS which have control over restoring power will not help as there is no interface betwen the button in the Argon ONE and a UPS. I can confirm the Pi2, 3 and 4 will auto power up on their one without that case. I've don it a thousand times. My Pis have a function for graceful shut down. Remove powre and re-apply it and they come on just fine - but not with the Argon case. If someone has solved this withour hacking the argon case I'd love to hear from them.
Regards

Peter Scargill (tech.scargill.net)

bjtheone
Posts: 1965
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: RPi4 wake up after power failure

Tue Jun 02, 2020 6:33 pm

W. H. Heydt wrote:
Sun Jan 12, 2020 4:10 pm
kot7k wrote:
Sun Jan 12, 2020 1:23 pm
PD: about ups, i saw some posts here about people connecting pis to power banks and then the power banks to wall. It seemed like a good solution for me but i dont have much space where the pi is and i wouldnt want to have more things there.
That's a difficult solution. Most powerbanks can't be charging and discharging (that is, powering something) at the same time. And, indeed, powering a device, as opposed to recharging the battery in a device is NOT what they're designed to do. It's just convenient that many models of Pis have sufficiently low power requirements that it works at all.
This and intelligent charging are the main differences between a power bank and a UPS. UPS are specifically designed to allow you to "float" your device off the UPS, so that the UPS deals with over and undervoltage conditions, as well as power outages.

If you only have the Pi and are looking for a cheap kinda/sorta solution you could buy a powerbank that specifically allows for charging and discharging at the same time. Note it may have less filtering ability and less battery management, but is a workable solution for short duration power outages, especially if they are more brownouts that real outages.

rmckenzi
Posts: 2
Joined: Wed Oct 10, 2012 8:17 pm

Re: RPi4 wake up after power failure

Fri Jun 19, 2020 3:25 pm

I came here to look for the same thing .. I love the argon case but it's no use for remote power control via Wifi plug or if the power goes out :( Hoping someone finds a solution or a way to mod the board easily to by-pass the switch .. honestly I don't need a button to power off, never had one on any of my pi's before so not needed.
If you're one of those forum users that like to just leave shitty responses to people, how about not doing it.

Just a thought

Heater
Posts: 19101
Joined: Tue Jul 17, 2012 3:02 pm

Re: RPi4 wake up after power failure

Fri Jun 19, 2020 3:55 pm

Well, if the case is "no use" for what you want to use your Pi system for then why not chuck it in the bin and be happy :)

Alternatively, surely it is not so hard to bypass whatever crappy circuit is handling the power in that case and power the Pi directly.
Memory in C++ is a leaky abstraction .

andy_tog
Posts: 1
Joined: Sat Jul 18, 2020 2:23 am

Re: remote RPi4 wake up (Argon One case, remote switch on via wifi plug)

Sat Jul 18, 2020 2:39 am

I also have a requirement to wake up my RPi4 remotely after a normal remote shutdown command, as I don't have easy physical access to the RPi4.

I want to keep the excellent Argon One case for it's cooling and physical robustness. I simply want to change the behaviour of the power button, so that I can use a Wifi-controlled smart plug to remotely switch on the power and have the RPi4 boot.

Argon40 have a script (https://download.argon40.com/argon1.sh) that seems to control the power button and fan behaviour, but I'm out of my depth on how to modify this script to allow the RPi4 to boot when I remotely switch on the smart plug (without having to press the power button on the case).

Any ideas on what needs to change in this script?

I guess my last resort is to ditch the Argon One case as others have suggested :(

Broekhuijsen
Posts: 2
Joined: Wed Jul 22, 2020 4:39 pm
Location: Lisbon

Re: RPi4 wake up after power failure

Wed Jul 22, 2020 4:52 pm

Well instead of starting about a UPS that has noting to do with the question, I have found the following article:

https://tech.scargill.net/argon-one-cas ... berry-pi4/

Apparently you don't need to do much more than enter a command line

Code: Select all

i2cset -y 1 0x01a 0xfe
To activate the mode to always boot up after a power loss.

I am now reinstalling my pi after screwing up linux, so let's see if this works fine :D

streetlane
Posts: 1
Joined: Mon Aug 17, 2020 4:39 pm

Re: RPi4 wake up after power failure

Mon Aug 17, 2020 4:42 pm

was anyone able to get this script to work? I have a Pi 4 rev B and I entered the line at my "pi@raspberrypi:~ $" prompt.

I don't get any indication that i2cset -y 1 0x01a 0xfe did anything and the argon still won't start up when power comes on externally. Like a few of you, my Pi is installed inside by arcade cabinet so having it turn on without a button would be very helpful.
Thanks

emma1997
Posts: 1737
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: RPi4 wake up after power failure

Mon Aug 17, 2020 9:20 pm

I implemented a very simple scheme that shuts the Pi down safely on power loss and also reboots it when power returns: viewtopic.php?f=63&t=281334

Parts total 2 or 3 dollars and easy to build, even a beginner. Really little more than couple diodes and couple resistors. No special programs or coding at all.

BTW when setup as UPS or battery operation on a cheap hoverboard pack, I've tested it to run over 40 days without power on a single charge.

DarkElvenAngel
Posts: 2200
Joined: Tue Mar 20, 2018 9:53 pm

Re: RPi4 wake up after power failure

Mon Aug 17, 2020 9:45 pm

The argon one case can be set to power on after power failures.

These codes may help
https://github.com/Argon40Tech/Argon-ONE-i2c-Codes

I have a project that replaces the python scripts with a daemon written is C if you find the scripts are not to your liking.

https://gitlab.com/DarkElvenAngel/argononed

SinAcedia
Posts: 6
Joined: Tue Apr 16, 2019 9:23 pm

Re: RPi4 wake up after power failure

Fri Dec 18, 2020 11:57 pm

Simple, drill the hole on the seam the diameter of the cord, open the case, plug in the usb-c directly into the RPi4, glue something to the cord so when closed it can not be unplugged if pulled, and close it up.

goguprogramatoru
Posts: 1
Joined: Sun Feb 21, 2021 12:20 pm

Re: RPi4 wake up after power failure

Sun Feb 21, 2021 12:27 pm

If it's an Argon One M2 there is a jumper on the black board with the cooler. Move-it to 2-3 instead of 1-2

wh7qq
Posts: 1579
Joined: Thu Oct 09, 2014 2:50 am

Re: RPi4 wake up after power failurean

Sun Feb 21, 2021 7:20 pm

gkaiseril wrote:
Sun Jan 12, 2020 8:46 pm
One should be aware that power losses that result in an uncontrolled power down can cause a loss of data that includes the corruption of the boot process.
Admittedly, one of my RPi Zero Ws doesn't have much data to loose but it controls our water heater so cold showers would result if it did not wake up after a power failure (frequent here). I have no backup power and I always have a hot shower before bedtime :D .

I also have a B+ Pi-hole attached to my router which runs 24/7 except for blackouts that never seems to have a problem. Again, no backup supply.

I use a 32 Gig San Disk Ultra (all I ever buy) which always boots back up and doesn't seem to get corrupted. If you use a cheap, crappy, small uSD, all bets are off.

DarkElvenAngel
Posts: 2200
Joined: Tue Mar 20, 2018 9:53 pm

Re: RPi4 wake up after power failurean

Sun Feb 21, 2021 7:51 pm

wh7qq wrote:
Sun Feb 21, 2021 7:20 pm
gkaiseril wrote:
Sun Jan 12, 2020 8:46 pm
One should be aware that power losses that result in an uncontrolled power down can cause a loss of data that includes the corruption of the boot process.
Admittedly, one of my RPi Zero Ws doesn't have much data to loose but it controls our water heater so cold showers would result if it did not wake up after a power failure (frequent here). I have no backup power and I always have a hot shower before bedtime :D .

I also have a B+ Pi-hole attached to my router which runs 24/7 except for blackouts that never seems to have a problem. Again, no backup supply.

I use a 32 Gig San Disk Ultra (all I ever buy) which always boots back up and doesn't seem to get corrupted. If you use a cheap, crappy, small uSD, all bets are off.
I would say you have been rather lucky not to have card corruption, if power fails during an IO write then you will have data lose and it won't matter what card you have. I would suggest a read only filesystem to anything critical so that you can reduce the risk of downtime due unforeseen events. It also seems that your applications don't write much if anything to the SD card this may explain things. I would suggest have an exception and not the rule in this case.

gkaiseril's comment is still vaild.

Return to “General discussion”