first attempt : through crontab
sudo crontab -e added :
Code: Select all
@reboot python3 /home/pi/camera.py
Code: Select all
from picamera import PiCamera
from time import sleep
camera = PiCamera()
camera.framerate = 15
camera.start_preview()
second attempt through crontab :
Code: Select all
sudo crontab -e
added :
Code: Select all
@reboot /home/pi/launcher.sh >/home/pi/log/cameralog.log 2>&1
launcher.sh :
Code: Select all
#!/bin/bash
clear
cd /
cd home/pi
/usr/bin/python3 /home/pi/camera.py
cd /
removed all from crontab and used rc.local
Code: Select all
sudo nano /etc/rc.local
added :
Code: Select all
/usr/bin/python3 /home/pi/camera.py&
I'm new to raspberry and python. what's wrong?