This file contains description about this project.
---
## What?
This project utilizes Raspberry Pi with Pi Camera to detect motion in real-time. When motion is detected, the system sends a notification to a specified topic on an ntfy.sh server. The setup involves several components, including a camera interface, Docker setup for ntfy.sh and WireGuard VPN, and a Python script for motion detection.
---
## Features
- **Local Camera Feed Processing**: The entire camera feed is scanned and processed locally on the device. No third-party services are involved, ensuring privacy and security are preserved.
- **Docker-Based Isolation**: The notification system and encrypted tunnel (via WireGuard) are containerized using Docker, providing better isolation, security, and ease of deployment.
- **Enhanced Security with UFW Firewall**: The entire setup is secured using UFW (Uncomplicated Firewall), ensuring that only necessary services are accessible and protecting the system from unauthorized access.
## Structure
1.`setup.sh`: A shell script to install dependencies and set up the environment.
2.`docker-setup.sh`: A shell script that installs Docker and its dependencies.
3.`docker-compose.yaml`: Docker Compose configuration to run ntfy.sh and WireGuard VPN in containers.
4.`main.py`: The Python script that captures camera frames, detects motion, and sends notifications.
---
### setup.sh
- Install `python3`, `pip`, and necessary libraries.
- Install camera libraries such as `picamera2`, `opencv`, and image processing libraries.
> You can customize the topic name in the `main.py` file by modifying the `ntfy_topic` variable. If you are using the local Docker instance for `ntfy.sh`, the script will use `localhost:80` by default. You can change that too by modifying the `rpi_ip` variable.
- **Motion Detection Sensitivity**: The motion detection sensitivity can be adjusted by modifying the area threshold in the `cv2.contourArea(contour)` condition in `main.py`. Decrease the threshold to detect smaller movements or increase it to filter out smaller motion.
- **ntfy.sh Topic**: The topic for notifications is defined in `main.py` as `ntfy_topic`. You can change this to any unique topic name you want to receive notifications under.