Tested on:Raspberry Pi 2; Raspberry Pi B+; Raspbian pre Jessie
Prerequisites:Raspberry Pi with Raspbian Jessie(see steps 1-5 in the Introduction)
Standard python project file setup

Shell alias: Start projects on the Raspberry Pi after booting

Here is a new tutorial on autostarting Raspberry Pi programs which also shows how to use init.d and cron.

To start programs automatically after booting into the terminal, the program call has to be stored in an initialisation script and the Raspberry Pi needs to login automatically. Alternatively, programs can be started after booting into the Desktop. This is explained in the PiPad tutorial.

Setup the initialisation script
Type sudo nano ~/.bashrc in the terminal. In the now open textfile, add a custom alias

The second line, . ./ENVNAME/bin/activate, is only necessary when a virtual environment named ENVNAME has been setup for the project.
Save the changes and reload the .profile:

Typing the alias startproject in the terminal starts the program.

Enable autologin
Open inittab with sudo nano /etc/inittab. Find the line starting with

and place a hashtag in front of it:

Below that line, enter

The Raspberry Pi does login automatically from now on and starts the program entered in .bashrc.

PiPad Tutorial: http://www.knight-of-pi.org/the-pipad-a-mobile-multimedia-raspberry-pi-pad-for-around-250/
Virtual environment: http://www.knight-of-pi.org/virtual-environments-simplify-project-management/
Autostarting Raspberry Pi programs: http://www.knight-of-pi.org/options-for-autostarting-raspberry-pi-programs-init-d-bashrc-and-cron

Knight of Pi

Johannes Bergs aka Knight of Pi. Diploma in Bioinformatics, some Webdesign and Python coding then. Living in the beautiful city of Vienna.


Time limit is exhausted. Please reload CAPTCHA.