Thursday, June 13, 2013

Cheezy Pi Based Home-Security System

1) $5 web cam from Frys + $15 (Patriot) Wirelsss USB adapter (8188CU)
2) wlan0 should work right away. Ensure you have the right hookup in your /etc/network/interfaces based on your WiFi setup - most of the online examples say WPA - but, it might well be ESSID - WEP.
3) Install fswebcam if it's not there already. I'm on Wheezy, don't remember
4) Test the camera using fswebcam - you should easily be able to dump to a file.jpg

5) Insert (crontab -e) a cron job to reboot every N hours based on your experience with the wlan0 - mine quit after a few hours. This will be a root crontab entry - > sudo crontab -e ... and then "0 0-23/2 * * * /sbin/reboot"
6) Insert a pi-user cron task to take the picture every so often (say once a minute) "* * * * * fswebcam "
7) In your router (192.168.1.1) forward port 22 (SSH) the IP address of your Pi's wlan0 port (which you can get using ifconfig -a). You can do HTTP also - just be warned you're wasting time trying to look at stuff through HTTP outside your router firewall.
8) Get your IP address (what the world knows you by, just enter "what's my IP address" in the Google search field.
9) Sign up with a free DNS host - like freedns.afraid.org, use this IP address you just found.

And you're done - on your smartphone, you can use ftpCafe. It's not as slick a UI as ES File Explorer, but it WORKS! And ES File Explorer just pouts!

Yes, that's cheezy - you have to browse to the folder each time and load the image, but, hey - you've got your eye on your place till something better comes along!

Next : use carriots to send an alert to your phone when the Pi detects that 2 pictures taken within a minute differ significantly!! You don't want to miss that one. Even Donald Trump's hair is on end. He calls it end of life testing.

No comments:

Post a Comment