[Tutorial] Get text output from bash files into your python script!
-
I would like to shut it down completely, including the fan, while saving ES settings and metadata, and if possible saved games even if the system is shut down while using retroarch (it doesn't if you don't exit it properly, even if you saved in game) and preventing SD card corruption.
That's all the script is doing for you.
Would this script be better for that or the Multi Switch Shutdown Script as explained here?
The "Multi Switch Shutdown Script" (MS3) fullfills two purposes. It can act as real shutdown script then you need to call it via autostart and set parameters to it. Or it can be used as command line tool to get info about status of emulators and EmulationStation. Annother shutdown script (like the modified NESPi+ python script) can read that status and set different actions.
What are the fundamental differences between the two of them?
See I wrote that script to make setup of some power devices as easy as possible. But someone wants a LED to lid, annother wants to play a song during shutdown and you want to display a picture. So it's easier to write your own scripts and invoke MS3 to do the prober shutdown action.
The big difference between the MS3-bash script and this python is the routine how the trigger status is asked. The bash script uses the classic polling (one request in every 1 second) the python script are using interrupts which are better for mashine handling. The python script is a bit more relieable.... That's all.
-
@cyperghost thanks for the extensive answer. Really appreciated.
-
@cyperghost
I had to register just to say thank you! Your scripts are on point. The way the reset button and power button works now is perfect and RetroFlag should have done it this way in the first place. I use your rom manager script to and awesome work! Thanks again :) -
@sithel I really appreciate your comment. But take your time to stay here there are much more things to discover. Currently a new port of openbor is made, lots of nice themes are available and did you ever heard about retroachievements?
-
Sorry if this is too obvious, but can I install this using a snespi+ instead?
-
@CapNinja yes. Retroflag did not change any line of code since the NESPi so this is working with SuperPi and the new MegaPi case, too.
I have a US version of their SuperPi-case and the code is working best. -
@cyperghost
Thanks -
I have a 3B+ in the Nespi case and followed the "automatic install" instructions but the power and reset buttons don't work. Do I need to install the script from RetroFlag first?
-
@benjaminjay If no switch is working for you then the script from retroflag will also fail. You should set small switch in SAFE SHUTDOWN ON position and/or recheck wiring.
-
@cyperghost I had the safe shutdown/reset working fine with the old Pi 3 model no problem. I just built 2 units side by side exactly the same with Pi 3 B+ and Nespi case and tried both the RetroFlag script and the auto installation posted here and neither of them work at all.
-
I'm having the error 404 today, but other things in github still ok.
edit: Typing wrong was what got me into that, now it's alright -
Hi
I’ve just stumbled across your script, which looks exactly what I need. I’ve recently got a new pi case, a RetroFlag NESPI, with reset button and power switch. I initially configure this using the RetroFlag Safeshutdown script (https://github.com/RetroFlag/retroflag-picase/blob/master/SafeShutdown.py), and that works fine. Reset causes ES to reboot safely and Power causes ES to shutdown.
However what I’d rather is for Reset to close down all emulators and go back to menu, which your script does. Is the best way for me to implement your script on top of my current solution to simply modify SafeShutdown.py to call your script passing in —emuclose rather than the current “sudo killall emulation station” do you think?
Thanks
-
@stevedee78 visit this one https://github.com/crcerror/retroflag-picase
-
@cyperghost Hi mate, I know this is quite old but I'm only just getting into Pi, and I've installed your script. However, prior to installing, I installed the "RecallBox" script from the github repository by mistake, instead of the retropie one. Do I need to uninstall that script, if so, how please?
Sorry, from a NOOB.
-
@carlos0371 said in [Tutorial] Get text output from bash files into your python script!:
@cyperghost Hi mate, I know this is quite old but I'm only just getting into Pi, and I've installed your script. However, prior to installing, I installed the "RecallBox" script from the github repository by mistake, instead of the retropie one. Do I need to uninstall that script, if so, how please?
Sorry, from a NOOB.
OK so I worked out that as the directories the recallbox script was trying to install to didn't exist, it didn't actually install anything.
Next question is, I've run all the commands, but still not working.
If I'm in ES and press the rest, it reboots completely, it doesn't just restart ES as it's supposed to.
-
@carlos0371 I left the recalbox-script in original state. So there it reboots the whole Pi
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.