maiodream.blogg.se

Raspberry pi how to make a program run at startup
Raspberry pi how to make a program run at startup






raspberry pi how to make a program run at startup

Mine is in desktop and the program name is test_pgm.py you can also choose between python2 or python3 here. Make sure you have used the right path and program name. When you open the file you will see the below code already in -profile -desktop -profile -no-splashĪdd -e python3 /home/pi/Desktop/test_pgm.py" this line to the file. Sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart Sudo nano /etc/xdg/lxsession/LXDE-pi/autostartįor Jessie OS or below, the autostart file can be accessed with below link Modify the autostart file by following the code for Buster OS Other methods will fail with import cv2 "no module found" error or with the failed to load X server. It is not possible to launch it from a text console. The best way to launch an OpenCV project is from the LXTerminal by modifying the autostart file. Note: Python OpenCv scripts with image frames can be displayed only after the GUI (Desktop) loads up. What supposedly is to be a 2 minutes job took a lot many hours so I decided to write this post as a note for future self and also to others But if you have some kind of GUI then it is not possible to launch the script directly from the boot sequence without loading the Desktop. Well! it is easy if your python code does not use OpenCV and GPIO pins. There are many ways to start a python script on boot and the processes is suppose to be very easy.








Raspberry pi how to make a program run at startup