I’m creating CCTV system called DAVID and I need help with coding. CODE Here is a summary of what the system will do? when motion is detected and it locks the door(which is disabled on LCD) and...

1 answer below »
I want the same guy who did my previous order. He did good job on the code but i need him modified/change and add new things. Check attachment for more details. I also attached the old code.


I’m creating CCTV system called DAVID and I need help with coding. CODE Here is a summary of what the system will do? when motion is detected and it locks the door(which is disabled on LCD) and started recording video for 30 second and sent an email to user and save a copy to USB Thumb drive. Then the person will try to access the door using RFID access . 1.I want python code to run on raspberry Pi for motion detector and camera. -I need the camera to record video for 30 second, once the motion detector is activated( I used GPIO4) - I want the resolution for the camera to be at 1080pi 2 I need a python code for RFID. Please use this below screenshot to identify which GPIO to use connect RFID to raspberry pi 4 3. Code for single Relay board( I used GPIO17) 4. another Python code for an email to be sent to the user for the 30 second video(the video is from camera and motion detector) notification the user and I want to sent copy to a USB Thumb drive. 5. LCD 2x16 I want the LCD to this play theres command-Access Denied, Access Granted, Door Locked and Door Unlocked. Here is GPIO I used to connect it raspberry pi- 6.All these codes 1-5 should be single code and also please provide instruction once I download ur code how will I run the code using raspberry pi.
Answered 1 days AfterApr 26, 2021

Answer To: I’m creating CCTV system called DAVID and I need help with coding. CODE Here is a summary of what...

Sandeep Kumar answered on Apr 28 2021
136 Votes
import gpiozero
from gpiozero import MotionSensor
from picamera import PiCamera
from datetime import datetime
from email.mime.multipart impor
t MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
import email.encoders
import smtplib
import os
import email
import sys
import time
camera = PiCamera()
pir = MotionSensor(4)
camera.rotation = 180 # delete or adjust to 90, 180, or 270 accordingly
camera.resolution = (1920, 1080)
h264_video = ".h264"
mp4_video = ".mp4"
while True:
# record h264 video then save as mp4
pir.wait_for_motion()
video_name = datetime.now().strftime("%m-%d-%Y_%H.%M.%S")
camera.start_recording(video_name + h264_video)
pir.wait_for_no_motion()
camera.wait_recording(30)
camera.stop_recording()
os.system("MP4Box -add " + video_name + h264_video + " " + video_name + mp4_video) # tutorial for install to make this conversion possible at: http://raspi.tv/2013/another-way-to-convert-raspberry-pi-camera-h264-output-to-mp4
os.system("rm " + video_name + h264_video) # delete h264 file
footage = video_name + mp4_video
'''Part 5 '''
# prepare the email
f_time = datetime.now().strftime("%A %B %d %Y @ %H:%M:%S")
msg = MIMEMultipart()
msg["Subject"] = f_time
msg["From"] = "[email protected]" #configure sender email
msg["To"] = "[email protected]" #configure receiver email
text =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here