Pulling the power plug to switch a Recalbox off is the surest way to corrupt its SD card. On a Raspberry Pi, two wires and a button are enough to get a clean shutdown — plus, if you want, a real reset button and an activity LED.
This page is about Raspberry Pi boards (Pi 3, Pi 4/400, Pi 5/500, Pi Zero 2). On PC and on handheld consoles, the power button is already handled by the hardware.
If you use a commercial case with electronics (Retroflag, Argon One, PiBoy, GPi Case 2…), do not wire anything: Recalbox already handles its power button. See Cases. The RecalTower case and the RecalTower kit from the Recalbox shop come ready to assemble.
At boot Recalbox starts a service that watches the GPIO header, driven by the system.power.switch option of the recalbox.conf file. The shipped file lists every value, all commented out: uncomment one (remove the ;) and reboot.
Connect the two terminals of your button to:
That is all. GPIO 3 has a useful property on the Raspberry Pi: pulling it to ground wakes the board up when it is halted. So the very same button switches the machine on and off.
In recalbox.conf, depending on the kind of button:
system.power.switch=PIN56PUSH
for a momentary switch (push button), or:
system.power.switch=PIN56ONOFF
for a two-position toggle switch.
Push button (PIN56PUSH) |
Effect |
|---|---|
| Press, machine off | Powers Recalbox on |
| Press, machine on | Clean shutdown |
Toggle switch (PIN56ONOFF) |
Effect |
|---|---|
| Closing, machine off | Powers Recalbox on |
| Opening, machine on | Clean shutdown |
A second variant handles three connections: power, reset and an activity LED.
| Wire | GPIO | Physical pin |
|---|---|---|
| Power + | GPIO 3 | 5 |
| Reset + | GPIO 2 | 3 |
| LED + | GPIO 14 | 8 |
| Power −, Reset −, LED − | ground | 6, 9, 14, 20, 25, 30, 34 or 39 |
system.power.switch=PIN356PUSHRESET
if the power button is a push button, or:
system.power.switch=PIN356ONOFFRESET
if it is a toggle switch. Either way, the reset button must be a push button.
In PIN356PUSHRESET mode:
| Action | Effect |
|---|---|
Power, short press (under a second) |
Quits the running game and returns to the interface |
Power, long press (over a second) |
Clean shutdown |
Reset, short press |
Resets the running game (like a console reset) |
Reset, long press |
Reboots Recalbox |
In PIN356ONOFFRESET mode:
| Action | Effect |
|---|---|
Power, switch toggled |
Clean shutdown |
Reset, short press, in game |
Resets the running game |
Reset, short press, in the interface |
Reboots Recalbox |
Reset, long press |
Quits the running game and returns to the interface |
The LED blinks throughout the shutdown or reboot sequence: once it goes dark, the SD card is no longer in use and you may cut the power. In PIN356ONOFFRESET mode, Recalbox additionally drives GPIO 4 (pin 7) high while the system is running: circuits able to read it cut the power by themselves at the end of the shutdown.
Recalbox also drives several ready-made power boards. Wiring follows the manufacturer's instructions; on the Recalbox side, you only declare the right value:
system.power.switch value |
Hardware | GPIO used |
|---|---|---|
ATX_RASPI_R2_6 |
ATXRaspi R2.6 (LowPowerLab) | 7 (shutdown) and 8 ("booted" signal) |
MAUSBERRY |
Mausberry Circuits switch | 23 (board OUT) and 24 (IN) |
REMOTEPIBOARD_2003 |
RemotePi Board 2013 (MSL Digital) | 22 |
REMOTEPIBOARD_2005 |
RemotePi Board Plus 2015 (MSL Digital) | 14 |
WITTYPI |
Witty Pi (UUGear) | LED and halt pin |
The Mausberry circuit sits between the power supply and the Pi: it physically cuts the current once the shutdown is complete. Wire its OUT terminal to GPIO 23 and its IN terminal to GPIO 24, declare system.power.switch=MAUSBERRY, and the switch shuts the system down cleanly then removes power.
system.power.switch line is active in recalbox.conf: the last one wins./etc/init.d/S92switch status.