So I have a simple system going without any extra camera software that just grabs some stills and emails them in response to a trigger. I don't get video recordings of past events, but I do get a picture of the UPS man.
Basically a sensor (motion or driveway) triggers an embedded applescript to run a shell script:
- Code: Select all
do shell script "/Users/tadg/Documents/senddrivephotos"
and the senddrivephotos script grabs 2 photos 3 seconds apart and emails them out:
- Code: Select all
#!/bin/sh
DATE=`date`
(
cat <<!
From: house@gallistel.net
Subject: Driveway Sensor tripped
To: tadg@gallistel.net
!
cat <<!
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="DMW.Boundary.605592468"
This is a Mime message, which your mail program may not understand. Parts
of the message will appear as text. If the remainder appears as random
characters in the message body, instead of as attachments, then you'll
have to extract these parts and decode them manually.
--DMW.Boundary.605592468
Content-Type: text/plain; name="message.txt"; charset=US-ASCII
Content-Disposition: inline; filename="message.txt"
Content-Transfer-Encoding: 7bit
!
echo "This is the driveway camera at $DATE"
echo
echo --DMW.Boundary.605592468
echo Content-Type: application/octet-stream\; name=\"Photo1.jpg\"
echo Content-Disposition: attachment\; filename=\"Photo1.jpg\"
echo Content-Transfer-Encoding: base64
echo
curl -s http://192.168.253.99/usr/yoics1.jpg | perl -e 'use MIME::Base64 qw(encode_base64);local($/) = undef;print encode_base64(<STDIN>);'
sleep 3
echo
echo --DMW.Boundary.605592468
echo Content-Type: application/octet-stream\; name=\"Photo2.jpg\"
echo Content-Disposition: attachment\; filename=\"Photo2.jpg\"
echo Content-Transfer-Encoding: base64
echo
curl -s http://192.168.253.99/usr/yoics1.jpg | perl -e 'use MIME::Base64 qw(encode_base64);local($/) = undef;print encode_base64(<STDIN>);'
echo --DMW.Boundary.605592468--
) | /usr/sbin/sendmail -t
So you will want to change the email addresses as well as the URLs that curl uses to grab the stills from the cameras. This also requires that OS X can send email from the command line, all the parts are there, you probably need to configure your mail host and username and password in Postfix. This post explains how to set up postfix to relay mail through gmail:
http://www.anujgakhar.com/2011/12/09/using-macosx-lion-command-line-mail-with-gmail-as-smtp/ Here is an additional step for yosemite support:
http://stackoverflow.com/questions/26447316/mac-os-x-10-10-yosemite-postfix-sasl-authentication-failed If you are using a different email host, you'll need to change some stuff, but those posts would be a good start.
My driveway camera is an analog camera connected to a yoics box, which was really cheap about 10 years ago, and has passed its prime, but it does make it easy to grab a jpeg snapshot. I'm about to replace this with the Grandstream analog video to IP box, the 3504, that is reasonably priced.
I have a Grandstream indoor IP camera (GXV3615WP-HD) that I am pretty happy with for $75, it does POE and wireless, so it is pretty versatile, but it does suck in dim light. The url to grab a still from it is:
http://192.168.253.187/snapshot/view0.jpg . It looks like the Grandstream cameras could do the motion detection and emailing all internally as well, but I haven't tested that.
I also have a Panasonic pan-tilt outdoor camera that I am very happy with, but it was $700 so it had better be good. The url to grab a snapshot from it is:
http://192.168.253.98/SnapshotJPEGTad
Edited to add some comments on email.