Is it possible to map a controller button to start up the Pi after it has been shutdown?
-
Specifically:
Right now I use the shutdown system command, wait a few seconds. When I want to play again, I unplug the Pi (if I hadn't done that already after the shutdown system command) and plug it back in.
I use a Switch wired controller with the Pi, so I have a 'home' button that currently isn't mapped to do anything. I thought it would be cool if I could use this button to restart the Pi after a system shutdown.
I have seen a couple of separate power button solutions online but they all assume I have a soldering iron, which I don't. I have put my Pi in a basic casing which came with the starter pack I bought, and while I might take time to figure out how to build a 'console' casing and add a power button in the future when I'm less busy at work, right now I'm looking for a quick fix.
-
Haven't tried it, but this seems like it might help. It's using a separate physical switch rather than a controller button.
-
I've rigged a power switch like the one shown in the video on several Pi's now, a few Pi Zero's, ZeroW's, and my Pi3A+. Works great on all of them. For a power-on switch it doesn't need any script installed, but to turn the Pi off you do need to install the script.
Unfortunately, as I understand it there's no way to 'wake' the Pi from the USB because the Pi just doesn't have sleep functionality built into it. The best you could do with the controller is to modify the controller to either reroute one of the switches in it or add a button to the controller that hooks directly into the Pi, for which you will need to run a separate wire into the controller just for the switch. Better to mount the button on the Pi itself if that's what you want.
As for the script itself, I recommend Shakz76/Eazy Hax Toolkit v2. It adds a number of scripts into the Retropie Configuration menu, one of which is enabling the Power Button on Pin 5/6 as shown in this video. It makes setting up the script much much easier for the layman.
-
This is the switch I use, works great.
https://mausberry-circuits.myshopify.com/collections/frontpage/products/shutdown-switch-with-rocker
-
The provided video solution works, but is waaay too complicated: A script, W00T?
Just use the RUN-Pin and GND for this.
All you need is a extra push-button and a little soldering skills. No script, no frills.For the Pi 3B locate J6 [1] on the PCB and connect both connections of J6 to your push-button.
For the Pi 3B+ locate J2 [2] the label RUN and use a spare GND pin from GPIO. Connect these two to your push-button.After you have shutdown your Arcade via Emulationstation or literally by
/sbin/halt -p
, don't disconnect it from the mains. Now press the Reset button, and tataa your Rpi will boot up again. :-)Bonus: If you are stuck in a emulation/game you can restart your pi without a keyboard or pulling the plug.
HTH
[1] J6 is in sector C4 of schematic: https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_3b_1p2_reduced.pdf
[2] J2 is in sector C4: https://www.raspberrypi.org/documentation/hardware/raspberrypi/schematics/rpi_SCH_3bplus_1p0_reduced.pdf -
@stoney66 Good choice ;) This is a really good device. I made also very good experience with this one here: Shim ON OFF
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.