On 16/06/18 12:24, Andy Burns wrote:
> On 16/06/2018 12:05, RobH wrote:
>
>> Current version of what, the code ?
>
> yes, unless it's huge ...
As you look down through the code, you will see what I have added by
something like this:
< I added this,
< and this
I was just trying different things which I read about the shutil module
CODE:
from picamera import PiCamera
import time
import os
import os.path
import shutil
from os.path import join < I added this
src = ("RAMname")< and this
dst = ("NASname")< this
from gpiozero import MotionSensor #According to google motionsensor is
in gpiozero
# Create object for PIR Sensor
# PIR Sensor is on GPIO-4 (Pin 7)
pir = MotionSensor(4)
# Create Object for Camera
camera = PiCamera()
while True:
# Wait for motion being detected
pir.wait_for_motion()
triggerTime = time.time()
#create base filename at time of motion trigger
fname = time.strftime("%Y-%m-%d_%H.%M.%S.h264",
time.localtime(triggerTime))
RAMname = os.path.join("/run/shm", fname)
NASname = os.path.join("/mnt/CCTV/PiZero" , fname)
camera.start_preview()
#capture video to RAM device first
camera.start_recording(RAMname)
camera.wait_recording(10)
camera.stop_recording()
camera.stop_preview()
#copy from RAM device to NAS device
#shutil.copyfile(RAMname, NASname) * Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|