This is some simple code and some of scripts for making a motion detection camera capture system using the raspberry pi, a pir sensor and a camera.
- install nodejs and forever or pm2
- currently known to work with node 12.x or later
- for node 12.x you must start node with
--experimental-modules
- for node 12.x you must start node with
- currently known to work with node 12.x or later
- install ffmpeg for avconv
- clone this repo
- create a config.json for the mail (see the other readme for config.json)
- if you are like me, you'll want a read only filesystem to save your sd card in case of power outage or just to reduce wear, so clone my pi-ro-mount repo and that should help. You'll need unionfs-fuse
NOTE: This code was originally taken from pi_videoEMailIntruder. The email code was cleaned up and made into a module.
I have also found some services (like avahi-daemon) need to be stopped so service --status-all will show whats running
- openssl req -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr == pass in you info for -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=examplebrooklyn.com"
- this has dependencies on ffmpeg and gstreamer plugins
- on raspian you need to sudo apt-get install git nodejs npm gstreamer1.0-plugins-base-apps ffmpeg
- it save to /tmp so setting up tmpfs for /tmp can save disk writes during image capture tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,noexec,mode=1777,size=64M 0 0