Is there a way to unplug the Raspberry pi safely without shutting downShutting down the Pi safely without SSH or a monitor?Shut down standalone pi without accessCleanly shutting down daemon on Reboot or Shutdown commandShutting down quickly (And safely)Detect when the rpi3b+ has shut down
changing number of arguments to a function in secondary evaluation
Are differences between uniformly distributed numbers uniformly distributed?
Is there a way to unplug the Raspberry pi safely without shutting down
As a 16 year old, how can I keep my money safe from my mother?
Is refreshing multiple times a test case for web applications?
How to take the beginning and end parts of a list with simpler syntax?
How to mark beverage cans in a cooler for a blind person?
Who are these characters/superheroes in the posters from Chris's room in Family Guy?
The cat ate your input again!
English - Acceptable use of parentheses in an author's name
Should I ask for permission to write an expository post about someone's else research?
Double redundancy for the Saturn V LVDC computer memory, how were disagreements resolved?
Plausibility of Ice Eaters in the Arctic
Are there any financial disadvantages to living significantly "below your means"?
What is the maximum number of PC-controlled undead?
Understanding the point of a kölsche Witz
Find y in this equation
Why is transplanting a specific intact brain impossible if it is generally possible?
Was the 2019 Lion King film made through motion capture?
Y2K... in 2019?
What are the uses and limitations of Persuasion, Insight, and Deception against other PCs?
Does a code snippet compile? Or does it get compiled?
Why did Gandalf use a sword against the Balrog?
Why isn’t SHA-3 in wider use?
Is there a way to unplug the Raspberry pi safely without shutting down
Shutting down the Pi safely without SSH or a monitor?Shut down standalone pi without accessCleanly shutting down daemon on Reboot or Shutdown commandShutting down quickly (And safely)Detect when the rpi3b+ has shut down
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm building a kiosk app for a raspberry pi, and the final intention is that it will sit in a pelicase with all the external hardware, with one power cord in. My program has a quit button which safely shuts down the pi by running sudo halt
, but it would make it easier if the pi could automatically shutdown when it detects that it has been unplugged. Could this be done if I had a capacitor on the power rails and when the power was disconnected the pi could measure the power drop and shutdown safely if it detected a loss of power? Thanks.
shutdown
New contributor
add a comment |
I'm building a kiosk app for a raspberry pi, and the final intention is that it will sit in a pelicase with all the external hardware, with one power cord in. My program has a quit button which safely shuts down the pi by running sudo halt
, but it would make it easier if the pi could automatically shutdown when it detects that it has been unplugged. Could this be done if I had a capacitor on the power rails and when the power was disconnected the pi could measure the power drop and shutdown safely if it detected a loss of power? Thanks.
shutdown
New contributor
add a comment |
I'm building a kiosk app for a raspberry pi, and the final intention is that it will sit in a pelicase with all the external hardware, with one power cord in. My program has a quit button which safely shuts down the pi by running sudo halt
, but it would make it easier if the pi could automatically shutdown when it detects that it has been unplugged. Could this be done if I had a capacitor on the power rails and when the power was disconnected the pi could measure the power drop and shutdown safely if it detected a loss of power? Thanks.
shutdown
New contributor
I'm building a kiosk app for a raspberry pi, and the final intention is that it will sit in a pelicase with all the external hardware, with one power cord in. My program has a quit button which safely shuts down the pi by running sudo halt
, but it would make it easier if the pi could automatically shutdown when it detects that it has been unplugged. Could this be done if I had a capacitor on the power rails and when the power was disconnected the pi could measure the power drop and shutdown safely if it detected a loss of power? Thanks.
shutdown
shutdown
New contributor
New contributor
New contributor
asked 8 hours ago
NadimNadim
61 bronze badge
61 bronze badge
New contributor
New contributor
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.
Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.
Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.
How hard is it to use sudo poweroff
then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.
add a comment |
To achieve this thing you need two things.
- First, the power failure detection circuit.
- A power backup system that can give power back up to shut down the raspberry pi.
There are many ways to implement the power detection circuit. I am giving an example of this
simulate this circuit – Schematic created using CircuitLab
in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.
For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.
add a comment |
No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.
Conventional computers have a managed shutdown and/or battery backup.
It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.
NOTE a capacitor is unlikely to provide sufficient voltage for long enough.
The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.
Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…
– sbell
2 mins ago
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("schematics", function ()
StackExchange.schematics.init();
);
, "cicuitlab");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "447"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Nadim is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f101509%2fis-there-a-way-to-unplug-the-raspberry-pi-safely-without-shutting-down%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.
Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.
Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.
How hard is it to use sudo poweroff
then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.
add a comment |
What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.
Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.
Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.
How hard is it to use sudo poweroff
then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.
add a comment |
What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.
Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.
Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.
How hard is it to use sudo poweroff
then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.
What you're asking for is impossible. There's no battery backup on the RPi without additional hardware.
Pulling the power may be OK 9 times out of ten, but every time you pull the power you risk corruption of your SDCard.
Even if you move to a HDD or SSD for the root filesystem you risk corruption with a sudden power loss.
How hard is it to use sudo poweroff
then wait ten seconds for that to complete? You know it's complete when the activity LED blinks ten times.
answered 7 hours ago
DougieDougie
1,5821 gold badge2 silver badges10 bronze badges
1,5821 gold badge2 silver badges10 bronze badges
add a comment |
add a comment |
To achieve this thing you need two things.
- First, the power failure detection circuit.
- A power backup system that can give power back up to shut down the raspberry pi.
There are many ways to implement the power detection circuit. I am giving an example of this
simulate this circuit – Schematic created using CircuitLab
in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.
For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.
add a comment |
To achieve this thing you need two things.
- First, the power failure detection circuit.
- A power backup system that can give power back up to shut down the raspberry pi.
There are many ways to implement the power detection circuit. I am giving an example of this
simulate this circuit – Schematic created using CircuitLab
in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.
For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.
add a comment |
To achieve this thing you need two things.
- First, the power failure detection circuit.
- A power backup system that can give power back up to shut down the raspberry pi.
There are many ways to implement the power detection circuit. I am giving an example of this
simulate this circuit – Schematic created using CircuitLab
in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.
For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.
To achieve this thing you need two things.
- First, the power failure detection circuit.
- A power backup system that can give power back up to shut down the raspberry pi.
There are many ways to implement the power detection circuit. I am giving an example of this
simulate this circuit – Schematic created using CircuitLab
in this circuit, the R1 and R2 you have to chose such that rpi gpio will get 3.3V, 3mA current. When power presents the gpio get a high signal failure will occur the get low signal.
For power back up you need a supercapacitor circuitry that can store 5V*2.5mA * 60sec energy minimum such that it can provide power to RPI when it performs shut down the operation.
answered 6 hours ago
PrayuktibidPrayuktibid
144 bronze badges
144 bronze badges
add a comment |
add a comment |
No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.
Conventional computers have a managed shutdown and/or battery backup.
It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.
NOTE a capacitor is unlikely to provide sufficient voltage for long enough.
The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.
Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…
– sbell
2 mins ago
add a comment |
No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.
Conventional computers have a managed shutdown and/or battery backup.
It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.
NOTE a capacitor is unlikely to provide sufficient voltage for long enough.
The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.
Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…
– sbell
2 mins ago
add a comment |
No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.
Conventional computers have a managed shutdown and/or battery backup.
It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.
NOTE a capacitor is unlikely to provide sufficient voltage for long enough.
The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.
No computer system which writes to internal storage can just be powered off without risk of loss. The Pi is no different in this respect.
Conventional computers have a managed shutdown and/or battery backup.
It is not difficult to provide the same to a Pi (the additional circuitry is likely to cost more than the Pi) and there are many articles on this, and a number of commercial products.
NOTE a capacitor is unlikely to provide sufficient voltage for long enough.
The other option is to use a read only filesystem, and store working data in volatile storage (RAM) - it depends on your application if this is applicable.
answered 1 hour ago
MilliwaysMilliways
33.3k14 gold badges59 silver badges126 bronze badges
33.3k14 gold badges59 silver badges126 bronze badges
Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…
– sbell
2 mins ago
add a comment |
Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…
– sbell
2 mins ago
Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…
– sbell
2 mins ago
Re: your note about storing data in RAM; I have use AUFS (RAM fs + read only ext4 mount) to successfully implement a Linux driven embedded project that can handle hard power events. Something similar to what is mentioned here: linuxquestions.org/questions/linux-general-1/…
– sbell
2 mins ago
add a comment |
Nadim is a new contributor. Be nice, and check out our Code of Conduct.
Nadim is a new contributor. Be nice, and check out our Code of Conduct.
Nadim is a new contributor. Be nice, and check out our Code of Conduct.
Nadim is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Raspberry Pi Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f101509%2fis-there-a-way-to-unplug-the-raspberry-pi-safely-without-shutting-down%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown