Start EmulationStation remotely?
-
Pi 4b, RP 4.7.14 (SSH via Terminus app on iPod Touch/iOS 14.6)
I can quit ES remotely over SSH with the command
kill $(pidof emulationstation)
. I can even start it back up withemulationstation
, and it comes up on my TV screen, controls work and I can even launch & play a game; however when I close the SSH app on my device, it terminates ES (or RA if I'm in a game) and drops me back into the terminal. Is there a command I can use (from the remote SSH terminal) that will run it locally from the Pi, as if I had run it from a connected keyboard, so that it doesn't terminate when I quit the app (and, ideally, can continue using the SSH terminal instead of it cutting to the black screen I'm getting now while ES runs .) -
You can detach EmulationStation's process using
screen
(which is a handy utility in itself), by running it in ascreen
session from your SSH session.
Since I do this for testing sometimes, I'm going to explain the pitfalls of running ES remotely:runcommand
's launching screen will not show on the TV/Monitor screen of your Pi, but on the SSH/screen session from where it is started, hence the launching menu is unusable.- since the controlling terminal is not a console one, keyboard button presses will 'bleed' through to the terminal and may cause inadvertently commands to be run. If you're not using a keyboard, you won't be experiencing this.
What's the use case for starting ES remotely ?
-
@mitu said in Start EmulationStation remotely?:
What's the use case for starting ES remotely ?
Example: I've downloaded a new ROM on my iDevice and SMB'ed it to my RPi with a file manager. Now I want to scrape its data with Skyscraper. I have to quit EmulationStation before writing the
gamelist.xml
with the new data. Let's say I don't have a keyboard, or maybe I'm across the rom from it with a USB extender or wireless gamepad. I couldreboot
after, or go over to the keyboard and type it in, was just wondering if there was another way. -
Instead of starting ES remotely (once you've exited to use Skyscraper), just stop the console shell where it started.
# find the PID of the auto-login session $ ps -e | grep bash | grep tty1 13554 # stop the bash login shell and trigger the auto-login again, starting ES kill 13554
-
@mitu this works, thanks! Does anything bad happen if I just use
kill $(pidof bash)
instead?(Ah, yes it looks like something bad does happen. As I was messing with this, my ES menu got all jacked up, displaying wrong artwork and not launching a game; and when I quit ES the console text was also messed up all across the screen. A restart seems to have fixed it but I guess I'll stop screwing around and just use the two-step method for as often as I'll never actually need to use this.)
It seems to work, but are there reasons I shouldn't? It seems to always kill the latest instance that's not the one I've run it from (so if I run it from the pi, it kills my SSH session. If I run it from the SSH session, it kills my Pi login and then autologs in to ES.At this point there are three instances ofbash
: one from SSH (pts/0
) and two fromtty1
. Repeating the command, kills one of them; repeating it again kills the other and spawns two more. This repeats.) -
@sleve_mcdichael said in Start EmulationStation remotely?:
Does anything bad happen if I just use kill $(pidof bash) instead?
Yes, you may be killing your own remote shell.
-
@mitu it never seemed to kill the instance that I ran it from, but it did give ES a stroke, so I won't do it anymore :)
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.