I love raspberry pi and I made many programs in Python. One of them is a cool GPIO robot controlling program. I want to run my pi without any display. I also want my pi to run that specific program when it is powered on.
Is that possible.
I love raspberry pi and I made many programs in Python. One of them is a cool GPIO robot controlling program. I want to run my pi without any display. I also want my pi to run that specific program when it is powered on.
Is that possible.
You will need to launch the script at startup. This is really a linux question, and there are many ways to accomplish this. Here are two:
For running python script at startup , you can either
edit your etc/rc.local You could make your /etc/rc.local look like this:
/yourpath/bin/yourscript.sh &
Then in yourscript.sh put:
#!/bin/sh
sleep 10
sudo python scriptname.py
OR
you can use crontab which makes it easier to start the python script at reboot or at a specific time as 11pm everyday like that.
I have done by this reference https://www.dexterindustries.com/howto/auto-run-python-programs-on-the-raspberry-pi/