All Projects β†’ bndw β†’ Security Camera

bndw / Security Camera

Licence: mit
πŸ”¦ Motion detecting security camera using a raspberry pi, webcam, and slack

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Security Camera

webcam-to-cctv-using-rpi
In this project, we will use a webcam with Raspberry Pi to live stream wirelessly.
Stars: ✭ 17 (-77.63%)
Mutual labels:  cctv, webcam
Backup
Easy full stack backup operations on UNIX-like systems.
Stars: ✭ 4,682 (+6060.53%)
Mutual labels:  s3, slack
Live-Streaming-using-OpenCV-Flask
A Flask Web-App to stream live from local webcam or CCTV (rtsp link)
Stars: ✭ 144 (+89.47%)
Mutual labels:  cctv, webcam
Achoo
Achoo uses a Raspberry Pi to predict if my son will need his inhaler on any given day using weather, pollen, and air quality data. If the prediction for a given day is above a specified threshold, the Pi will email his school nurse, and myself, notifying her that he may need preemptive treatment. Community-sourced health monitoring!
Stars: ✭ 200 (+163.16%)
Mutual labels:  raspberry-pi, diy
Tinderboxpedal
Bluetooth "Universal Remote" Footpedal for Digital Guitar Amps, on ESP32 or Pi Zero W
Stars: ✭ 48 (-36.84%)
Mutual labels:  raspberry-pi, diy
Uc2 Git
Respository for Open-Science modular microscope system.
Stars: ✭ 203 (+167.11%)
Mutual labels:  raspberry-pi, diy
Raspchat
A chat server that can run on Raspberry Pi
Stars: ✭ 418 (+450%)
Mutual labels:  raspberry-pi, slack
jeelizPupillometry
Real-time pupillometry in the web browser using a 4K webcam video feed processed by this WebGL/Javascript library. 2 demo experiments are included.
Stars: ✭ 78 (+2.63%)
Mutual labels:  cctv, webcam
Pi Webcam
Automation to configure a Raspberry Pi as a USB OTG webcam
Stars: ✭ 990 (+1202.63%)
Mutual labels:  raspberry-pi, webcam
Solarthing
Monitors an Outback MATE and a Renogy Rover - MPPT Charge Controller. Integrates with Grafana, PVOutput and more!
Stars: ✭ 33 (-56.58%)
Mutual labels:  raspberry-pi, slack
Rpi wordclock
Software to create a Raspberry Pi based wordclock
Stars: ✭ 164 (+115.79%)
Mutual labels:  raspberry-pi, diy
Magicmirror
let's make a magicMirror
Stars: ✭ 57 (-25%)
Mutual labels:  raspberry-pi, diy
R e c u r
an open diy py/pi based video sampler
Stars: ✭ 158 (+107.89%)
Mutual labels:  raspberry-pi, diy
Smart Mirror
The fairest of them all. A DIY voice controlled smart mirror with IoT integration.
Stars: ✭ 2,668 (+3410.53%)
Mutual labels:  raspberry-pi, diy
Piscope
Turn your Raspberry Pi into an Oscilloscope/XY Plotter with Python
Stars: ✭ 155 (+103.95%)
Mutual labels:  raspberry-pi, diy
Showmewebcam
Raspberry Pi + High Quality Camera = High-quality USB Webcam!
Stars: ✭ 531 (+598.68%)
Mutual labels:  raspberry-pi, webcam
Pi Camera In A Box
Stream your Raspberry Pi Camera Module directly to your web browser
Stars: ✭ 49 (-35.53%)
Mutual labels:  raspberry-pi, cctv
Raspberry Pi Diy Projects
Collection of Do-It-Yourself Projects on Raspberry Pi 2 / 3 & Zero W with diverse HATs and pHATs.
Stars: ✭ 70 (-7.89%)
Mutual labels:  raspberry-pi, diy
Bucketlist
Amazon S3 bucket spelunking!
Stars: ✭ 72 (-5.26%)
Mutual labels:  s3
Auto car
εŸΊδΊŽζ·±εΊ¦ε­¦δΉ ηš„θ‡ͺεŠ¨ιΏιšœζ™Ίθƒ½ε°θ½¦
Stars: ✭ 74 (-2.63%)
Mutual labels:  raspberry-pi

Security camera

Build Status

This is a guide to creating a simple motion sensing security camera using a Raspberry Pi, USB webcam, Amazon S3, Slack. Anytime motion is detected images will be captured, uploaded to S3 and sent to a Slack channel.

example

Prerequisites

Raspberry Pi

RaspberryPi 3 is used for this build. They include builtin Wi-Fi, making them well suited for this usecase.

Configure the Raspberry Pi as follows:

  • Raspbian Stretch Lite is the OS this guide was tested with
  • Setup ssh access to the pi
  • Connect the pi to your wireless network

Setting up ssh access and configuring the wireless is outside of the scope of this guide. I've found this guide to be helpful for that.

USB Webcam

A USB webcam is used for this project. Any USB camera should do, I'm using a Logitech C920 Webcam.

Device Setup

Install dependencies

ssh [email protected]

# usb camera support and motion
sudo apt-get update -y && sudo apt-get install -y fswebcam motion

Test the camera with fswebcam

fswebcam image.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Adjusting resolution from 384x288 to 352x288.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to 'image.jpg'.

Now we know our webcam is at /dev/video0. If you look at image.jpg you'll see the picture it took.

Configure motion

Motion is used to monitor the camera.

Edit the following settings in the motion configuration file at /etc/motion/motion.conf

# Make sure the proper camera device is set
videodevice /dev/video0

# Tell motion to run as a background service
daemon on

Edit /etc/default/motion and set start_motion_daemon=yes

start_motion_daemon=yes

And restart the system

reboot

Once it comes back up open another ssh connection.

Confirm motion is running

systemctl status motion

At this point motion is running as a background service and will be automatically started after a reboot. The next section will guide you through uploading the images to AWS S3 and notifying a Slack channel.

S3 Setup

  1. Create an S3 bucket, noting the name and region
  2. Create an IAM user, noting the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  3. Create and attach an IAM policy to the user, allowing them to upload to the S3 bucket
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "securitycamera",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:PutObjectAcl"
            ],
            "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
        }
    ]
}

Slack Setup

  1. Create a Slack incoming webhook
  2. Note the Webhook URL, e.g. https://hooks.slack.com/services/xxx/yyy/zzzzz

Uploading images

When motion is detected a new image is created and the on_picture_save script is invoked. This calls the uploader which uploads the image to S3. Download the latest release of the uploader and save it in ./root/usr/local/bin/uploader.

Or, build from source if you have Go 1.13 or later:

make build

Next, upload both programs to the pi

scp ./root/usr/local/bin/* [email protected]:/tmp/

SSH to the pi to complete configuration

ssh [email protected]

# Copy the scripts into the PATH
sudo mv /tmp/{uploader,on_picture_save} /usr/local/bin/

Edit /usr/local/bin/on_picture_save and add your AWS and Slack secrets:

# /usr/local/bin/on_picture_save

SLACK_WEBHOOK_URL=https://hooks.slack.com/services/your/slack/webhook
S3_BUCKET_NAME=my-bucket-name
S3_BUCKET_REGION=us-west-2
AWS_ACCESS_KEY=xxx
AWS_SECRET_KEY=xxxxx

Open the motion config again and configure it to call the on_picture_save script everytime it creates an image.

# /etc/motion/motion.conf
on_picture_save /usr/local/bin/on_picture_save %f

Restart motion

systemctl restart motion

You should be good to go. Check out the motion detection settings in /etc/motion/motion.conf for customizing thresholds, etc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].