Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Best Practice GPIO shutdown switch



  • Did an exhaustive search for the best way to do this and saw a bunch of "OUTDATED" notices on posts, so...

    I'm using the GPIO joystick interface for an Atari game (no EmulationStation) and would like to save high scores and shutdown PI.

    Any suggestions on the best steps to do this?

    Thanks,

    Mike in snowy Colorado


  • Global Moderator

    If your start-up script executes just the Atari emulator, then you can add a 'shutdown' command in the script, right after the emulator command, so that when you exit the emulator, the system would stop.

    If you'd like to use a GPIO button to shutdown the Pi system, then you can modify @cyperghost's shutdown script (https://github.com/crcerror/ES-generic-shutdown) and run it on system start to monitor a GPIO for a button press. The usual GPIO used for shutdown/start is GPIO3, since it can be used to start the PI - assuming you're using a 2 or 3B+ model.



  • @mitu There is no modification needed at all you can use multi-switch --generic command to offer an easy setup.

    @MaMikee Please install raspi-gpio at first with sudo apt install raspi-gpio command. There are tons of other possibilities available ;)



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.