I was looking for a power switch or button for the Raspberry Pi 3. Does anyone have a recommendation on a good switch?
I was looking for a power switch or button for the Raspberry Pi 3. Does anyone have a recommendation on a good switch?
Nice to find out ...google provided the following
https://elinux.org/RPI_safe_mode#Wake_from_Halt.5B1.5D
Thanks to the above, it seems pulling pin 5 low after sudo halt will make it boot.
After power interruption, pulling pin 6 makes it boot ... however I thought it boots when you apply power, so not sure what they mean.
mark
Raspberrypi.org crazy documentation.. looks like at some point, shorting pins 5 and 6 also had an effect, to boot into some 'safe mode'? (Maybe they mean runlevel 2). But apparently the Gertboard product messed it up by triggering it accidentally so they stripped it from their bootcode.bin firmware:
I wonder how they are achieving such programmable behaviours anyway, when the ARM processor cores are halted. I wonder if this means the GPU continues running..?
I wonder if this means the GPU continues running..?
The inner workings of Raspberry Pi are like women ... mere mortal men are not supposed to know much less understand.
mcb1 wrote:
Nice to find out ...google provided the following
https://elinux.org/RPI_safe_mode#Wake_from_Halt.5B1.5D
Thanks to the above, it seems pulling pin 5 low after sudo halt will make it boot.
After power interruption, pulling pin 6 makes it boot ... however I thought it boots when you apply power, so not sure what they mean.
mark
You are correct that it boots when power is applied, but after you have halted the system you would have to unplug and replug the power to switch it back on, which is messy. With the above solution you can just toggle power with the button as much as you like without touching the power cables or supply. It's good for when you want to make something where the Pi is hidden (in my case, an arcade machine).
Since it appears that the GPU likely keeps at least some elements of itself running even after the Pi's main CPU has halted, I'm surprised no-one has thought of implementing a bit more of a 'power management' controller into the GPU bootcode, so that people could select their desired behaviour, e.g. to stop the Pi from starting up if power is applied (if that is what some users wanted), or to provide a signal when the CPU is halted (for shutting down external supplies, without the delay that people are having to implement), provide a hardware signal if the power droop is detected, and so on..
All user configurable to use some of the less-commonly used GPIO pins beyond the first 26 pins - and only if specifically configured by the user.
Seems that it could all have been done in that bootcode.bin firmware, instead of having to mess with the sticking-plaster add-on boards that are available for the Pi.
Hi Graham,
I tried the method described in howchoo on my Raspberry Pi 3 with Raspbian.
This has just a single push button with no other components.
The button simply shorts ground (e.g. pin 6) to pin 5 gpio.
If the Pi is in its low power shutdown state after being previously shutdown, taking pin 5 low does wake it up.
Then after booting, a Python program listens for an interrupt on the same pin, and triggers a shutdown.
I found it works really well.
In my case, I am already using the ground pin 6 for my display, so I used ground pin 9.
The black wire is ground, the blue wire is the GPIO:
HowChoo also has an article for adding a power LED to signal when it is safe to remove power.
I fitted the LED next to the power button (its not shown in the picture above).
I found this useful, but a little misleading as the LED shuts off about 5 seconds before the SD card "ACT" LED stops flashing.
Regards - Paul