{"id":13432899,"url":"https://github.com/Lallassu/rpicam","last_synced_at":"2025-03-17T10:32:50.579Z","repository":{"id":91940475,"uuid":"101303857","full_name":"Lallassu/rpicam","owner":"Lallassu","description":"Raspberry PI Surveillance Automation","archived":false,"fork":false,"pushed_at":"2017-10-02T06:25:40.000Z","size":423,"stargazers_count":79,"open_issues_count":0,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-07T23:31:50.904Z","etag":null,"topics":["ansible","camera","motion","motion-detection","raspberry-pi","surveillance"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lallassu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-08-24T14:26:39.000Z","updated_at":"2024-08-24T17:32:59.000Z","dependencies_parsed_at":"2024-01-16T01:26:05.893Z","dependency_job_id":"8aac31fc-7d31-4278-bde4-3cd68021cabe","html_url":"https://github.com/Lallassu/rpicam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lallassu%2Frpicam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lallassu%2Frpicam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lallassu%2Frpicam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lallassu%2Frpicam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lallassu","download_url":"https://codeload.github.com/Lallassu/rpicam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244016872,"owners_count":20384225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","camera","motion","motion-detection","raspberry-pi","surveillance"],"created_at":"2024-07-31T02:01:18.278Z","updated_at":"2025-03-17T10:32:50.238Z","avatar_url":"https://github.com/Lallassu.png","language":"Shell","readme":"# Automated Raspberry PI Camera Surveillance Setup\n![cam](https://github.com/Lallassu/rpicam/blob/master/camera.jpg)\n*The picture above is my setup with an RPI 3 with camera and nightvision added. It's in a (relativly) water proof box\nand has a small fan to circulate the air inside the box to lower the temperature about 10 degrees celcius.*\n\n## About\nThis is a Ansible scripted automated setup of an Raspberry PI with an attached camera.\n\nAfter running the script the raspberry will have the surveillance software \"motion\" running\nwith cronjobs and scripts setup to make it run after reboot. It will record files as avi and save\nto the tmpfs mounted directory /home/pi/Dropbox/\u003crpi_hostname\u003e.\n\nThe reason for saving recordings to a tmpfs filesystem is that the memory card will otherwise be\ntrashed after a while with too many read/writes.\n\nThe dropbox_uploader script is used to upload the files to Dropbox since there is currently no\nDropbox client for ARM. Hence, an Dropbox app is required that will receive the files. It will end up\nin a path such as \"Dropbox/Apps/\u003capp_name\u003e/\u003chostname\u003e\".\n\nThere will also be a cronjob installed that removes recordings after 7 days from the raspberry.\n\nWhen an alarm is triggered an email will be sent (in this case using gmail through postfix) with an\nsnapshot from the recorded movie to the specified email address including recorded timestamp and \nfrom which host.\n\n### Alarm Email Example\n**Subject:** rpi_cam2: Motion detection\u003cbr\u003e\n**ALERT:** Motion detection(2017-08-24 07:56:08), CAMERA: rpi_cam2\u003cbr\u003e\n![Image Preview](https://github.com/lallassu/rpicam/blob/master/example.png)\n\n## Prerequisites\n* Raspberry PI (v3 tested) with an camera attached to the camera slot.\n* Host with ansible 1.2+ installed.\n* Raspian installed on the memory card.\n    * Download raspian lite image.\n       https://downloads.raspberrypi.org/raspbian_lite_latest\n    * Format the memory card with FAT32 filesystem.\n    * Write the image to the card (see below)\n* To make Dropbox upload work, create an application in Dropbox.\n* Enable SSH on the raspberry (raspi-config -\u003e interface -\u003e enable ssh)\n* Enable Camera on the raspberry (raspi-config -\u003e interface -\u003e enable Camera)\n* Copy SSH key to the raspberry (default password is \"raspberry\" in the raspian image, please do change!) (see below)\n* TP-cable to connect raspberry with first time (before wifi is setup through the ansible script)\n\n### Commands\n    # Write raspian image to disk\n    $ sudo dd bs=1m if=\u003cunzipped_image\u003e.img of=/dev/\u003csd_card_disk\u003e conv=sync\n    # Copy ssh key\n    $ ssh-copy-id pi@\u003cip\u003e\n    # Enable camera and ssh\n    $ sudo raspi-config\n\n## Configure\nConfigure all settings in *configure_me.yml*. This is the main configuration file for settings such as\nemail, dropbox upload etc.\n\nHosts are configured one per line in *hosts* file. Only thing to specify here is IP and preferred hostname.\n\n## Usage\n    ansible-playbook playbook.yml\n\nThe script will finish by rebooting the raspberry. The motion software will be running inside a\nscreen and you can watch the process with 'screen -r motion' logged in as user 'pi'.\n\nYou will also be able to live view the camera using the credentials you configured in *configure_me.yml*.\n\n    http://\u003cip\u003e:8080/\n\n## NOTE\nThis has only been tested on Raspberry PI 3. Should be working with at least v2 as well (otherwise adjust RAM for tmpfs).\n","funding_links":[],"categories":["Shell","raspberry-pi"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLallassu%2Frpicam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLallassu%2Frpicam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLallassu%2Frpicam/lists"}