Posted on

NesPi Retroflag Case Safe Shutdown Reset Power Button Mod

Check out ETAPrime’s new video: NesPi Case Safe Shutdown Reset Button Mod Power Button for the Retro Flag case using a modified version of the 8bitjunkie “easy button” script.

16 thoughts on “NesPi Retroflag Case Safe Shutdown Reset Power Button Mod

  1. hey! Great job on the retroflag script for shutting down the pi safely! I did notice that the script will ONLY work in the retroflag NESPI case. If i take the SD card out and put it in another pi, it starts to go through the startup sequence and shut itself down before it even reaches the intro video.

    When I reinsert it into the PI in the NESPI case, it works as you intended it to. Wondering if there is an easy way to disable the script if I wanted to use the SD card in another PI without the mod?

    Thanks so much!

    1. Hm. I don’t think so. It seems like the sensible thing to do would be to use a second sd card. If you clone your existing card, you can put the clone in the retroflag, and then install the non-retroflag script. then you could use that card in a non-retroflag pi

    2. I did the same thing — the same mistake. I happen to have a Linux computer next to me when it happened, though. So I pulled the SD card, installed it into a card reader and then connected the reader to the Linux computer. From there, I was able to find and edit the files installed so they don’t work any longer. (# added comment to the line that calls the python script in the pi_shutdown within /etc/init.d)

      Fixed without re-doing the whole machine. I’ll bet a Linux LiveCD will suffice as well so having a whole Linux machine wouldn’t be needed.

    3. If you absolutely must swap your SD card seamlessly between different Pis, use pin 7 on the GPIO port instead of pin 5 for your reset switch.

      First, edit the shutdown script (/home/pi/scripts/ and change all references to pin 5 to pin 7. The following two lines are the ones that need to be changed.
      GPIO.setup(5, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
      buttonState1 = GPIO.input(5)
      Just replace 5 with 7.
      Next, physically move the reset wire from GPIO pin 5 to pin 7.
      Now, your system should behave properly. It will safely shut down when you press reset in the modified retroflag case, but it won’t automatically shut down if it is running outside a retroflag case.

      The reason why pin 7 behaves better than pin 5 is because pin 5 is hard wired to a pull up resistor. Without the 150 ohm resistor from the nespi mod pulling it to a low state, pin 5 automatically remains in a high state, which triggers the shutdown script.

      Pin 7, on the other hand, is not hardwired to a pullup resistor. Because of this, the script can initialize it in a low state, and it won’t automatically be in a high state when it is used outside of a modified nespi case.

    4. Matt, that can happen if you leave the pin floating, as it will randomly be floating between 1 and 0. — If you want to use it with no button hooked up, then you should add a jumper (like an old harddrive one) from GPIO3 to ground (third row from the top should do it).

  2. Thank you Chuck for your cool solution. Did someone tried it out? Consider that Pin 7 GPCLK0 can also be used to to output a 1MHz+ clock signal. Is Pin 7 the only Pin that can be used? Thank you for your answer.

  3. I’m getting this error. (6) Could not resolve host: pie.8bit.junkie . Is this file not hosted by 8bit anymore?

    1. It’s

  4. I get “curl: (6) Could not resolve host: bash” at the end

    1. Also before that it says ” exit 0curl:(6) Could not resolve host: l

      1. it’s a pipe “|” not a lowercase letter “L”.

  5. How do you undo the shutdown script so I can put my pi in a different case. Any help would be greatly appreciated.

    1. You can try:

      sudo update-rc.d -f pi_shutdown remove

      Let me know how that works

      1. Did this work? I need to remove the script from mine as well.

  6. I installed following the instructions on a Stretch implementation on my rpi. I get exactly the same problems as reported earlier. The button works after the install, but after a reboot it does nothing. Restarting works of course.
    Should I be changing the installation someway, because I note that the problem claims to have been fixed?

    Thanks for the help

    1. OK, thanks for letting me know. I’ll have to try it and see what might be happening.

Leave a Reply

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