Homepage Forums RetroPie Project Everything else related to the RetroPie Project conditionnal auto-launch on boot error

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #117579
    Lowlow
    Participant

    Hi!

    In this forum’s Ideas for “Further Enhancements” section i proposed on RPI’s boot a way to launch emulationstation only if some controller is plugged with a .sh file containing :

    #!/bin/bash
    
    if [ "users | wc -w" -eq 1 ]; then
            if [ -e /dev/input/js0 ]; then
                    exec "emulationstation"                   # Launch Gaming platform if a controller is plugged
            fi
    fi

    launched with this cron job:
    @ reboot sleep 15 && sh /path/to/AutoLaunch.sh

    I thought this was working..ES launch w/out any error outputs, but when trying to launch a rom screen flip to console then back at ES main screen.

    Afterward i get this message:

    Subject: Cron <lowlow@RPiStation> sleep 15 && sh /home/lowlow/AutoLaunch.sh
    
    TERM environment variable not set.
    tput: No value for $TERM and no -T specified
    TERM environment variable not set.
    Error opening terminal: unknown.
    /opt/retropie/supplementary/runcommand/runcommand.sh: ligne 704: /dev/tty: No device or address
    /opt/retropie/supplementary/runcommand/runcommand.sh: ligne 763: /dev/tty: No device or address
    TERM environment variable not set.
    tput: No value for $TERM and no -T specified
    Traceback (most recent call last):
      File "/opt/retropie/supplementary/runcommand/joy2key.py", line 43, in <module>
        tty_fd = open("/dev/tty", "w")
    IOError: [Errno 6] No such device or address: '/dev/tty'

    Any idea on what i’ve done wrong ? ’til now i tried many ways to got it working but no luck so far..

    Btw, when launched manually it works well..this problem occur only with the auto-launch attempt.

    #117699
    petrockblog
    Keymaster

    it expects a terminal to be attached – instead of launching from cron, why not adjust the existing ES launch script to check for this (/usr/bin/emulationstation) or /etc/profile.d/10-emulationstation.sh which is triggered on boot.

    #117771
    Lowlow
    Participant

    Ahhhh damn good !

    this is working smoothly now. There wasn’t any 10-emulationstation.sh because i hadn’t activated auto boot option during ES installation but anyway, just removed my cron job, and moved my actual .sh script there.

    Thanks !!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Everything else related to the RetroPie Project’ is closed to new topics and replies.