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

    Trouble Executing a C Program and EmulationStation

    Scheduled Pinned Locked Moved Help and Support
    emulationstatiostartupc codeblack screen
    1 Posts 1 Posters 754 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.
    • L
      lemossilva
      last edited by

      Hello everybody! I have a Raspberry Pi 3 with Retropie 4.01 and i'm having some trouble to execute a C program at startup. Let me explain a few things;
      I use an external hard drive to put my roms on it, so because of that, I have to delay EmulationStation startup by 10 seconds (so the system can build the external drive in time). I did this by putting 'sleep 10' before './emulationstation' on /usr/bin/emulationstation. Ok, no problems at this point. Eventually I had to connect a fan to my RPi because it was getting too hot (75C at idle). I build a circuit to control the fan using PWM and I'm using this C code to control it. It works fine when i run it from SSH. Then I tried to execute it from startup by adding sudo ./home/pi/C_codes/fan_ex (i used chmod +x to make it executable) into rc.local file. But when I do this, for whatever reason, the code doesn't work and the fan spins at 100% (just like it is on HIGH state, instead of PWM behaviour). I fixed that by adding a delay (sleep (5);) into the C code, at the first line of the main(). The problem now is the emulationstation that doesn't show up, the screen stays black unless I run emulationstation from a SSH client. Can you help me manage that? Sorry for the long text and thanks for helping me.

      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.