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.

20 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!
    Matt

    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/shutdown.py) 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 pie.8bitjunkie.net

  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.

  7. Did the update to 4.4 break something? I’ve followed all the instructions more than once, and am not too shabby with (RedHat) Linux commands. The resistor mod will turn it on, but I cannot get the python script to run automatically as intended. If I add it to rc.local without the ‘$’, it runs and the button works as intended however it never completes the boot process. If I add the ‘$’, it does not seem to run at all. If I do a cronjob, it appears to be running…but it does not work. If I add it to /profile, it will run only if I drop to a shell prompt. I’m having a dickens of a time getting it to run in the background as intended. But on the plus side, my hardware is correct, and the script CAN work…

    Any thoughts?

    1. Also have the same problem… Can someone provide a workaround??

  8. Holy crap I was going bonkers. Atleast its just not me. I am going to go back to 4.3 for now and probably just order the new NESPi+ case.

  9. Hey, very new to this but I haven’t seen anyone else with this issue yet.

    I did this mod on my case and ran the script for adding the safe shutdown. All seems to go well and it says it is installed, then auto shuts down? When I boot back up, the button does nothing. In the instructions he tells you to reboot, but it doesn’t automatically do it for him. Not sure if I’m doing something wrong or if the program has been updated since the video was made.
    In any case, neither shutdown or boot up works with my reset button. I just don’t know if it’s my modifications or the code since I couldn’t check line by line before it shut itself off.

    Any help appreciated

Leave a Reply

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