Skip to main content

Surveillance system based on Raspberry Pi.

Pisurvl is a surveillance solution with motion detection and alert notifications. This repository contains the server part of the solution. It is implemented in Python and it uses OpenCV to access the camera of the Raspberry Pi. Despite being implemented on top of a Raspberry Pi, the solution should work on any system having a camera that is supported by OpenCV.

Installation

Installing OpenCV

Currently there is no easy way to install OpenCV 3 on Linux. The following commands install all the necessary dependencies to build OpenCV 3:

sudo apt install build-essential cmake git pkg-config
sudo apt install libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt install libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
sudo apt install libatlas-base-dev gfortran liblapacke-dev
sudo apt install python3 python3-dev python3-setuptools
sudo easy_install3 pip

The following command installs the latest version of Numpy. The installation may take a while to complete.

sudo pip3 install numpy

The following commands download and compile OpenCV 3:

mkdir build-opencv && cd build-opencv
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib && git checkout 3.2.0 && cd ..
cd opencv && git checkout 3.2.0
mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=Release \
  -D CMAKE_INSTALL_PREFIX=/usr/local \
  -D OPENCV_EXTRA_MODULES_PATH=`pwd`/../../opencv_contrib/modules \
  ..
make -j4

Then install OpenCV:

sudo make install

Installing PiSurvl

sudo pip3 install --upgrade pisurvl
git clone https://github.com/betabandido/pisurvl.git
sudo cp pisurvl/init/pisurvl.service /etc/systemd/system
sudo systemctl enable pisurvl.service

Configuring PiSurvl

Create a settings file based on the provided template:

mkdir -p ~/.pisurvl
cp pisurvl/template-settings.yaml ~/.pisurvl/settings.yaml

Fill in the fields from and to in the notifications section.

Use Google API Manager to generate some client credentials and download the client_secrets.json file. Then move the file into the PiSurvl configuration folder:

mv client_secrets.json ~/.pisurvl

Execute pisurvl-server to authorize PiSurvl to access Google Drive.

Running PiSurvl

Use systemctl to start the service:

sudo systemctl start pisurvl.service

Development

To upload a new release to PyPI follow the next steps:

  1. Bump version in setup.py

  2. Run python3 setup.py sdist upload

Metadata

Release files for pisurvl 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pisurvl 0.0.8
File Size Uploaded Provenance
pisurvl-0.0.8.tar.gz 12.8 kB Without provenance Details

Release files / pisurvl-0.0.8.tar.gz

Download URL pisurvl-0.0.8.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7310e206d443d5ff2a5bb0436889e80d5e8ce79c8787930b8e2683df6a47c510
BLAKE2b-256 checksum
How to use checksums
99f69c0af0fa5f2b5e3619eac72563f33f6547b39415780336075f522b061ea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pisurvl 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page