Main Content

Automated Raspberry PI Camera Surveillance Setup

This is a Ansible scripted automated setup of an Raspberry PI with an attached camera.

After running the script the raspberry will have the surveillance software “motion” running with cronjobs and scripts setup to make it run after reboot. It will record files as avi and save to the tmpfs mounted directory /home/pi/Dropbox/rpi_hostname.

The reason for saving recordings to a tmpfs filesystem is that the memory card will otherwise be trashed after a while with too many read/writes.

The dropbox_uploader script is used to upload the files to Dropbox since there is currently no Dropbox client for ARM. Hence, an Dropbox app is required that will receive the files. It will end up in a path such as “Dropbox/Apps/app_name/”.

There will also be a cronjob installed that removes recordings after 7 days from the raspberry.

When an alarm is triggered an email will be sent (in this case using gmail through postfix) with an snapshot from the recorded movie to the specified email address including recorded timestamp and from which host.”

Link to article