Skip to content

Part 5. Run the Script from Boot

Rachel edited this page Jul 25, 2016 · 2 revisions

We're going to want to start our script as soon as we power on the Pi since our only control over it will be the power button on our portable power bank. Lucky for us, this is super easy!

Using the service crontab we can not only start our script at boot but we can log any error messages we might get, too:

sudo crontab -e

Pick your favorite text editor (I like nano) and at the bottom of the file (under all of the comments), add @reboot sudo python /home/pi/fonagps.py > /home/pi/fonalog.txt. If you named your script something else or put it in a different directory, replace /home/pi/fonagps.py with the correct path. The path in my example is just the main Pi directory.

Save the file and reboot your Pi for it to take effect!

<< Part 5: Your Personal Dashboard - Part 6: Putting it all Together >>