Home CCTV (Cheapo Edition)
Posted: Sun Sep 27, 2015 10:05 am
The following instructions turn your computer with webcam to a poor man's surveillance system. If you are planning to go on holidays, if you don't trust the neighbors or family members, or if you want to know who cums on your toothbrush while you are at work -- these are all use-cases for you!
CASE 1: Holidays! I am not at home but I want to know who steals my underwear :(
You will be able to log in to dropbox and see the images there.
1) You need a computer -- I use a RasPi -- and a webcam that is actually detected by the device. Usually, most of them will work well.
2) Install 'cron' 'fswebcam' and 'curl' from the repos:
3) Get yourself a Dropbox account on which the images will be uploaded: http://www.dropbox.com
4) Fetch the dropbox_uploader.sh script, make it executable (chmod a+x dropbox_uploader.sh), and if wished, move it to /usr/local/bin/dropbox_uploader.sh
5) Run dropbox_uploader.sh and follow the instructions. It's easy.
6) Create a directory named ~/webcam
7) Create /usr/local/bin/snap with following content and make it executable (chmod a+x /usr/local/bin/snap)
8) Add a new crontab entry:
at the bottom, add
for a snapshot every minute. If you want a snapshot every 5 minutes, use
You don't need to worry about filling up your hard disc with stills: dropbox_uploader.sh moves the files to the server so your drive stays clean. Of course you should clean up the images folder in dropbox every now and then (for me, one image a minute produced around 6Mb of data per hour, YMMV -- you can resize fswebcam's output and also reduce the size by compressing jpg to 70% or so -- have a try first!)
CASE 2: I just want to spy on my loved ones :P
1) You need a computer -- I use a RasPi -- and a webcam that is actually detected by the device. Usually, most of them will work well.
2) Install 'cron' and 'fswebcam' from the repos:
3) Create a directory named ~/webcam
4) Create /usr/local/bin/snap with following content and make it executable (chmod a+x /usr/local/bin/snap)
5) Add a new crontab entry:
at the bottom, add
for a snapshot every minute. If you want a snapshot every 5 minutes, use
CASE 1: Holidays! I am not at home but I want to know who steals my underwear :(
You will be able to log in to dropbox and see the images there.
1) You need a computer -- I use a RasPi -- and a webcam that is actually detected by the device. Usually, most of them will work well.
2) Install 'cron' 'fswebcam' and 'curl' from the repos:
Code: Select all
sudo apt-get install cron fswebcam curl
4) Fetch the dropbox_uploader.sh script, make it executable (chmod a+x dropbox_uploader.sh), and if wished, move it to /usr/local/bin/dropbox_uploader.sh
Code: Select all
curl "https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o dropbox_uploader.sh
6) Create a directory named ~/webcam
Code: Select all
mkdir ~/webcam
Code: Select all
#!/bin/bash
IMGPATH=~/webcam/
IMGNAME="$(date +\%Y\%m\%d\%H\%M).jpg"
FULLPATH=$IMGPATH$IMGNAME
fswebcam $FULLPATH
/usr/local/bin/dropbox_uploader.sh upload $FULLPATH $IMGNAME
Code: Select all
crontab -e
Code: Select all
* * * * * /usr/local/bin/snap
Code: Select all
*/5 * * * * /usr/local/bin/snap
CASE 2: I just want to spy on my loved ones :P
1) You need a computer -- I use a RasPi -- and a webcam that is actually detected by the device. Usually, most of them will work well.
2) Install 'cron' and 'fswebcam' from the repos:
Code: Select all
sudo apt-get install cron fswebcam
Code: Select all
mkdir ~/webcam
Code: Select all
#!/bin/bash
IMGPATH=~/webcam/
IMGNAME="$(date +\%Y\%m\%d\%H\%M).jpg"
FULLPATH=$IMGPATH$IMGNAME
fswebcam $FULLPATH
Code: Select all
crontab -e
Code: Select all
* * * * * /usr/local/bin/snap
Code: Select all
*/5 * * * * /usr/local/bin/snap