RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Start EmulationStation remotely?

    Scheduled Pinned Locked Moved Help and Support
    emulationstatio
    7 Posts 2 Posters 546 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sleve_mcdichael
      last edited by sleve_mcdichael

      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 with emulationstation, 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 .)

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        You can detach EmulationStation's process using screen (which is a handy utility in itself), by running it in a screen 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 ?

        S 1 Reply Last reply Reply Quote 0
        • S
          sleve_mcdichael @mitu
          last edited by

          @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 could reboot after, or go over to the keyboard and type it in, was just wondering if there was another way.

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator
            last edited by

            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
            
            S 1 Reply Last reply Reply Quote 1
            • S
              sleve_mcdichael @mitu
              last edited by sleve_mcdichael

              @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 of bash: one from SSH (pts/0) and two from tty1. Repeating the command, kills one of them; repeating it again kills the other and spawns two more. This repeats.)

              mituM 1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @sleve_mcdichael
                last edited by

                @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.

                S 1 Reply Last reply Reply Quote 0
                • S
                  sleve_mcdichael @mitu
                  last edited by

                  @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 :)

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  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.