Skip to content
/ raspguard Public

A tiny DIY home video security tool for Raspberry Pi. Written in Python using OpenCV and Telegram API (for notifications).

Notifications You must be signed in to change notification settings

aogz/raspguard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RaspGuard

A tiny DIY home video security tool for Raspberry Pi. Written in Python using OpenCV and Telegram API (for notifications).

About RaspGuard

It is quite dark near my apartment entrance door, so in addition to a motion light sensor I have written this small script which tracks any motion when light turns on and sends me a GIF animation in a private telegram group. See raspguard/settings.py to configure telegram.

Installation and setup

1. Clone the raspguard repo

git clone [email protected]:aogz/raspguard.git

2. Install requirements

cd raspguard
mkvirtualenv -p python3 raspguard  # Or virtualenv -p python3 venv && source venv/bin/activate
pip install -r requirements.txt

Install OpenCV on Raspberry Pi

3. Create bot and channel and make bot admin

How to create a bot and How to create a channel

4. Then make your bot channel administrator

  1. Open Channel info (in app title)
  2. Choose Administrators
  3. Add Administrator
  4. There will be no bots in contact list, so you need to search for it. Enter your bot's username
  5. Clicking on it you make it as administrator.

5. Set bot api key and channel in settings

Lifehack: If you want to use a private channel, use one of these solutions:

How to obtain the chat id of a private telegram channel

6. Play with settings.SENSITIVITY and settings.MIN_CONTOUR to get better results

7. Connect a camera to your awesome Raspberry Pi

Run it

python start.py

Run it in background on reboot

crontab -e 

Add this at the end of the file:

@reboot python3 /home/pi/raspguard/start.py  # replace with your own path

About

A tiny DIY home video security tool for Raspberry Pi. Written in Python using OpenCV and Telegram API (for notifications).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published