#!/usr/bin/env python3 import time, subprocess import RPi.GPIO as GPIO from SCP import scp IR_PIN = 3 GPIO.setmode(GPIO.BOARD) GPIO.setup(IR_PIN, GPIO.OUT) i = 0 try: while True: print("Gpio Low") GPIO.output(IR_PIN, GPIO.HIGH) time.sleep(2) # take image and scp it to the other pi print("take image...") subprocess.run(['raspistill', '-o', 'images/image' + str(i) + '.jpg']) print("transfer image") #scp('images/image' + str(i) + '.jpg', '~/image' + str(i) + '.jpg', '192.168.252.1', 'pi', 'smarthome') i+=1 if i>10: break #print("Gpio High") #GPIO.output(IR_PIN, GPIO.HIGH) #time.sleep(2) # take image and scp it to the other pi #print("take image...") #subprocess.run(['raspistill', '-o', 'image2.jpg']) #print("transfer image") #scp('image2.jpg', '~/image2.jpg', '192.168.252.1', 'pi', 'smarthome') #break except Exception as e: print(e) finally: GPIO.cleanup()