Skip to content
lytexdevPublic

About

📸 Pi-Guard: Security System with notifications via App & more 📸

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

106 Commits

Folders and files

Repository files navigation

pi-guard

Home monitoring for a Raspberry Pi and a USB camera, operated through a web dashboard, apps for your phone and computer, or Telegram, Signal and Discord. It records continuously to local storage, notices movement, and lets you look at your home with two buttons: View photo and View video.

Deutsche Version

Topology: phones reach the Raspberry Pi through WireGuard; the Pi runs Pi-hole, WireGuard, Mosquitto, recording, the dashboard and add-ons, and connects cameras, the home network and smart home devices.

What it does

  • Records 24/7 to five-minute MP4 segments, using the camera's own H.264 or the Pi's hardware encoder. Old footage is deleted after a retention period, or earlier when the disk fills up: oldest footage without motion first, so there is always room for new recordings.
  • Detects motion on small low-resolution frames, with zones, schedules and filters for light switches and sensor noise.
  • HOME and AWAY modes. At home, movement is logged but nobody is woken up. Away, alerts arrive with a snapshot. The mode can be set by button, command, timer, or automatically from your phone's presence in the Wi-Fi.
  • Telegram first. Large buttons, German and English, a simple view for everyday users and an advanced view for administrators. Commands work as plain text (foto, video 30, abwesend 2h) and as ordinary sentences ("Kannst du mir ein Foto schicken?", "Ich bin wieder da").
  • Better pictures on request. Sharper picks the least blurred of several pictures and enlarges the area around a person; Zoom in and Brighter work on the last photo or alert.
  • Trusted people (optional). Enroll family members with a name and photos, videos or a picture taken by the camera — or straight from an alert about an unknown person. A bar shows how well each person is learned and which pictures are missing. Unknown people are reported with a photo.
  • Alarm. Sound the alarm (or your own uploaded sound) on a speaker, and stop it, from the chat.
  • Emergency contacts. If alerts stay unconfirmed, backup contacts get a summary with photos.
  • Web dashboard. Live picture and sound, talk through the speaker, image tools, trusted people, device selection, settings, statistics and logs; installable as an app with push notifications; login by password or key file with optional two-factor codes, hardware keys, several users (admins and viewers) and your own colours, font and logo. Also a weekly plan, a security scan, storage clean-up and Wi-Fi QR codes.
  • Network (optional). Pi-hole statistics and presence, devices in the LAN, a WireGuard VPN with your own devices, a safe fixed-IP script.
  • Optional, off by default: Signal (via signal-cli), person detection, recognition of enrolled people, microphone clips, speaker playback, MQTT / Home Assistant.
  • Nothing leaves the device except the messages you ask for. No cloud account, no open ports, no telemetry.

Everything around it

Web dashboard Live picture and sound, people, events, weekly plan with calendars, network, settings in a normal and an expert view. On by default at https://<pi>:8443.
Android app The dashboard with alerts without Google, a VPN like Mullvad's with split tunneling and auto-connect, SOS with camera pictures, finding phones, and an inconspicuous look if you want one.
Desktop app The dashboard in its own window for Linux, Windows and macOS, trusting only your pi-guard's certificate. On Linux also a VPN with kill switch, lockdown, split tunneling and a quantum-resistant tunnel.
Home servers A small Rust agent connects a PC or NAS: status, safe shutdown, Docker.
Add-ons Service watcher, network analysis, smart home, remote commands, AI assistant with its costs, more languages, and alerts into Slack, Matrix, Rocket.Chat and Mastodon. Each can be switched off or removed with its data.
Plugins Your own add-ons with commands, pages and API routes, from a ZIP or a Git link, checked before they run. See plugins.
Ways home IPv4, IPv6, a rented server or Tailscale, for every kind of internet connection. See network.
Updates Agents and apps update themselves with signed releases, which a compromised Pi cannot fake. The Pi installs only signed releases too, so a hacked GitHub account cannot reach it. See updates.

Getting the apps

System Package
Arch Linux .pacman, or scripts/install-desktop.sh with automatic updates
Debian, Ubuntu, Linux Mint .deb
Fedora, openSUSE .rpm
Other Linux .AppImage, Flatpak
Windows .exe installer
macOS .zip
Android .apk from the dashboard under Add-ons › Phone app

Build them with scripts/build-desktop.sh and scripts/build-android.sh, see desktop app.

Requirements

  • Raspberry Pi 4 (2 GB is enough) or Pi 5 with Raspberry Pi OS Lite 64-bit (Bookworm or newer); other Debian/Ubuntu ARM64 or x86_64 machines work too
  • a USB (UVC) camera; a High Endurance microSD card or a USB SSD
  • a Telegram account

See docs/hardware.md for tested and expected hardware.

Installation

git clone https://github.com/lytexdev/pi-guard.git
cd pi-guard
sudo ./scripts/install.sh

The installer asks for the Telegram bot token and your Telegram user ID, creates a pi-guard system user, writes /etc/pi-guard/pi-guard.env and a config.yaml for the detected camera, installs a systemd service, and runs pi-guard doctor. Details: docs/installation.md.

Docker Compose is available as an alternative: docs/docker.md.

Everyday use

Open the bot in Telegram and press Start:

pi-guard

Your camera is working.

Recording is switched on.

What would you like to do?

[ View photo ]
[ View video ]
[ Camera status ]
[ Notifications ]
[ Help ]

Administrators also see More functions (mode, events, users, invitations, sounds). Add family members with Invite someone; they receive a link and join as viewers. Command reference: docs/telegram.md.

Command line

pi-guard doctor             check camera, encoder, storage, Telegram, Signal
pi-guard status             service state, mode, recordings, recent events
pi-guard cameras            detected cameras and a config snippet
pi-guard mode away --for 3h
pi-guard presence status    one presence check, per source
pi-guard audio devices
pi-guard telegram test --send
pi-guard logs -f

Documentation

Installation native install, update, uninstall
Configuration .env and config.yaml reference
Telegram bot setup, users, commands and aliases
Signal optional, unofficial; signal-cli setup
Privacy what is stored, what leaves the device, legal notes
Hardware cameras, audio, storage
Docker optional container deployment
Dashboard web dashboard, certificates, app and push
Discord commands and alerts through a Discord bot
Email alerts and exports by email
Mobile app Android app with VPN, alerts, finding phones and SOS
Desktop app The dashboard as an app for Windows, Linux and macOS
Updates How agents and apps update themselves, signed and verified
VPN Kill switch, lockdown, split tunneling, quantum-resistant tunnel
Network Pi-hole, WireGuard, fixed address
Add-ons Service watcher, network analysis, smart home, remote commands, AI assistant
WhatsApp Official Cloud API setup and its limits
Public access Domain, reverse proxy and safe login
Plugins Write your own add-ons
API Tokens and endpoints for your own scripts
Home servers Connect PCs and NAS: status, safe shutdown, Docker
Architecture how the parts fit together
Performance measurements and limits
Troubleshooting common problems

German: Installation · Bedienung · Dashboard · Netzwerk · Datenschutz

Privacy

A camera in a home records people who did not choose to be recorded: visitors, carers, neighbours, children. Read docs/privacy.md before installing. Audio recording and face recognition are switched off by default and need deliberate configuration.

License

Licensed under the MIT LICENSE.

The software is provided "AS IS", without warranty of any kind, to the maximum extent permitted by applicable law.

Support

pi-guard is free. If you want to support it, donations are welcome and entirely optional.

Monero (XMR) 89udnKEYMZCBCaoaTYwSLuJBnQRMVPWxW4kNanra4d4GCdgKN5UNjHKU9zk77jvrU726YQYQqeM2PAUhR8jTMrYU6d5cLMp
Bitcoin (BTC) 3B8PdpJnmL7rQyHhBytKtvUT7NgQfraBEH
Litecoin (LTC) MShzshtse85i6ZkwiB1VKNGRNmEL5Dc3VX

About

📸 Pi-Guard: Security System with notifications via App & more 📸

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Used by

Contributors

Languages