Help with shutdown script for Retroflag case

I have a leftover Retroflag NesPi+ case I was going to use for my Pi running Octoprint, however I would like to use the front buttons as intended (Safeshut Down)…

Has anyone had any luck adjusting the Retroflag provided script to work with Octoprint?

Its safe to say, I’m not very familiar with this process and only have a very high-level knowledge of python. Any help would be appreciated.

What did you already try to solve it?

Installed the Retroflag script and removed any reference to emulation station. Pi just stuck in a reset loop?

I commented out the following lines in config.txt that the install ads


But it's now pretty unstable.

Have you tried running in safe mode?


Did running in safe mode solve the problem?


Additional information about your setup

latest OctoPrint version, Pi 3b+, Ender 3 Pro

Hello @Grimlock !

You may try this:

1 Like

Hi @Ewald_Ikemann This is a good option, but unfortunately I don't know how the case is wired to the GPIO

Only info I can find is in the python script:

#initialize pins
powerPin = 3 #pin 5
ledPin = 14 #TXD
resetPin = 2 #pin 13
powerenPin = 4 #pin 5

#initialize GPIO settings
def init():
	GPIO.setup(powerPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
	GPIO.setup(resetPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
	GPIO.setup(ledPin, GPIO.OUT)
	GPIO.output(ledPin, GPIO.HIGH)
	GPIO.setup(powerenPin, GPIO.OUT)
	GPIO.output(powerenPin, GPIO.HIGH)

you got the power button on gpio 3
and the reset button on gpio 2

1 Like

Quick update... I never got the plugin working as intended. (likely my error) but I did find this script that seems to work.

Its an old script, but no issues so far.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.