ChilledPi auto run on startup

Hi there,

I have recently finished a project i've been working on which has been putting a raspberry pi inside a gamegear case and running retropie / emulation station :)

I bought a Picoborg to run your fantastic ChilledPi script to cool down the Pi as I thought I'd have some overheating issues and now its all finished I can see that my Pi is getting fairly hot... about 60c !

I would like to make the ChilledPi script autorun at startup and for it to run in the background without any user intervetion. I am not entirely sure how to go about this as I am not too good at coding. I released the code requires the user to execute the script and also press enter to run it which is the "raw_input('You can now turn on the power, press ENTER to continue')" command. I think I need to delete this part of the script and also the termination command at the bottom?

I think I can make the script run as a service using an Upstart script, although haven't tested this yet.

Any help / advice would be greatly appreciated :)

piborg's picture

The press ENTER to continue lines are from the original version of the PicoBorg.
The current version of PicoBorg does not really need them so you can safely delete both of the raw_input lines in the script.

To get the script to run at startup I would suggest running it from rc.local using this line:
sudo /home/pi/ChilledPi.py &
There is a guide on editing rc.local here:
https://www.raspberrypi.org/documentation/linux/usage/rc-local.md

Thanks for the response, sorry for the delay in posting back.

I haven't had time to try getting this script to run on start up yet, as I had to manually code the script using nano. Managed to get the script to execute and a fan running but I get a type error message on line 81. I think i've missed something??

typeerror on module sensor = lSensors[fan[1]]
list indices must be integers, not str

I thought it might be something to do with this line?

print '%s %s %s %s' % (dName[GPIO.input(DRIVE_1)], dName[GPIO.input(DRIVE_2)], dName[GPIO.input(DRIVE_3)], dName[GPIO.input(DRIVE_4)])

Images: 

I reverted back to the original ChilledPi.py script as I couldnt figure out what I had done wrong when copying the pi2 script. Must have been a typo somewhere but difficult to spot on a 3.5" screen :)

I commented out the raw_input lines. Placed the command line in rc.local. All working fine, however it did start printing the temps after booting which ended up taking over the entire terminal. I couldnt type any commands or stop the script from running! Took me a while of panicking but managed open a new terminal using CTRL+ALT+F2, logged in again and amended the script to comment out the print temp line.

Rebooted and script is running in the background, temp settings running from high 50c, low 48c and fan kicking in as expected.

Very happy!!! I now have a nice and cool Raspberry PiGear! Thanks for all your help :)

Subscribe to Comments for "ChilledPi auto run on startup"