1
votes

I have been struggling for a while trying to make a .py file start on a raspberry pi bootup. the file includes opencv, tensorflow and picamera usage. When i try to start the program at boot using different methods it wont start.

The methods i've tried are: /etc/rc.local (both trying to start the program directly or a .sh script that boots the program itself)

/home/pi/.config/autostart (either starting directly the program with "Exec= '/usr/bin/python3 /pathtoprogram.py') (or using an extern program called "xterm" to try and boot up the program but it fails to start the program)

.bashrc with (sudo python3 /pathtoprogram.py)

I'm atually looking for new methods. the program boots perfectly when i start it myself on the raspberry pi.

Additional info: my program is a modified version of this one: https://www.tomshardware.com/how-to/raspberry-pi-facial-recognition using the picam version.

1

1 Answers

0
votes

Try systemd:

https://www.raspberrypi.org/documentation/linux/usage/systemd.md

"In order to have a command or program run when the Pi boots, you can add it as a service. Once this is done, you can start/stop enable/disable from the linux prompt."