Trouble Executing a C Program and EmulationStation
-
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.
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.