{"id":22093429,"url":"https://github.com/cgsmith/camera-pi","last_synced_at":"2025-08-23T17:40:54.488Z","repository":{"id":265572442,"uuid":"820830868","full_name":"cgsmith/camera-pi","owner":"cgsmith","description":"Monitor a security system to see if it is in an alarm, armed, or disarmed state and make the appropriate API calls to the camera system to enable or disable certain privacy masks.","archived":false,"fork":false,"pushed_at":"2025-02-04T08:00:43.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T21:55:53.858Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/cgsmith.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":"security-camera-privacy-mask.service","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-27T09:06:14.000Z","updated_at":"2025-02-04T08:00:47.000Z","dependencies_parsed_at":"2024-11-30T00:31:26.324Z","dependency_job_id":"8141f240-ea2f-4590-83e6-5bce4050b2b8","html_url":"https://github.com/cgsmith/camera-pi","commit_stats":null,"previous_names":["cgsmith/camera-pi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fcamera-pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fcamera-pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fcamera-pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgsmith%2Fcamera-pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgsmith","download_url":"https://codeload.github.com/cgsmith/camera-pi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245189543,"owners_count":20574990,"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":[],"created_at":"2024-12-01T03:14:38.579Z","updated_at":"2025-03-24T00:28:07.184Z","avatar_url":"https://github.com/cgsmith.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Camera Pi\n\nThis repository allows for privacy masks to be enabled and disabled. It is intended to be connected to a security \nsystem or some system that can provide an \"armed\" state and an \"alarm\" state.\n\nSee the [changelog](CHANGELOG.md) if you want to see the differences between versions. Production currently just follows\n`master`. It should be switched to tagging when stable.\n\n## security-system-check.py Flowchart\n\n![img.png](img.png)\n\n\n## Environment Setup and Pi Setup\n\nWith a Raspberry Pi and a base OS perform the following steps to deploy the code. You should be able to use any \nRaspberry Pi. In the next steps you will clone the git repository, setup your Python virtual environment, \ndownload the required packages from PyPi, and then install the service. This assumes you are currently in the \nuser's home directory and with a subfolder of `security-camera-privacy-mask`\n\n1. `git clone git@bitbucket.org:mount7freiburg/security-camera-privacy-mask.git`\n2. `cd security-camera-privacy-mask`\n3. `python -m venv .venv`\n4. `source .venv/bin/activate`\n5. `.venv/bin/pip install -r requirements.txt`\n6. `cp .env.example .env`\n7. `cp cameras.json.example cameras.json`\n8. Make appropriate changes to `.env` file\n9. Make appropriate changes to `cameras.json` file\n10. Connect wires to GPIO 16 and GPIO 20 for the Raspberry Pi\n11. Configure `crontab` to run `deploy.sh` (optional)\n    1. This will perform a `git pull` and restart the service\n\n\u003e [!NOTE]\n\u003e When done with the virtual environment you can type `deactivate` in the terminal.\n\n## Service Setup\n\n1. `cp security-camera-privacy-mask.service /etc/systemd/system/camerapi.service`\n2. `sudo systemctl daemon-reload`\n3. `sudo systemctl enable camerapi.service`\n\n## Understanding the env vars and cameras.json file\n\nI am using `smtplib` and Gmail for sending emails. You can use any service you want. If you use\na different service you will need to probably configure a different client or SMTP service.\n\n\u003e [!IMPORTANT]  \n\u003e In Dahua cameras the password has a maximum of 32 characters even though the form lets you input more. Keep the .env\n\u003e at 32 characters if your password is longer and it should work\n\n\nThe `.env` file also contains `LOGFILE_PATH` should be the full path to your log file. `LOG_DEBUG` can be any integer\nthat is typically used for Python logging levels (0, 10, 20, 30... etc). `CAMERA_USERNAME` and `CAMERA_PASSWORD` needs\nto be a user that is allowed to make configuration changes. The camera API calls are programmed to call Dahua cameras.\nThis should also work with Dahua whitelabeled cameras.\n\nThe `cameras.json` file contains **channel**, **type**, and **ip**. Only **ip** and **type** are required. The **type**\nfield can either be `exterior` or `interior`. Channel doesn't do anything but can be used as a reference for you.\n\n## Testing\n\nFor testing locally, the program will run a MockGPIO library. This reads `simulated_pins.json` where you can trigger\nthe PIN input which monitors the burglar alarm system. `SYSTEM_ARMED_PIN` is PIN 16 and `SYSTEM_ALARM_PIN` is PIN 20.\n\nYou will need to be on the 192.168.0.x subnet in order to reach the cameras since they are /32 for their subnet.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgsmith%2Fcamera-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgsmith%2Fcamera-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgsmith%2Fcamera-pi/lists"}