Hey Leute,
ich will, dass dieses Script beim Start des Raspberry Pi ausgeführt wird:
Python
import RPi.GPIO as GPIO
import picamera
import time
import datetime
from time import sleep
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(23, GPIO.OUT)
GPIO.setwarnings(False)
while True:
timestrf = time.strftime("%Y%m%d-%H%M%S")
if (GPIO.input(18) == True):
GPIO.output(23, 1)
with picamera.PiCamera() as cam:
cam.resolution = (1920, 1080)
cam.exposure_mode = 'antishake'
cam.capture('bild_{}.jpg'.format(timestrf))
cam.close()
GPIO.output(23,0)
else:
GPIO.output(23, 0)
GPIO.cleanup()
Alles anzeigen
Dafür habe ich diese Anleitung befolgt:
https://www.forum-raspberrypi.de/Thread-tutoria…s-python-script
Mein Problem ist jetzt, dass keine Bilder mehr in /home/pi gespeichert werden, und auch sonst nirgends. Ich hatte eigentlich vor, dass wenn man den Strom anschließt, der Raspberry Pi nach dem booten gleich das Programm ausführt, ohne das man sich per SSH oder anders noch aufschalten muss. Aber dies scheint nicht zu funktionieren.
Warum speichert das Script keine Bilder mehr ab, und wie kann ich das Problem lösen?