Giter Site home page Giter Site logo

retroflag-picase's Introduction

Contents


GPiCase2 (GPi Case 2 only)

The RetroFlag GPiCase 2 CM4 safe shutdown script will automatically switch between the LCD display and HDMI output when using the dock.

Click the link Jump to install GPiCase2 script:GPiCase2 Script.


GPi Case (GPi Case only)

Turn switch "SAFE SHUTDOWN" to ON.

For RetroPie:

  1. Make sure internet connected.
  2. Make sure keyboard connected.
  3. Press F4 enter terminal.
  4. In the terminal, type the one-line command below(Case sensitive):

wget -O - "https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master/install_gpi.sh" | sudo bash

For Recalbox

  1. Make sure internet connected.
  2. Make sure keyboard connected.
  3. Press F4 first. And then press ALT-F2 enter terminal.
  4. User: root Password: recalboxroot
  5. In the terminal, type the one-line command below(Case sensitive):

wget -O - "https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master/recalbox_install_gpi.sh" | bash


Pi Case

(nespi+, superpi, megapi,nespi4 case)

RetroFlag Pi-Case Safe Shutdown

Turn switch "SAFE SHUTDOWN" to ON.

Example for RetroPie:

  1. Make sure internet connected.
  2. Make sure keyboard connected.
  3. Press F4 enter terminal.
  4. In the terminal, type the one-line command below(Case sensitive):

wget -O - "https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master/install.sh" | sudo bash

Example for RecalBox:

  1. Make sure internet connected.
  2. Make sure keyboard connected.
  3. Press F4 first. And then press ALT-F2 enter terminal.
  4. User: root Password: recalboxroot
  5. In the terminal, type the one-line command below(Case sensitive):

wget -O - "https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master/recalbox_install.sh" | bash

Example for batocera:

  1. Make sure internet connected.
  2. Make sure keyboard connected.
  3. Enter terminal. How to enter terminal: https://wiki.batocera.org/access_the_batocera_via_ssh
  4. User: root Password: linux
  5. In the terminal, type the one-line command below(Case sensitive):

wget -O - "https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master/batocera_install.sh" | bash

Example for lakkatv:

https://github.com/marcelonovaes/lakka_nespi_power

retroflag-picase's People

Contributors

retroflag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

retroflag-picase's Issues

Can't Download through Internet

Hello, I just started using the GitHub forums to ensure that the problems I need help from are dealt with and this is one of them: There are problems with trying to download it (weak internet doesn't help me either) through the raspberry pi itself and the safe shutdown doesn't work at all when I tried to safe shutdown or reset. I installed it and the safety is on and everything, but it won't comply for me. Please help.

EDIT: Nevermind, I found another way through this. Sorry to bother you. Please close or delete this.

note: trouble typing "|" character

An issue i had during setup was I couldn't type the pipe character "|". Turned out my keyboard layout was defaulted to UK, but I was using a US keyboard. The fix was to correct the keyboard layout, and then I could complete the instructions in README.md. See the following link for steps to correct the keyboard layout https://thepihut.com/blogs/raspberry-pi-tutorials/25556740-changing-the-raspberry-pi-keyboard-layout.

May be an issue worth mentioning in README.md

Redundant Code (hold_time)

Why you need to set a value of "1" for "hold_time" ? :

hold = 1
btn = Button(powerPin, hold_time=hold)

First of all, "hold_time" defaults to 1 anyway, so this is useless.
Secondly, you never use "button.when_held" anywhere in your script.

Looks like redundant code to me! Please clarify, thank you!

No WiFi?

I see the instructions tell you to plug in the Ethernet plug inside case but if I do, I can not get WiFi to connect. How can I get it to connect to WiFi instead and still have the Ethernet connected inside?

Safe Shutdown not working if emulationstation is not running

Safe shutdown works fine when inside emulation station, but if you are at the terminal, it says:

rc.local[469] emulationstation: no process found

then the script just hangs. I'll attempt to bypass this to see if it doesn't detect emulationstation, it just moves on.

Nespi Case Plus, Retropie, and ASUS Tinker Board

I am running the ASUS Tinker Board, Retropie 1.05b for Tinker Board (by Crash), on the Nespi Case Plus. Yes, the special safe power switch is in the ON position. I ran the download/install script and it look like it went fine and automatically rebooted. Upon reboot, I tried both the power button and the reset button and it powers down and reboots immediately without running the safe shutdown script unlike my Raspberry Pi 3 B+. On my RP3b+, the script runs great and you can see the CLI running when pressing the buttons, but not on my Tinker Board. Is it because the Tinker Board is not supported yet? Please advise. Thanks.

Shutdown & Restart Without Dropping to Shell

At present, invoking SafeShutdown by using the Picase buttons closes ES and presents the Command Line generally - and for the duration of the Wait.

Is it possible - or would it be possible - to either "quiet" this by passing it to tty3 for example, or obfuscate it by invoking a graphic/message?

Question

Which metod is supposed to be used with lakka ? Is the RetroPie ok for both ?

Some issues - Better idea

First of all, thanks for trying to fix the "emulationstation metadata" issue. Really appreciated. However, I think your latest script does have some flaws. Let's look at this code:

    os.system("sudo killall emulationstation && sleep 5s && sudo reboot")

This causes two problems:

  • Reboot/Shutdown does not work when emulationstation is closed, for example when you're busy doing something else from the command line. When there is no "emulationstation" process, "killall" fails, so the script does not proceed any further...
  • It always waits for 5 entire seconds. What a waste of time!

Well, here's my idea of how to fix these issues:

    for proc in psutil.process_iter():
        if proc.name() == procName:
            proc.terminate()
            proc.wait()

This method will work regardless if you're currently running emulationstation or not. It's also a lot faster. You'll need to install "python3-psutil" before it will work, though.

Have fun everyone! :-)

P.S. Here's my complete script. Maybe it's useful for some.

#!/usr/bin/env python3
from gpiozero import Button, LED
from signal import pause
import os, psutil

procName = "emulationstation"

resetPin = 2
powerPin = 3
powerenPin = 4
ledPin = 14

power = LED(powerenPin)
power.on()

led = LED(ledPin)
led.on()

def terminate():
    for proc in psutil.process_iter():
        if proc.name() == procName:
            proc.terminate()
            proc.wait()

def shutdown():
    terminate()
    os.system("shutdown -h now")

def reboot():
    terminate()
    os.system("reboot")

powerBtn = Button(powerPin)
powerBtn.when_pressed = shutdown

resetBtn = Button(resetPin)
resetBtn.when_pressed = reboot

pause()

Add TinkerBoard support

Could Is possible add TinkerBoard support?

Currently this error occurs:

IMG_20190509_125410

Ps: Github is auto rotating my image.

Safe reboot and reset working - LED power button is not

I think the same question has already been asked but unfortunately there hasn't been an answer yet.

I recently received the Superpi SNES case and put in my Raspberry Pi 3B+ with a clean install of retropie 4.4. I managed to get the safe reboot and reset script working, but the LED power indicator won't turn on.

Does anybody have a clue what to do?

Nespi case+ issues

I just put together my NES Pi case Plus, and now I can't get anything to come on my screen I have the safety shutdown switch in the off and in the on position with nothing happening. Please help this was supposed to be a surprise for my wife

Script will not run for me.

When I try to run the script I keep getting

GnuTLS: A TLS fatal alert has been received.
GnuTLS: received alert [0] : Close Notify
Unable to establish SSL connection.

Any idea how to resolve this? Im quite new to all this so if im making a noob mistake please be gentle haha

Cheers =)

Consider NOT installing a 5v fan in your Retroflag

Getting the Pi under-voltage warning every now and then when playing your retro games?
This on screen lightning bolt symbol indicates that your Pi is underpowered (harmful) and that might be the result of driving a cooling fan..

Despite Retroflag's prefab cut-out for mounting a fan, it's not necessary to install one if you don't experience any heat issues (that's when your Pi cpu temp stays below 85 degrees celsius).
If you do install a fan it could use too much volts / amps / ohms and even damage your Pi board. That is when you connect a fan directly to the Pi's GPIO board pins.

If you need extra cooling consider a (large) heat sink first. The Pi processors are designed to work in smartphones as well and can handle high temperatures. However, they are protected and will slow / shut down to prevent damage when getting overheated. In such an event you will also get a two stage red temperature sign on screen to warn you in advance.

It seems that the Pi GPIO pins are NOT designed to drive a fan motor. Current issues on the Pi's board can occur and damage everything including your memory card! The fan needs a burst of current when starts running and can also be harmful when malfunctioning or stops spinning (and induce a high current to the GND pin).

Without adding extra transistors a fan may permanently damage your Pi.
https://www.raspberrypi.org/forums/viewtopic.php?t=194621
https://raspberrypi.stackexchange.com/questions/66926/did-i-destroy-my-gpio-board

I was operating a simple 5v fan on the 3.3v pin to keep some air flowing while keeping the fan noise as low as possible (5v is way to loud imo). However 3.3v might be even more harmful than operating the fan on a 5v pin.

So, I removed the fan because of the aforementioned reasons and performed temperature checks in between games. The results tells me that the average temp of the cpu operates between 59 and 73 degrees celsius. So, no problems there and no more underpowered voltage signs.
Both potential damage risks of my Pi are also gone and so is the noise of the fan ;-) I left the heatsinks in place, though.

Problem installing script

I am ubernoob and this is my first time everything, these are my issues:

Trying to install script and:

  1. Connecting keyboard and pressing F keys does nothing to bring up any terminal on my pi (I have recalbox installed). Removing the sd card and turning it on does nothing.

  2. Tried downloading xcode and putty, thought Id done everything correct but opening putty control panel is impossible and gives me "locale" gtk warning.

Trying to connect by terminal and ssh pi@ipadress but get no connection at all.

Since I had turned safe switch to on I had to pull the plug after pulling my hair out for 4 hours trying to work this out.

Any help would be appreciated!!

Attract Mode

I'm using a pi3 B+ and the Retroflag Superpi Case.The case and script works perfect if I'm using emulation station but if I switch to Attract Mode the on/off and reset button do not work so I have to shut it down through the menu. Is there a script that works with Attract Mode?

Suggest adding safe termination of emulationstation to save metadata

I've modified your script in retropie so emulationstation is gracefully terminated and metadata is saved

#functions that handle button events
def when_pressed():
led.blink(.2,.2)
os.system("sudo killall emulationstation && sleep 5s && sudo shutdown -h now")
def when_released():
led.on()
def reboot():
os.system("sudo killall emulationstation && sleep 5s && sudo reboot")

This was at the suggestion of an amazon user named Crysknife007

There may be a better way to accomplish this but this method definitely works. Obviously something more universal that does the same if you're using attractmode or some other front end would also be ideal.

Issues with build quality and safe shutdown for SUPERPI UCase

Hello,

I recently purchased a SUPERPI UCase from Amazon for my Raspberry 3B+ RetroPie.

I have a couple issues with the build quality and script that runs the safe shutdown and reset. I'll try to concisely describe the issues and the troubleshooting steps I've taken.

  1. The screws included that assemble the case are too large and stress the plastic posts on the bottom half of the case. The plastic posts are visibly stressed and white after forcing the screws in. Here is a photo. While I'm unhappy with this, the case does assemble.

  2. Power down and reset do not work correctly with the safe shutdown PCB switch turned on.

I used the RetroPie image for 2/3 here: https://retropie.org.uk/download/

After assembling the case with my 3B+ and setting the PCB safe shutdown to on, I entered this script from your github repo: wget -O - "https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master/install.sh" | sudo bash

When the "safe shutdown" switch on the PCB is on:

  • The pi turns on when I turn on the power switch.
  • The pi does not turn off when I turn off the power switch.
  • The pi runs a shutdown script when I press reset, but Emulationstation is not booted up again. The pi is powered on (indicated by the red LED) but nothing is sent to the monitor via HDMI.

When the "safe shutdown" switch on the PCB is off:

  • The pi turns on when I turn on the power switch.
  • The pi turns off immediately (no code displayed) when I turn off the switch.
  • Emulatorstation resets immediately (no code displayed) when use the reset switch.

I've tried using the script by crerror but I keep getting a 404 response in the RetroPie terminal.

One thing I wonder that might be an issue is that the wires that connect the case to my Raspberry Pi are colored differently than the instruction manual and what I've seen in online tutorials. Here is a photo of my wires.

To be frank, I've been unhappy with the instructions included with the case, the build quality, and the script. I would appreciate it if you could help me troubleshoot the issue.

If I can just get the power and reset buttons to work correctly then I'll be satisfied.

Retroflag picase + issue

My retroflag plus has an issue where it powers on as soon as the microusb is inserted, the nes case power button is in an "off" state when i click it once it then initiates the script and powers off but the button is now in an "on state"

Has anybody else had this issue?

I thought with power button in off state it would not power on at all

Power button does not trigger shutdown script

I have just installed a 3b+ in a new nesipi+ case. Setup a new install of retropi and installed the shutdown and reset script. while the reset button successfully triggers the reset script, the power button doesn't trigger the shutdown script.

If I shutdown the pi via terminal then turn off, and the back on the power button it will trigger the startup. So the button and LED do both work.

powerenPin? No documentation.

powerPin = 3 
resetPin = 2 
ledPin = 14 
powerenPin = 4 

I have a megaPi case. Documentation is non existent in the script. I am assuming the following:

  • powerPin (3) is the sliding switch’s on state.
  • resetPin (2) is the physical button.
  • ledPin (14) is the output to the red led.

What is powerenPin (4)? I don’t get it.

Uninstall

Hi,

I'm looking for a way to completely uninstall this script? I installed without noticing that I don't have the 2nd generation RetroFlag case with the shutdown switch on the PCB. Thanks in advance.

Kind regards, Daniel

failed communication refused

Last week, I got the Retroflag NESPi Case+ to add to my already working retropi setup. For some reason I cant get the shut down string to work.
When I type in:

wget -O - "https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master/install.sh" | sudo bash

It gives me a failed communication refused error. I spent the last few days seeing if I can google a resolve and I havent had any luck. I can access putty and I have updated to retropie 4.4.4.
I have the retropi 3 model B PCB
I added a blank ssh file to the sd card (per other forums).

Today the error is a bit different. it says failed connection timed out and continually retries with no luck

Is there anything Im missing? Can anyone assist in a resolve?

Reset Button always reboots the system instead of jumping to ES

Using this on a SuperPi Case with a Raspberry Pi 3 B+.
RetroPie: 4.4.12 (1357cc3f)

The readme describes the following:
If you press restart if emulator is currently running, then you will be kicked back to ES main menu.
If you press restart in ES main screen, ES will be restartet (no reboot!), good for quick saving metadata or internal saves.

Is the readme outdated and the reset button always makes a complete reset? Or does the script not behave correctly for me?

Furthermore if ES is not running the reset button or power off button does nothing for me.
Only the following is shown:

rc.local[542]: emulationstation: no process found

installed script, but doesn't work

I have a super nespi case from snespi.com and installed the shutdown script and shift the pcb to on.
But it won't work, when i push the reset button it does nothing.
And the on/off shifter is a hard shutdown.

Also, what is the correct fan inlet, the input fan or the soft fan?

Kind regards,

Not an issue. Just a thank you

I started playing around with the Raspberry Pi by getting a Pi model B in 2012. Hadn't touched it for years, and decided to get a 3 B+. I found the MegaPi Case on Amazon, reasonably priced and promising proper shutdown via scripts and functioning buttons. All of this was true, and the scripts were rather easy to get working. At first I was confused, because hitting the reset switch was actually resetting the Pi, and not ES. But I realised that crcerror's rewrite was not part of Master, so I got that from his repo and it was all good. Everything works great, and I really appreciate everyone's contributions and effort to get everything working smoothly and easy to setup.

Does not work on retropie 4.4

Just got my nespi+ and went through the script install twice both seemingly completing successfully and neither button does anything. This is on retropie 4.4 upgraded to stretch.

Install script doesn't install all needed components

Hi,

I just fiddled like 2 hours around with the scripts. My Pi hung up three times...
I'm using the newest version of OSMC, Pi 3 B+.

I needed to install:
python-dev, python-setuptools, gcc, and rpi.gpio.

If these components aren't installed the pi will hard freeze...
Maybe update the install script?

OSMC Compatible Script Request?

Issues getting this to work on OSMC. Errors i notice when running script in SSH as root
"E: Unable to locate package python3-gpiozero"

After some digging found issues w/build that osmc is based on and getting gpiozero packages. used suggestion of user over here and used PIP:

sudo apt install python-pip python3-pip
sudo pip install gpiozero
sudo pip3 install gpiozero

gpiozero/gpiozero#538

this did get those packages installed but switch does not do anything after this even. i plan to look into other OSMC service scripts that have been used w/other power pcb add-ons.

thanks!

Akward restarting with Superpi Case and Recalbox OS

Hi everyone. I was using 2 raspberry Pi 3 with the Nespicase and safe shutdown script and everything was smooth and fine.
When I saw the Superpi Case I can't resist buying it ... and it was the beginning of the problems.

My raspberry starts (the led is by the way fully fonctionnal) when I plug the power supply even though the power switch is off.
Safe shutdown power and reset scripts work BUT the fan sometimes shuts off and sometimes doesn't.
Worse off all, the raspeberry restarts all alone after a few minutes , even if the power switch is off.
I tried with 3 power supplies (including the official one) . I tried to pull the safe shutdown switch off and gess what ? Scripts works and my raspberry restarts the same way.
I'm french , I buy my superpicase (Deluxe editon) on a Euro saler on amazon (Geekpi). The controllers are not the way I expected with a Geekpi sticker instead of the Retrofalg one on it and not similar at all to a genuine SNES Jap controller (bigger, not the same grey than the original).
The Case look great BUT I'm wondering if it migth be a copy now.
Thank to anyone who will have any idea !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.