I would like to have my Raspberry Pi permanently connected to a power source. What is the best way to create a 'soft' power switch, so that I can shutdown from within command line, but start up from hardware?
Thanks.
Soft Power Button/Switch?
14 posts
- Posts: 3
- Joined: Thu Jan 10, 2013 3:03 am
Not possible. A reset switch is possible though.
you can use any simple on-off switch from old gadgets - which just connects or disconnects wires from the power source to the Pi,.
you can use any simple on-off switch from old gadgets - which just connects or disconnects wires from the power source to the Pi,.
- Posts: 36
- Joined: Sun Dec 30, 2012 10:02 am
++bahjatk++ wrote:Not possible. A reset switch is possible though.
you can use any simple on-off switch from old gadgets - which just connects or disconnects wires from the power source to the Pi,.
Best/easiest is just to leave it on all the time. It uses virtually no power.
But (seriously, folks...), on the latest boards, you can rig up a switch at P6 - such that pressing the switch will reboot the Pi. So, you could follow this sequence (I think - see below for caveat):
1) To shut down: init 0 (or whatever you prefer)
2) To turn on: Press button
Note: I think this will work, but I am not sure (having not gotten around to testing) that the reset button will bring it back from the power off state.
- Posts: 1461
- Joined: Sun Jan 15, 2012 1:11 pm
++bahjatk++ wrote:Not possible. A reset switch is possible though.
you can use any simple on-off switch from old gadgets - which just connects or disconnects wires from the power source to the Pi,.
Hmm, alright. Do you know if it sufficient to cut off power to the linear 3V3 regulator to cut power to the entire device? I plan on replacing the v_reg with a switching regulator, and I could put a switch in between.
- Posts: 3
- Joined: Thu Jan 10, 2013 3:03 am
No it isn't. 5V is used by the USB/LAN chip and also of course by any USB devices.
See also: Wake from halt
See also: Wake from halt
Hi,
Just been reading through this post.
I don't know if this is possible but sounds reasonable of the top of my head.
Can yo not just develop a script that includes "sudo Halt" parameters. This script is invoked when a closed circuit is detected on one of the GPIO.
I haven't used these pins yet so not entirely sure if this would work.
But sounds plausible.
Just been reading through this post.
I don't know if this is possible but sounds reasonable of the top of my head.
Can yo not just develop a script that includes "sudo Halt" parameters. This script is invoked when a closed circuit is detected on one of the GPIO.
I haven't used these pins yet so not entirely sure if this would work.
But sounds plausible.
- Posts: 12
- Joined: Mon Dec 31, 2012 12:13 am
The OP's requirement was to shutdown in software (literally: From the command line) and to reboot from hardware (button push).
The first part is easy. The second part should be possible either via Dom's method (see the link posted a response or two back) or via the new "Rev B" method (P6).
The middle part (step 1.5) is to power the board off (turn the red light off). That's the hardest part (but note that it makes part 2 moot, since then, when power is re-applied, the board will reboot)
The first part is easy. The second part should be possible either via Dom's method (see the link posted a response or two back) or via the new "Rev B" method (P6).
The middle part (step 1.5) is to power the board off (turn the red light off). That's the hardest part (but note that it makes part 2 moot, since then, when power is re-applied, the board will reboot)
- Posts: 1461
- Joined: Sun Jan 15, 2012 1:11 pm
It is perfectly possible, it's just that nobody has actually done it yet.
I looked into this months ago, and found that the Halt process is scripted in bash, so changing it would be trivial. Similarly a task that cycles round every second or so checking the GPIO inputs and starting a Halt if the right conditions obtain, is well understood and not at all difficult. And the circuit is simple as well. See: http://soronlin.wikidot.com/power-switch
I looked into this months ago, and found that the Halt process is scripted in bash, so changing it would be trivial. Similarly a task that cycles round every second or so checking the GPIO inputs and starting a Halt if the right conditions obtain, is well understood and not at all difficult. And the circuit is simple as well. See: http://soronlin.wikidot.com/power-switch
Ahhh I Seee!
Yeah know I see the problem as my method would just stop the board at software level but not completely power off the board.
Yeah know I see the problem as my method would just stop the board at software level but not completely power off the board.
- Posts: 12
- Joined: Mon Dec 31, 2012 12:13 am
rurwin wrote:It is perfectly possible, it's just that nobody has actually done it yet.
I looked into this months ago, and found that the Halt process is scripted in bash, so changing it would be trivial. Similarly a task that cycles round every second or so checking the GPIO inputs and starting a Halt if the right conditions obtain, is well understood and not at all difficult. And the circuit is simple as well. See: http://soronlin.wikidot.com/power-switch
I'm working on it, and it's working (although I didn't update the post yet)
- Posts: 780
- Joined: Thu Mar 08, 2012 3:32 pm
rurwin wrote:It is perfectly possible, it's just that nobody has actually done it yet.
I've got a project on the go here, http://www.susa.net/wordpress/2012/11/r ... ontroller/ - that does this. It's come on a little bit further since I wrote the article, but what with Christmas etc., it's gathered some dust.
It acts as an I2C slave to control the power-state, and the RTC can (or more accurately, will in due course) allow the Pi to be woken at a specific time. The whole thing could be done with a much simpler PIC if the RTC isn't required, but the chip I've chosen offers so many potential features for a couple of quid.
- Posts: 187
- Joined: Sun Dec 25, 2011 5:25 pm
- Location: Edinburgh, UK
How's about this? I bookmarked this a while ago to integrate into my picade build.
https://github.com/gamaral/rpi-pwrbtn
https://github.com/gamaral/rpi-pwrbtn
- Posts: 68
- Joined: Wed Aug 01, 2012 2:43 am
Support the MagPi by purchasing issues 1 to 8 in printed form at our new shop - http://themagpi.com/shop/
Please share with anyone who is interested!
Please share with anyone who is interested!
- Posts: 40
- Joined: Wed Oct 03, 2012 3:36 am