OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) can’t autostart ospi.py…rc.local or init.d Re: Re: can’t autostart ospi.py…rc.local or init.d

#25465

Samer
Keymaster

I’ve mentioned this before but deleted it because it threw a wrench into things. However, I found a well written how-to for crontab and therefore bringing it up again.

First off the guide is available here: http://www.raspberrypi-spy.co.uk/2013/07/running-a-python-script-at-boot-using-cron/

Second, this method is dead simple once you know how crontab works, I believe crontab is installed by default, sciprts are run late enough in the boot sequence to execute without conflict, etc. To recap the link all you do is:

sudo crontab -e

Add the following line:

@reboot python /home/pi/OSPi/ospi.py &