Batocera GPi Case and Raspberry Instructions

GPi Case and Raspberry

Specifications:

  • Product Name: Raspberry Pi Power Button
  • Compatibility: Raspberry Pi 1 – 5
  • Price Range: $10 – $25 USD

Product Information:

To keep the price down, the Raspberry Pi board doesn’t ship with
a power button, but it’s easy to add your own. Adding a power
button can help turn on/off your BATOCERA system and prevent data
corruption or physical damage to your SD card.

Commercial Power Switches:

  • Provide real power cuts
  • Costs are around $10-25 USD
  • Require some space for installation

Simple Buttons or Latching Switches:

  • Simple setup
  • Low cost
  • No power cut possible

Product Usage Instructions:

Why is a Raspberry Pi power button important?

A power button is important to prevent data corruption and
physical damage to your SD card when shutting down the Raspberry
Pi. It is recommended to safely shut down your Pi using Batocera’s
Shutdown Menu or a power button.

Save Data Protection:

  1. Download the provided script from Batocera’s Wiki.
  2. Save the script to /userdata/system directory.
  3. Set executable bit with chmod +x
    /userdata/system/custom.sh.
  4. Setup your power device according to the instructions
    below.

Setting up a Power Device:

Follow the instructions provided in the script and make sure to
connect your power device correctly to ensure safe shutdowns and
power-ups of your Raspberry Pi.

Frequently Asked Questions (FAQ):

What are the recommended commercial power switches for
Raspberry Pi?

Some supported commercial power switches include Argon One for
RPi4. These devices offer a real power cut feature and can be
easily installed on top of the Raspberry Pi using its 40 Pin
header. You can find more information on where to buy these
switches on the manufacturer’s website.

“`

2025/06/26 04:15

1/6

Add Powerdevices and Buttons to your Raspberry Pi 1 – 5

Add Powerdevices and Buttons to your Raspberry

To keep the price down, the Raspberry Pi board doesn’t ship with a power button, yet it’s easy to add your own! This guide will show you how to add a power button to your Raspberry Pi that can turn on/off your BATOCERA system.
If you don’t want to build your own, several popular commercial options are available. They will add a power switch to your Raspberry Pu, sometimes provide a temperature-controller fan… and add a stylish look to your board.
Commercial Power Switches Provide real power cuts Costs are around 10-25 USD Usually need some space to build it in
Simple Buttons or latching switches Very simple setup Low cost No powercut possible
Why is a Raspberry Pi power button important?
You should never “yank” the power cord out of your Pi as this can lead to severe data corruption (and in some cases, physically damage your SD card). Even if Batocera is best prepared against file corruption it is recommended to safely shut down your Pi via Batocera’s Shutdown Menu or even better, use a power button or switch.

When Batocera “shuts down” the Pi with a simple button/latching switch, it will send it into a halt state, which still consumes a very small amount of power. This is similar to how all modern computers work. In this guide we will only go into a halt state so that we can still power it up again later without having to replug the power source. You can safely disconnect the power supply (should you desire) without the worry of data corruption while in the halt state.

This method gives the best user experience if you use the GPi-case from Retroflag for example. This nice housing only has one button switch to simply turn on/off the Raspberry. Since Batocera 5.25 the OS is best prepared for all kinds of power devices connected to the Raspberry. But you will lose your game SRM save (your in-game save file) if you just trigger the power button inside a game session.
Save data protection
1. Download the provided script below
Batocera.linux – Wiki – https://wiki.batocera.org/

Last update: 2021/10/02 03:47

add_powerdevices_rpi_only https://wiki.batocera.org/add_powerdevices_rpi_only?rev=1633139243

2. Save this to /userdata/system 3. Set executable bit with chmod +x /userdata/system/custom.sh 4. Setup your power device according to further below

custom.sh
#!/bin/bash # custom.sh – place to /userdata/system # by cyperghost 23/11/19 #
if [[ $1 == stop ]]; then batocera-es-swissknife –emukill
fi

Commercial Power Switches

Here are some commercial power switches/commercial cases with power switches that are currently supported. These offer a real power cut, that means the Raspberry is really switched off. Usually these small power devices are plugged on top of the Raspberry using it’s 40 Pin header. For further install instruction use the links provided.

Here are the values you can put as system.power.switch=<value_below> in batocera.conf:

Device Name system.power.switch Where to buy and additional manufacturer information

Notes related to Batocera

Argon One for RPi4

ARGONONE

https://www.argon40.com/argon-one-raspberry-pi-4-case.html

Get more details here

ATXRaspi

ATX_RASPI_R2_6

http://lowpowerlab.com/atxraspi/#installation

DeskPi Pro case DESKPIPRO

DeskPi Pro V3.0 Aluminum Case for Raspberry Pi 4-with ICE Tower Cooler/2.5 inch HDD-SDD Support/ Power Supply/Two Full-Sized HDMI/Power Button/ IR Support

Mausberry Circuits

MAUSBERRY

http://mausberry-circuits.myshopify.com/pages/setup

msldigital PiBoard r2013

REMOTEPIBOARD_2003 http://www.msldigital.com/pages/support-for-remotepi-board-2013

msldigital PiBoard r2015

REMOTEPIBOARD_2005 http://www.msldigital.com/pages/support-for-remotepi-board-plus-2015

OneNineDesign Powerhat

POWERHAT

https://github.com/redoakcanyon/HATPowerBoard

Pimoroni OnOffShim

ONOFFSHIM

OnOff SHIM (micro-USB)

UUGear Witty Pi WITTYPI

Script http://www.uugear.com/witty-pi-realtime-clock-power-management-for-raspberry-pi uses
WiringPi.

Retroflag cases RETROFLAG

http://www.retroflag.com

NEW NESPi4 support! Get more details here.

https://wiki.batocera.org/

Printed on 2025/06/26 04:15

2025/06/26 04:15

3/6

Add Powerdevices and Buttons to your Raspberry Pi 1 – 5

Device Name system.power.switch Where to buy and additional manufacturer information

Retroflag cases with buttons

RETROFLAG_ADV

http://www.retroflag.com

Retroflag GPIO case

RETROFLAG_GPI

Kintaro Super

Kuma/Roshambo Retro Gaming

KINTARO

case

https://www.retroflag.com/GPi-CASE.html https://www.amazon.com/dp/B079T7RDLX/?tag=electromake-20 / https://www.electromaker.io/blog/article/roshambo-retro-gaming-case-review

Notes related to Batocera
Same as the previous one, except the button can trigger actions, like stopping emulators
Get more details here.

Simple push-button or switches

It is possible to add a button to turn on and turn off your Batocera console properly! But how?
Which GPIO PIN should I use?
You can add a power button to switch on/off Batocera. The button can be either a push button (momentary button) or a switch button (latching switch). Note on the push buttons: some GPIO have resistors pull-up built-in (resistors connected to the + 3.3V), so it is preferable to use switches normally open (abbreviated NO) with these pins.

Batocera.linux – Wiki – https://wiki.batocera.org/

Last update: 2021/10/02 03:47

add_powerdevices_rpi_only https://wiki.batocera.org/add_powerdevices_rpi_only?rev=1633139243

to connect the switch to the Raspberry Pi GPIO, plug a PIN on the GPIO3 (physical PIN 5 above on the left) and another on the mass located just to the right on the right (physical PIN 6)

Activation of the switch

GUI Menu Mode
Get a terminal window by quitting EmulationStation with a Keyboard or get a access to terminal by SSH. Now enter /etc/init.d/S92switch setup and you will see a terminal window like in picture below. From there you can select and activate your power or switch device. The script will show you an already activated device (ONOFFSHIM in this case) and will latter show you a small message box, if the value setup was successfully set up. After this reboot the device and everything should work fine.

Manual activation
Check in the table above what is the type of power switch you need.
Then, edit the config file /userdata/system/batocera.conf – in the example below with PIN56ONOFF.
For a latching switch edit batocera.conf with your preferred text editor and add system.power.switch=PIN56ONOFF Reboot the system Alternatively, if you don’t want to edit the file and you are logged in with SSH or you have a terminal open then enter:

https://wiki.batocera.org/

Printed on 2025/06/26 04:15

2025/06/26 04:15

5/6

Add Powerdevices and Buttons to your Raspberry Pi 1 – 5

batocera-settings-set system.power.switch PIN56ONOFF

then reboot. Your Batocera system can now be turned on/off with a button!

Retroflag

Retroflag is the manufacturer who takes focus on retro case for Raspberry Pi series and for origin looking retro game controllers. In the last years they’ve managed to bring some pretty nice looking housings to the market. These are inspired of gaming devices from the golden era of game consoles. If you are a proud owner of a GPicase, then take a look here. Besides the nice looking there are always working buttons for power and/or reset possible. But you have to take a few steps there.
1. Enable the Safe Shutdown Switch on the PCB! This small switch depends on the used housing, refer to the shipped manual from Retroflag how to do this.
2. Edit batocera.conf and set the correct switch mode. You can edit the config file from SAMBA share with your dedicated text editor or use SSH and you can edit the config file with nano /userdata/system/batocera.conf or use the GUI mode, you need SSH for this method, too.
3. Activate or Select the correct powerswitch system.power.switch=RETROFLAG 4. Reboot, this will activate the Safe Shutdown feature

For the NESPi 4 case only
You have to do an additional reboot! Sorry guys, but we need to make an autoconfig behind the scenes!

Also, for the NESPi4 case, you might experience some sluggishness using the HDD/SSD “cartridge”. Here is a Reddit link that gives you a way to fix it (even if the reddit post was written for RetroPie, it has been reported as OK on Batocera too).
Argon One
Activate the Argon One fan by adding system.power.switch=ARGONONE in the configuration file batocera.conf.
By default, the fan starts at 55 degrees Celsius. Your can define own temperature/fan speed ladder by editing the file /userdata/system/configs/argonone.conf (it can be also edited from the network, via the SHARE SMB folder).
# Configuration file for Argon One Pi4 case # temperatures are in Celsius # fan_speed are from 0-100 percent # syntax is: temp_threashold=fan_speed # default is: 45=0
Batocera.linux – Wiki – https://wiki.batocera.org/

Last update: 2021/10/02 03:47
55=10 60=55 65=100

add_powerdevices_rpi_only https://wiki.batocera.org/add_powerdevices_rpi_only?rev=1633139243

With this ladder, fan starts at 10% when reaching 55 degrees, and rises up to 100% when reaching 65 degrees Celsius. From the vendor recommendations, it is safe to start the fan at 55 degrees only. Less noisy. 😉

From: https://wiki.batocera.org/ – Batocera.linux – Wiki Permanent link: https://wiki.batocera.org/add_powerdevices_rpi_only?rev=1633139243 Last update: 2021/10/02 03:47

https://wiki.batocera.org/

Printed on 2025/06/26 04:15

Documents / Resources

Batocera GPi Case and Raspberry [pdf] Instructions
GPi Case and Raspberry, Case and Raspberry, Raspberry

References

Leave a comment

Your email address will not be published. Required fields are marked *