This is the method I use to launch python script after boot. Open terminal and type:
Code: Select all
sudo nano ~/.config/lxsession/LXDE-pi/autostart
Add the following line above the @xscreensaver line
Code: Select all
@/usr/bin/sudo python /home/pi/yourscript.py
Make sure you replace /home/pi/yourscript.py with location and script name for your python script. And make sure it is the line directly above the @xscreensaver line.
So I've done exactly that and rebooted my Pi.Reboot and your script should run.
Now it's stuck at a black screen (not a screensaver, I don't think.) I can move my mouse and with ctrl+alt+f2 I could login into my Pi and thought maybe the LXDE wasnt installed correctly. So after login into my Pi I used the following line to update (or install the LXDE package)
Code: Select all
sudo apt-get install lxde-core xserver-xorg xinit
Code: Select all
sudo shutdown -h now
I'd just like to get back to my Pi/homescreen now.
Am I fukt? Do I need to reimage the SD card?
Any help would be greatly appreciated. <3