RetroFlag Pi4 case with a really neat feature! Check the reviews on youtube for more info! One such review here:
Another review: https://youtube.com/watch?v=qkqtE5nqnxg&feature=share
I’m really stoked! My first game console was an NES.
Their safe shutdown switch does not work with Lakka OS, people have posted about that and the company has not fixed or released a script that has worked for 2.3.2 nor this newer Lakka 3.0 version. That tells me the company does not care about standing behind the product. Also Youtubers are nothing but shills.
Dear Joystick2600,
- There is a switch inside to enable or disable the safe shutdown and safe reset functionality.
- Lakka has built-in shutdown and restart functions, so no big deal if the buttons in front don’t work.
- I’m not sure what you mean by “shills”. Youtubers are people, just like everyone here. We all have our perks and our quirks.
Also, I believe much of Lakka runs read-only. It may be difficult or even impossible to add arbitrary startup scripts. I’m not 100% sure. I’m in the process of adding my ROMs to my Pi4 now. I’ll check in later.
I have put one together and it’s safe shutdown down script did not work with Lakka 2.3.2 stable builds or the nightly builds for the Raspberry Pi 4. I just checked their github and they have not even updated it, its been 3 years since there was any changes on their Github page for it. There was another thing about the case is that it did not close flush. Mine had a bit of a gap that was annoying. For what its worth its overpriced.
Perhaps. Just to be sure, are you sure you have the new version specifically made for the Pi4? They had a few older versions that were designed for older Pis. If so, remove the outside screws and crack open the case. Verify that the hardware switch inside is set to “on”. It is set to “off” when shipped from the factory. You are probably still correct. Most other products don’t have a safe shutdown script that works in Lakka either. My understanding was that this is a limitation in Lakka, however. I might well be mistaken on that, however.
Also, if you’re not happy with the Case’s performance in Lakka, you can always try RetroPi. Just switch to a different MicroSD card, or erase the current one. That, however, is a discussion for a different forum.
@Joystick2600, and any other interested party: I finally ordered this case, and it arrived today!
I put it together, and set out to take apart and go through the safe shutdown script. In about 30 minutes, I had manually downloaded their .dtbo overlay file into /flash/overlays/ and also downloaded and modified the python script to make it work. Also, I added a startup script to /storage/.config/ telling Lakka to run the python script at boot. And finally, I added 2 lines to /flash/config.txt to have it enable the serial terminal and load the .dtbo overlay file.
I hope to post the required files in a day or two. If I don’t update this again by Friday, somebody nudge me - gently.
Ok, so for those interested, try the instructions below. It would be a good idea to backup your existing installation by pulling your MicroSD card and putting it into a Linux box. Putting the contents of the second partition into a .tar.gz file works wonders if something goes wrong later.
Ok, now for the fun:
mount -o remount,rw /flash/
wget -O "/flash/overlays/RetroFlag_pw_io.dtbo" "https://raw.githubuser
content.com/RetroFlag/retroflag-picase/master/RetroFlag_pw_io.dtbo"
echo "dtoverlay=RetroFlag_pw_io.dtbo\nenable_uart=1" >> /flash/config.txt
touch /storage/.config/autostart.sh
chmod 0740 /storage/.config/autostart.sh
echo "python /storage/.config/SafeShutdown.py &\nexit" >> /storage/.config/autostart.sh
cat << EOF > /storage/.config/SafeShutdown.py
import RPi.GPIO as GPIO
import os
import time
from multiprocessing import Process
#initialize pins
powerPin = 3 #pin 5
ledPin = 14 #TXD
resetPin = 2 #pin 13
powerenPin = 4 #pin 5
#initialize GPIO settings
def init():
GPIO.setmode(GPIO.BCM)
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)
GPIO.setwarnings(False)
#waits for user to hold button up to 1 second before issuing poweroff command
def poweroff():
while True:
#self.assertEqual(GPIO.input(powerPin), GPIO.LOW)
GPIO.wait_for_edge(powerPin, GPIO.FALLING)
os.system("systemctl stop retroarch & ")
os.system("killall retroarch") #RetroPie 4.6
os.system("sleep 5s")
os.system("shutdown -r now")
#blinks the LED to signal button being pushed
def ledBlink():
while True:
GPIO.output(ledPin, GPIO.HIGH)
#self.assertEqual(GPIO.input(powerPin), GPIO.LOW)
GPIO.wait_for_edge(powerPin, GPIO.FALLING)
start = time.time()
while GPIO.input(powerPin) == GPIO.LOW:
GPIO.output(ledPin, GPIO.LOW)
time.sleep(0.2)
GPIO.output(ledPin, GPIO.HIGH)
time.sleep(0.2)
#resets the pi
def reset():
while True:
#self.assertEqual(GPIO.input(resetPin), GPIO.LOW)
GPIO.wait_for_edge(resetPin, GPIO.FALLING)
os.system("systemctl stop retroarch & ")
os.system("killall retroarch") #RetroPie 4.6
os.system("sleep 5s")
os.system("shutdown -r now")
if __name__ == "__main__":
#initialize GPIO settings
init()
#create a multiprocessing.Process instance for each function to enable parallelism
powerProcess = Process(target = poweroff)
powerProcess.start()
ledProcess = Process(target = ledBlink)
ledProcess.start()
resetProcess = Process(target = reset)
resetProcess.start()
powerProcess.join()
ledProcess.join()
resetProcess.join()
GPIO.cleanup()
EOF
Please note: I did not test those instructions personally. They were basically the distilled “short version” of what I learned yesterday. As such, it is very possible I missed something! Backup first, then attempt. Don’t complain if you fail to follow this advice and my instructions cause some breakage. You are welcome to ask for help. You are welcome to suggest changes. You are welcome to report bugs and/or say something doesn’t work. You are not welcome to gripe.
Attitude is everything.
I went ahead and found what would be a alternative case to the Raspberry Pi 4 which would make for a nice game rig and came across the Argon One M.2.
I was not exactly a fan of this one, the M.2 is connected by using a USB A to USB A adapter in the back which kinda blocks the USB 3.0 port above it. Then there’s the fan which seems weak and the concern of over heating since the case gets really warm, the heat sink is actually the case making contact with the RPi 4 CPU and GPU by having some thermal sticky pad in between the 2.
There is a jumper pin setting you can change to change the power flow to the raspberry pi. My peeve with this case is that you have to unplug the USB A to USB A connection, unscrew the bottom and remove the bottom piece if you want to get to your micro sd card slot.
I don’t like the power on and off options. which are done by pressing on the power button located at the back of the device. If your fan doesn’t stay on then leave it on pins 2-3.
- Short press – Turn On
- Long Press > or = 3 Seconds --Soft Shutdown and Power cut
- Short Press < 3 seconds – Nothing
- Double Tap – reboots
- Long Press > or = to 5 seconds — Forced Shutdown
You can hook up the M.2 to your PC while its in it’s adapter via USB A to USB A cable.
Compared to the RetroFlag case I would prefer the RetroFlag design.
@Joystick2600: Do you not still have the RetroFlag case? The whole reason I published my changes to the existing safe shutdown script was because you complained that there wasn’t one existing.
The fan is great, keeps the unit cool, even when overclocked. The case design is a throwback to my first childhood console system. The removable cartridge system adds to not only the nostalgia, but also the pizazz/bling.
Want to switch from game playing to movie watching? Swap out the SD card for LibreELEC and swap the cartridge to your movie collection.
My only problem with my setup is that my SATA SSD gets hotter than blue blazes very quickly once power is applied. That’s not RetroFlag’s fault though. That IS a job for the warranty department for a certain manufacturer…
Everybody, Retroflag’s website has a link now for an install script for LAKKA for the retroflag case. They also have one for their GPi case, in the off chance anyone cares.
I bought a that one again but I’m building it for a relative. Its kinda like giving it a second chance, It has a bit of a gap when you screw the case, I dare not to over-screw and strip the threads. Compared to the Argon One M.2, I would pick the Retroflag case.
I also like that GeekPi Nes case for the RPi4. It’s only $12.99 right now. Though the case is a bit on the thin side which makes it feel a bit weak.
You are supposed to put the two white thermal pads in the gaps. Remove the plastic cover from one side and stick it on firmly. Don’t smash it down. Then remove the plastic from the other side and place the heat sinc.