Create your own and free video surveillance system

Create your own and free video surveillance system

This video surveillance system is based on this requirements:

  • hardware
    • a raspberry pi
    • a network camera with MJPEG streaming
  • software
    • raspbian OS
    • motion
    • mutt
    • msmtp

I will show you in this tutorial how to create your own video surveillance with these features :

  • motion detection
  • send alerts and images by email
  • save locally pictures
  • create a daily timelapse video
OS/Packages installation

First install the raspbian OS on your raspberry pi : procedure (download image)

Remove unnecessary X11 libs : apt-get remove --auto-remove --purge libx11-.*

Install required packages : apt-get install motion msmtp ca-certificates mutt

Configure msmtp/mutt to send email using Gmail with TLS

Create/edit the configuration file /etc/msmtprc

Create/edit the configuration file /etc/Muttrc (important : the file is Muttrc and not muttrc) :

Test/try to send an email :
echo "Body message" | mutt -a /etc/hosts -s "Test email" -- recipient@gmail.com

Create and set rights on the folder where the images/videos will be saved :

Create the script that will send emails /home/pi/scripts/send_mail.sh :
#!/bin/sh
temp=/opt/vc/bin/vcgencmd measure_temp
echo “Internal $temp – Uptime : $( uptime )” | mutt -a “$2” -s “Motion detected : $1” — youremail@gmail.com

Create the script for the image/video retention /home/pi/scripts/motion_ret.sh :

Configure motion

Edit the file /etc/default/motion

Edit the file /etc/motion/motion.conf (backup the original first):

Configure cron

Create the script that will monitor/start/stop the motion process /home/pi/scripts/motion_mon.sh :

Configure the cron jobs :

Just wait the process launch and that’s all… If some steps are missing do not hesitate to leave a comment and I will update the proc.


References

motion

<>

My Powershell script categories

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Social Media Auto Publish Powered By : XYZScripts.com
%d bloggers like this: