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

    Error launching rom via python script/command line

    Scheduled Pinned Locked Moved Help and Support
    pythonscriptlaunching rom
    4 Posts 2 Posters 2.7k 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
      sekazi
      last edited by

      I am running a kit that launches roms via a NFC tag. in the code it appears to be correct. When I try to run the exact line manually though the command prompt I get the same error so there must be something different for me. I know someone else who is having the same problem too.

      The line in the py script is
      subprocess.call("sudo openvt -c 1 -s -f " + emulatorpath + rompath + "&", shell=True)

      If I try to run the exact string in a command I get an error. The command I run is
      sudo openvt -c 1 -s -f -v "/opt/retropie/supplementary/runcommand/runcommand.sh 0 SYS nes /home/pi/RetroPie/roms/nes/mario.nes"

      I am running the NES emulator with a mario.nes rom. The message I get is
      openvt: Using VT /dev/tty1
      openvt: exec: No such file or directory

      Then the raspberry pi proceeds to launch emulationstation.

      Now if I try to use just the following
      sudo /opt/retropie/supplementary/runcommand/runcommand.sh 0 SYS nes /home/pi/RetroPie/roms/nes/mario.nes

      This works fine from command line but when running the python script it never shows the rom. The whole problem seems to be around openvt which I cannot find anything online about. I do not know enough about linux or scripting to figure this out.

      meleuM 1 Reply Last reply Reply Quote 0
      • S
        sekazi
        last edited by

        I still have had no luck figuring this out. I have no clue why emulationstation just restarts using openvt when the command is correct for launching a rom.

        1 Reply Last reply Reply Quote 0
        • meleuM
          meleu @sekazi
          last edited by meleu

          @sekazi said in Error launching rom via python script/command line:

          The whole problem seems to be around openvt which I cannot find anything online about. I do not know enough about linux or scripting to figure this out.

          When you say online you mean "on the web", right? The information you need is really close to you, no need to search on the web. Prepare to get a life changing information about Linux... drums rolling

          Man pages! If you type man comand you get the manual of the command. I think you wanna take a look at the openvt man page. So type man openvt and you'll be amazed. To exit the man page press 'q'.

          But here are some answers about the errors:

          openvt: exec: No such file or directory

          You are trying to execute /opt/retropie/supplementary/runcommand/runcommand.sh 0 SYS nes /home/pi/RetroPie/roms/nes/mario.nes, and there's no file with this name. You want to execute the file /opt/retropie/supplementary/runcommand/runcommand.sh and then give some arguments to it. I'll let let you find the solution, but it's releated with the "quotes". :-)

          I have no clue why emulationstation just restarts using openvt when the command is correct for launching a rom.

          Well, you saw above that the command isn't correct, right? But the emulationstation thing is because retropie is configured to start emulationstation in tty1 (look at your /etc/profile.d/10-retropie.sh) and your openvt command is forcing the use of tty1 (-c 1). The openvt fails to execute the command you give to it, but it starts the terminal with success.

          • Useful topics
          • joystick-selection tool
          • rpie-art tool
          • achievements I made
          1 Reply Last reply Reply Quote 0
          • S
            sekazi
            last edited by

            Thanks for the help. That did solve it for running it myself but the python script still failed. I get

            /opt/retropie/configs/all/autostart.sh: line 1: 3353 Terminated emulationstation
            tput: unknown terminal "unknown"
            'unknown': I need something more specific.
            Error opening terminal: unknown.
            Traceback (most recent call last):
            File "/opt/retropie/supplementary/runcommand/joy2key.py", line 42, in <module>
            curses.setupterm()
            _curses.error: setupterm: could not find terminal

            Then emulationstation proceeds to launch again.

            In the end I got everything working by going back to RetroPie v4.0.2. I really do not care about having the latest version for this one as it is more of a novelty item than anything since I can launch games with cartridges.

            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.