Skip to content

Introduction

Philip Wölfel edited this page Feb 15, 2016 · 25 revisions

This introduction should give an overview of the overall SecPi project structure and how all the components work together.

Architecture

The SecPi software has 3 components:

  1. Webinterface/WebUI
  2. Manager
  3. Worker

The worker as the name suggest is the component which does all the hard work e.g. listening on sensor input or taking pictures with its webcam. Workers can work with sensors and actions and are uniquely identified by their Pi ID. Because SecPi was designed to work with multiple Pis it is possible to have workers running on different Pis. Workers will communicate with the manager over the network.

The manager is the central component which handles all the workers (e.g. generating configurations, telling the workers when to perform a certain action, etc.), collects all the data generated by the workers during an alarm and notifies the owner if something happened.

The webinterface/webui is a versatile interface where the user can configure his/her setups, look at the alarm history and view data (e.g. pictures) which was generated during an alarm.


Figure 1 - Architecture of SecPi

In figure 1 we can see a SecPi setup where the focus lies on the architectural point of view. The manager is the central component where all the communication flows to. When the configuration changes (via Webinterface) the manager will generate a new configuration for every worker and send it to them. When an alarm occurs the worker will send a message to the manager who will then tell all the workers to perform their actions. After the workers performed their actions the generated data will be transferred to the manager.

Sensors, Actions & Notifiers

Sensors, actions and notifiers are modules you can add to your SecPi setup. SecPi already comes with some modules but it's easy to create your own modules and add them to your setup.

  • Sensors are modules which are used to check if a certain area is safe, e.g. you can use a passive infrared motion sensor (PIR) to detect if someone is breaking into your front door. A sensor raises an alarm if it detects something suspicious. Sensors are bound to workers.
  • Actions are executed after an alarm was raised by a worker. The purposes of actions are to frighten away burglars, alerting the owner (or people who live close by) and to generate evidence data. Examples for actions are webcams (taking pictures for evidence) and buzzers/sirens which generate noise. Actions are bound to workers too.
  • Notifiers are executed after an alarm was raised and all the actions did their job in order to inform the owner that an alarm has happened. Some notifiers can use the data which was generated by the actions and attach them to their message. E.g. the mail notification will attach the pictures which were taken by the webcam when it sends an email. Notifiers are bound to the manager.

Setups, Zones & Sensors

In order to make SecPi manageable we introduced a flexible structure which should fulfill most configuration needs. The terms Zone and Setup will be explained with the example map which can be seen in figure 2. The figure shows a map which includes three Raspberry Pis (Pi1-3) with sensors and actions. The blue sensors are PIR motion sensors which will trigger when someone tries to break into the front door or through the terrace. The red sensor measures the temperature and will trigger if temperature goes out of the specified range (e.g. something starts to burn). Additionally we have a buzzer (audio symbol) which makes noise and a webcam (cam symbol) which takes pictures when an alarm is raised.


Figure 2 - Example map

A zone is an area which contains a certain amounts of sensors. A sensor can only be part of one zone. In the example given above we could define two zones: 1-Hallway&Kitchen and 2-Livingroom. Zone 1 would include the PIR motion sensor at the front door and the temperature sensor from the kitchen. Zone 2 would include the PIR motion sensor close to the terrace door. As we can see in this example a zone is solely based on its sensors and can span around multiple Pis/workers.
A setup consists of one or multiple zones which should be monitored. In our scenario we could make a setup called "Nobody is home" which includes both existing zones 1 and 2. Additionally we want to have a setup during the nighttime but we don't want the PIR motion sensor in the living/bedroom to be active because we might run into it when we have to go to the toilet. In this case we create a setup called "Night" where we only add the first zone.
When activating or deactivating SecPi we only have to choose the setup which we want to be monitored.

Note: Actions and Notifiers are globally active or inactive, they are not associated with zones or setups.

Next Step: Installation