Merge branch 'develop' into 2.0

This commit is contained in:
Cédric Verstraeten
2017-02-10 14:14:42 +01:00
43 changed files with 597 additions and 103 deletions

View File

@@ -16,22 +16,20 @@ Nowadays we have a myriad of **expensive** camera's, recorders and software solu
<a name="what-is-kerberos-io"></a>
## What's Kerberos.io?
Kerberos.io is a **low-budget** video surveillance solution, that uses computer vision algorithms to detect changes, and that can trigger other devices. Kerberos.io is open source so everyone can customize the source code to its needs and share it with the community under the [**CC-NC-ND license model**](/license). When deployed on the Raspberry Pi, it has a **green footprint** and it's **easy to install**; you only need to transfer the [**Kerberos.io OS (KIOS)**](/installation/KiOS) to your SD card and that's it.
Kerberos.io is a **low-budget** video surveillance solution, that uses computer vision algorithms to detect changes, and that can trigger other devices. Kerberos.io is open source so everyone can customize the source code to its needs and share it with the community under the [**CC-NC-ND license model**](/license). When deployed on the Raspberry Pi or any other board, it has a **green footprint** and it's **easy to install**; you only need to transfer the [**Kerberos.io OS (KIOS)**](/installation/KiOS) to your SD card and that's it.
<iframe src="https://player.vimeo.com/video/163975947?autoplay=0&color=943633" style="width:100%; height: 400px;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<a name="how-does-it-work"></a>
## How does it work?
When installed Kerberos.io on a Raspberry Pi or local working station, two applications are available: the [**machinery**](https://github.com/kerberos-io/machinery) and the [**web**](https://github.com/kerberos-io/web).
When installed Kerberos.io on a Raspberry Pi or any other Linux device, two applications are available: the [**machinery**](https://github.com/kerberos-io/machinery) and the [**web**](https://github.com/kerberos-io/web).
The machinery is responsible for the processing. It's **an image processing framework** which takes images from the type of camera (USB-, IP- or RPi-camera) you've configured in the configuration files and executes one ore more algorithms and post-processes (e.g. save a snapshot). The configuration files allow you to define the type of camera, post-processes, conditions and much more; it's **highly configurable**. It's important to note that the machinery, out-of-the-box, can handle only one camera at a time.
The web is responsible for the visualization. It's a **GUI** which helps the user to find activity at a specific period, configure the machinery, view a live stream, see system information and much more. It's important to note that the machinery can work without the web, however we don't recommend this.
The cloud is an extra service, which is available by default but is not required. The main goal of this service is **to view your activity from everywhere** in the world. By [**subscribing to a plan**](https://cloud.kerberos.io), you can **sync your images** to the cloud application; you can sync **multiple instances** with **only one subscription**.
To have a more detailed explanation go to the [**machinery**](/machinery/introduction) and [**web**](/web/introduction) pages.
The cloud is an extra service, which is available by default but is not required. The main goal of this service is **to view your activity from everywhere** in the world. By [**subscribing to a plan**](https://cloud.kerberos.io), you can sync your images to the cloud application. To have a more detailed explanation go to the [**machinery**](/machinery/introduction) and [**web**](/web/introduction) pages.
![How does it work](1_how_does_it_work.png)
@@ -40,20 +38,17 @@ To have a more detailed explanation go to the [**machinery**](/machinery/introdu
Kerberos.io comes with **a bunch of features**, below you can find a short list of the most important ones.
* Full range camera support (USB-, Raspberry Pi v1.3 and v2.1-, and IP-cameras which support a RTSP or MJPEG stream).
* Full range camera support (**USB**, **Raspberry Pi** v1.3 and v2.1, and **IP cameras** which support a RTSP or MJPEG stream).
* Constraints to make detection more intelligent (time interval, regions, etc).
* Post-processes which are executed after a valid activity (GPIO pin, webhook, etc).
* Live streaming (MJPEG) on the web or with another program like VLC or IP camera viewer.
* Heatmap and latest sequence of activity.
* Fluent and responsive overview of snapshots by day and hour.
* Ability to save snapshots and **video recording** and execute/trigger a bash script, webhooks or GPIO pin.
* **Live streaming** (MJPEG) on the web or with another program like VLC or IP camera viewer.
* **Heatmap** and latest sequence of activity.
* Fluent and **responsive overview** (Smartphone, Tablet and PC) of snapshots by day and hour.
* System information (CPU, disk, network, etc).
* View you activity everywhere with kerberos.io cloud.
* Multiple cameras with Docker or Raspbian.
* ..
Features **NOT** included:
* Video recording (only snapshots are taken); third-party solutions are available (IP camera viewer).
* Use [**Kerberos.cloud**](https://cloud.kerberos.io) to view your activity from anywhere in the world.
* **Multiple cameras** with Docker or Raspbian.
* **REST API** to control Kerberos.io from your custom solution/program.
* **Cross-browser support**: IE, Chrome, Safari, Firefox.
<a name="installation"></a>
## Installation
@@ -64,6 +59,4 @@ Installing <b>Kerberos.io</b> to your IoT device, has never been so easy. By usi
<img src="/images/kios-install.gif" style="border-radius: 0; margin: 0 0 10px 0; width: 100%;"/>
</a>
By using the KiOS installer, you'll get <b>an easy to use GUI</b> which allows you to configure and **flash KiOS to your SD card**. Just download the installer, select a version, specify your network configurations, select your SD card and press the flash button; **it can't be easier**.
If you **don't want to reflash you SD card**, you can run also run Kerberos.io on your [**Raspbian**](/installation/Raspbian) installation, or even run it as a [**docker container**](/installation/Docker).
By using the KiOS installer, you'll get <b>an easy to use GUI</b> which allows you to configure and **flash KiOS to your SD card**. Just download the installer, select a version, specify your network configurations, select your SD card and press the flash button; **it can't be easier**. If you **don't want to reflash you SD card**, you can run Kerberos.io on your existing [**Raspbian**](/installation/Raspbian) or [**Armbian**](/installation/armbian) installation, or if you like containers with [**Docker**](/installation/Docker).

BIN
2_cameras.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

BIN
2_machines.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -1,40 +1,24 @@
# Requirements
## Which hardware do I need?
## Which type of machines can you use?
Kerberos.io runs on every machine but its main goal is to run on a **Raspberry Pi**. Therefore there are multiple ways (KIOS, Raspbian, Docker, etc) to install Kerberos.io on your specific device, it's your choice. If you want to run Kerberos.io on a Raspberry Pi you'll first need to buy some hardware.
Kerberos.io runs on every Linux based machine but its main goal is to run on a Raspberry Pi or other boards due to its low energy consumption. We provide multiple ways (KIOS, Raspbian, Armbian, Docker, etc) to install Kerberos.io on the device your prefer. If you will install Kerberos.io with Docker, or on your local Linux machine, nothing special should be purchased except a video camera.
![Machines](2_machines.png)
### Raspberry Pi
As said, you can run Kerberos.io **on every Linux based machine**, however we recommend to run Kerberos.io on a **Raspberry Pi**, as it is a low-budget microcontroller which can you buy in almost every (online) electronic shop. Therefore Kerberos.io comes with a custom ARM OS called [**KIOS**](installation/KiOS) (Kerberos.io Operating System), which you can deploy to your Raspberry Pi in just a few minutes. Kerberos.io supports **all Raspberry Pi versions** (1, 2, 3 and Zero).
We recommend to run Kerberos.io on a **Raspberry Pi**, as it is a very popluar microcontroller which can you buy in almost every (online) electronic shop. To simplify the lives of our Raspberry Pi users, Kerberos.io comes with a custom ARM OS called [**KIOS**](installation/KiOS) (Kerberos.io Operating System), which you can deploy to your Raspberry Pi in just a few minutes. Kerberos.io supports **all Raspberry Pi versions** (1, 2, 3 and Zero).
![Raspberry Pi Model A](2_raspberry-pi-a.png)
### What about other boards?
For the moment of writing (2016), we do **not support other boards**.
Kerberos.io can also be installed on other boards by following the [**Armbian**](/installation/armbian) installation. At the moment of writing we don't have support for KiOS, so the installation is a little bit harder. This is a short list of microcontrollers on which we have tested Kerberos.io using the Armbian OS:
### SD card
* PCDuino3 Nano (Allwinner A20)
* Orange Pi + (Allwinner H3)
If you want to use your Raspberry Pi, you will need to have a SD card, on which an OS will be installed. Therefore you will need a **2GB or bigger SD card**.
## Which type of camera can you use?
![4GB SD card](2_sandisk_4gb_sd_card.png)
Kerberos.io works with the full range of camera's. You can use an **USB-**, **IP-** or the **Raspberry Pi camera (v1.3 and v2.1)**. If you want to use an IP camera, we recommend to use the RTSP connection if available; note that it's possible that cheap IP cameras will not work properly.
### Power supply
You will need to have a **micro USB 5V** charger, to give the Raspberry Pi some juice.
![Micro USB 5V charger](2_micro-usb-5V-charger.png)
### Camera
Kerberos.io works with the full range of camera's. You can use an **USB-**, **IP-** or the **Raspberry Pi camera (v1.3 and v2.1)**.
![Raspberry Pi Camera Module](2_raspberry-camera-module.png)
### Optional
You can use a **WIFI dongle** instead of an ethernet cable, but this is not required. We recommend the **Edimax** ew-7811un WIFI dongle; this is not necessary for the Raspberry Pi 3 as this is built-in.
![Edimax WIFI dongle](2_edimax-wifi-dongle.png)
The **Scorpi B+**, a flexible Mount for the Raspberry Pi camera.
![Cameras](2_cameras.png)

View File

@@ -1,5 +1,6 @@
# Release notes
* [2.2.0](#2-2-0)
* [2.1.0](#2-1-0)
* [2.0.0](#2-0-0)
* [1.1.0](#1-1-0)
@@ -8,35 +9,63 @@
* [1.0.1](#1-0-1)
* [1.0.0](#1-0-0)
<a name="2-2-0"></a>
## 2.2.0
#### Ecosystem
* Added support for Armbian.
* Raspbian: Async requests causes session corruption. [#78](https://github.com/kerberos-io/web/issues/78)
#### Web
* Bug: Issue format instance name. [#57](https://github.com/kerberos-io/web/issues/57)
* Redesign settings page (better UX). [#39](https://github.com/kerberos-io/web/issues/39)
* Possibility to edit password through web interface. [#63](https://github.com/kerberos-io/web/issues/63)
* Support for viewing videos.
* Update radius of heatmap.
* PHP7 support. [#60](https://github.com/kerberos-io/web/issues/60)
* Welcome/installation page. [#60](https://github.com/kerberos-io/web/issues/60)
* Translation updated. [#74](https://github.com/kerberos-io/web/issues/74)
* Privacy mode. [#54](https://github.com/kerberos-io/web/issues/54)
#### Machinery
* Output as video file. [#60](https://github.com/kerberos-io/machinery/issues/60)
* Bug: System hangs when a wrong IP camera url was defined. [#48](https://github.com/kerberos-io/machinery/issues/48)
* Run arbitrary script/program. [#31](https://github.com/kerberos-io/machinery/issues/31)
* Bug: Weird colors from RPi Camera. [#64](https://github.com/kerberos-io/machinery/issues/64)
* Upgrade to OpenCV 3.2.0.
<a name="2-1-0"></a>
## 2.1.0
#### Web
* Added PhotoSwipe for image overview (easier to browse through images). [#24](https://github.com/kerberos-io/web/issues/24)
* Added reboot and shutdown commands. [#23](https://github.com/kerberos-io/web/issues/23)
* Added logging view to system page. [#20](https://github.com/kerberos-io/web/issues/20)
* Added labels to check if machinery is running. [#19](https://github.com/kerberos-io/web/issues/19)
* Added error handling if web interface isnt working properly. [#2](https://github.com/kerberos-io/web/issues/2)
* Fixed Heatmap.js fail to load by ad-blocker. [#16](https://github.com/kerberos-io/web/issues/16)
* Show additional information on the dashboard (streaming is opening or not) there is no data available. [#16](https://github.com/kerberos-io/web/issues/16)
* Settings page is now visible on mobile (+ changed icon). [#16](https://github.com/kerberos-io/web/issues/16)
* Fixed sorting of news articles. [#16](https://github.com/kerberos-io/web/issues/16)
* Removed links to assets in the cloud (.css files). [#16](https://github.com/kerberos-io/web/issues/16)
* Added PhotoSwipe for image overview (easier to browse through images). [#45](https://github.com/kerberos-io/web/issues/45)
* Added reboot and shutdown commands. [#46](https://github.com/kerberos-io/web/issues/46)
* Added logging view to system page. [#33](https://github.com/kerberos-io/web/issues/33)
* Added labels to check if machinery is running.
* Added error handling if web interface isnt working properly.
* Fixed Heatmap.js fail to load by ad-blocker. [#42](https://github.com/kerberos-io/web/issues/42)
* Show additional information on the dashboard (streaming is opening or not) there is no data available.
* Settings page is now visible on mobile (+ changed icon).
* Fixed sorting of news articles.
* Removed links to assets in the cloud (.css files).
* Design: improved layout of login page, async loading of image view.
#### Machinery
* Added configurable streaming port and quality. [#21](https://github.com/kerberos-io/machinery/issues/21)
* Added new algorithm: Background subtraction. [#35](https://github.com/kerberos-io/machinery/issues/35)
* Added new heuristic: Counter (for object/people counting). [#28](https://github.com/kerberos-io/machinery/issues/28)
* Added video capture, which can be used for debugging purposes (replay a video fragment).. [#26](https://github.com/kerberos-io/machinery/issues/26)
* Its now possible to mark the images with a timestamp. [#24](https://github.com/kerberos-io/machinery/issues/24)
* Fixed blocking streaming socket. [#22](https://github.com/kerberos-io/machinery/issues/22)
* Added configurable streaming port and quality. [#41](https://github.com/kerberos-io/machinery/issues/41)
* Added new algorithm: Background subtraction.
* Added new heuristic: Counter (for object/people counting). [#42](https://github.com/kerberos-io/machinery/issues/42)
* Added video capture, which can be used for debugging purposes (replay a video fragment).
* Its now possible to mark the images with a timestamp. [#36](https://github.com/kerberos-io/machinery/issues/36)
* Fixed blocking streaming socket. [#39](https://github.com/kerberos-io/machinery/issues/39)
#### Kios
* Fix removal images if disk is almost full (wrong path was defined). [#1](https://github.com/kerberos-io/kios/issues/1)
* Fix removal images if disk is almost full (wrong path was defined).
* Support for the Raspberry Pi Camera module v2.1. [#3](https://github.com/kerberos-io/kios/issues/3)
* Support for the Raspberry Pi Zero; updated kernel to latest Raspbian. [#3](https://github.com/kerberos-io/kios/issues/3)
* KiOS GUI installer.

View File

@@ -1,35 +1,37 @@
#First things first
The reason why you're on this page is because you want to know how to install Kerberos.io on your Raspberry Pi, local working station, server or whatever Linux machine you prefer. The good news is that we have **different approaches** from basic to advanced; it depends on how you want to install it.
The reason why you're on this page is because you want to know **how to install Kerberos.io** on your microcontroller, Docker, local working station, server or whatever Linux environment you prefer. The good news is that we have **different approaches** from basic to advanced; it depends on how you want to install it.
## Raspberry Pi (ARM)
## Raspberry Pi
When deploying on the Raspberry Pi there are two possible solutions. You can use our custom OS, [**KiOS**](installation/KiOS) (Kerberos.io Operating System), which is production-ready or install it on an existing OS, [**Raspbian**](installation/Raspbian).
###KiOS
[KiOS](https://github.com/kerberos-io/kios) is a custom linux OS (created by buildroot) which runs Kerberos.io out-of-the-box. KiOS is **installed like every other OS** for the Raspberry Pi, you need to flash the OS (.img) to a SD card, update your network configration and you're up and running; no manual compilation or horrible configurations. This is the **most simple** and **basic** installation procedure.
[KiOS](https://github.com/kerberos-io/kios) is a custom linux OS (created by buildroot) which runs Kerberos.io out-of-the-box. This is the **most simple** and **basic** installation procedure. Note that with KiOS you don't have multiple camera support.
<div style="float:right;margin-top:-15px;"><a href="installation/KiOS" style="color:#fff;background-color:#943633;border-radius:7px;padding:8px;">Install KiOS</a></div>
###Raspbian
If you already have a Raspberry Pi running with Raspbian, you probably don't want to reflash your SD-card. Therefore you can install the different parts of Kerberos.io (machinery and web) manual.
If you already have a Raspberry Pi running with Raspbian, you probably **don't want to reflash your SD card**. Therefore you can install the different parts of Kerberos.io (machinery and web) manual.
<div style="float:right;margin-top:-15px;"><a href="installation/Raspbian" style="color:#fff;background-color:#943633;border-radius:7px;padding:8px;">Install on Raspbian</a></div>
## Other
## Armbian supported boards
Kerberos.io can also be installed on a PC, Laptop or server. Similar to Raspbian, the different parts needs to be installed manually.
If you have <a href="https://www.armbian.com/download/" target="_blank">**an Armbian supported board**</a>, you can follow the Armbian installation to transform it into a surveillance system.
###Docker
<div style="float:right;margin-top:-15px;"><a href="installation/Armbian" style="color:#fff;background-color:#943633;border-radius:7px;padding:8px;">Install on Armbian</a></div>
A Docker image is available on the Docker Hub for the x86 architecture. By using docker-compose you can run Kerberos.io with a one-liner.
##Docker
A Docker image is available on the Docker Hub for **x86 machines**. By using docker-compose you can run Kerberos.io with a one-liner.
<div style="float:right;margin-top:-15px;"><a href="installation/Docker" style="color:#fff;background-color:#943633;border-radius:7px;padding:8px;">Run on Docker</a></div>
###Advanced
##Generic
This you will need to compile the machinery and install the web interface; It's a little bit more work.
You can install Kerberos.io on any Linux based OS like Ubuntu, Debian, OSX, etc. The only thing you need to do is to compile the machinery and install the web interface.
<div style="float:right;margin-top:-15px;"><a href="installation/advanced" style="color:#fff;background-color:#943633;border-radius:7px;padding:8px;">Compile yourself</a></div>
<div style="float:right;margin-top:-15px;"><a href="installation/generic" style="color:#fff;background-color:#943633;border-radius:7px;padding:8px;">Compile yourself</a></div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -0,0 +1,69 @@
# Upgrade
To upgrade Kerberos.io to a new version you should **follow the approach which fits your initial installation** method. If you installed KiOS follow the KiOS upgrade procedure, if installed on Raspbian follow the Raspbian upgrade procedure, etc.
Please note that it might be possible that some new files are added or existing files were updated. To make sure everything works as expected, you should **clear your browser cache**.
## KiOS
If you installed KiOS, you can **use the built-in versioning** method. You can find the versioning at the bottom of the system page. If a new version of Kerberos.io is released, you'll see a new version available. Note that you'll also receive **a notification on top of the Kerberos.io web interface**, when a new release is available.
![New release available](1_upgrade-newrelease.png)
### Start an upgrade
When a new release is available, you have the possibilty to **install** it **by clicking on** the name of **the release**. A popup will open giving you some more information about the release. Press the install button to start the upgrade. Make sure that you **don't close the upgrade screen** while upgrading.
![Install release](1_upgrade-install.png)
This is what will happen:
* New KiOS image is downloaded.
* Release is unpacked and transferred to /root partition.
* Systems is rebooted.
* Post-upgrade scripts are applied.
## Raspbian
If you want to install a new version of Kerberos.io on Raspbian, there is **no automated versioning** process available like KiOS. To perform an upgrade you'll need to [**follow the traditional installation procedure**](/installation/Raspbian) for Raspbian.
## Armbian
If you want to install a new version of Kerberos.io on Armbian, there is **no automated versioning** process available like KiOS. To perform an upgrade you'll need to [**follow the traditional installation procedure**](/installation/Armbian) for Armbian.
## Docker
When a new release is available, new docker images are available [**on the docker hub**](https://hub.docker.com/u/kerberos/). There are two possible ways to upgrade your docker containers.
### Append or change versio number
The easiest way is to update your **docker-compose.yml** file by changing or adding the version number.
machinery:
image: kerberos/machinery:v2.2.0
ports:
- "8889"
web:
image: kerberos/web:v2.2.0
ports:
- "80"
volumes_from:
- machinery
links:
- machinery
### Remove containers and images
Another solution is to start completely over again (clean state). You can do this by removing all your containers and images from your docker environment.
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
After you've deleted all your containers and images, you can start the containers again with **docker-compose**. You'll see that the new Kerberos.io images will be downloaded.
docker-compose up

View File

@@ -22,11 +22,11 @@ A short video explaining how to install Kerberos.io on Raspbian.
<a name="machinery-install-package"></a>
###Install package
Update system and install dependency avcodec
Update system
sudo apt-get update && sudo apt-get install libav-tools
sudo apt-get update
Download the debian file from [the machinery repository](https://github.com/cedricve/version-test/releases/v%machineryversion%); Please download the correct version for your Raspberry Pi, **replace X by the version**.
Download the debian file from [**the machinery repository**](https://github.com/kerberos-io/machinery/releases/v%machineryversion%/); Please download the correct version for your Raspberry Pi, **replace X by the version**.
sudo wget https://github.com/kerberos-io/machinery/releases/download/v%machineryversion%/rpiX-machinery-kerberosio-armhf-%machineryversion%.deb
@@ -58,7 +58,9 @@ After kerberos is installed a binary is available at **/usr/bin/kerberosio**. Ju
## Web
<a name="web-installation-webserver"></a>
### Install webserver + PHP (optional)
### Install Nginx + PHP
Before you can run the web interface, you'll need to download and configure a webserver. Kerberos.io recommends to use Nginx, as it is a light-weight and fast webserver. The web interface is written in PHP, so we also need to download PHP and some packages.
Update the packages and kernel.
@@ -119,6 +121,7 @@ Unpack
sudo tar xvf web.tar.gz .
Change write permission on the storage directory.
Add write permission for the storage directory, and the kerberos config file.
sudo chmod -R 777 app/storage
sudo chmod -R 777 app/storage
sudo chmod 777 app/config/kerberos.php

View File

@@ -0,0 +1,119 @@
#Armbian
* [How to install](#how-to-install)
* [Machinery](#machinery)
* [Install package](#machinery-install-package)
* [Configure](#machinery-configure)
* [Run](#machinery-run)
* [Web](#web)
* [Install webserver + PHP (optional)](#web-installation-webserver)
* [Install source](#web-installation-source)
<a name="machinery"></a>
## Machinery
<a name="machinery-install-package"></a>
###Install package
Update system and install dependency avcodec. These installation instructions assume that a fresh Armbian 5.24 or 5.25 installed.
sudo apt-get update && sudo apt-get install libav-tools
Download the debian file from [**the machinery repository**](https://github.com/kerberos-io/machinery/releases/v%machineryversion%/); This should work on all Armbian supported boards. If not: inform us!.
sudo wget https://github.com/kerberos-io/machinery/releases/download/v%machineryversion%/armbian-machinery-kerberosio-armhf-%machineryversion%.deb
Unpackage the file
sudo dpkg -i armbian-machinery-kerberosio-armhf-%machineryversion%.deb
Start the machinery on start-up, and reboot the system.
sudo systemctl enable kerberosio && sudo reboot
<a name="machinery-configure"></a>
###Configure
The configuration files can be found at **/etc/opt/kerberosio/config**. By default the Raspberry Pi Camera module is set as capture device. This must be changed in the **config.xml** to **USBCamera** or **IPCamera** depending on your camera. Images / videos are stored in the **/etc/opt/kerberosio/capture** directory by default; this location can be changed by editing the **io.xml** file.
<a name="machinery-run"></a>
###Run
After kerberos is installed a binary is available at **/usr/bin/kerberosio**. Just run following command in your terminal to start kerberosio
kerberosio
In case kerberosio does not start and complains about missing libraries, install the following libraries.
sudo apt-get install pkg-config libavcodec-dev libavformat-dev libswscale-dev
<a name="web"></a>
## Web
<a name="web-installation-webserver"></a>
### Install webserver + PHP (optional)
Update the packages and kernel.
sudo apt-get update && sudo apt-get upgrade
Install Nginx and PHP (+extension).
sudo apt-get install nginx php5-cli php5-fpm php5-gd php5-mcrypt php5-curl
Creating a Nginx config.
sudo rm -f /etc/nginx/sites-enabled/default
sudo nano /etc/nginx/sites-enabled/default
Copy and paste following config file; this file tells nginx where the web will be installed and that it requires PHP.
server
{
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/web/public;
index index.html index.htm index.nginx-debian.html;
server_name kerberos.rpi kerberos.rpi;
index index.php index.html index.htm;
location /
{
autoindex on;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$
{
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Restart nginx and reboot system
sudo service nginx restart && sudo reboot
<a name="web-installation-source"></a>
### Install source
Create a www location.
sudo mkdir -p /var/www/web && cd /var/www/web
Get the source code from Github.
sudo wget https://github.com/kerberos-io/web/releases/download/v%webversion%/web.tar.gz
Unpack
sudo tar xvf web.tar.gz
Change write permission on the storage directory.
sudo chmod -R 777 app/storage
sudo chmod 777 app/config/kerberos.php

View File

@@ -1,6 +1,8 @@
# Docker
A Docker image is available on [**the Docker Hub**](https://hub.docker.com/u/kerberos/). Before you can run this image you will have to get [**Docker**](https://docker.com) installed. After the installation you can use **docker-compose** to get Kerberos.io up and running. More detailed information can be [**found here**](https://blog.cedric.ws/kerberosio-available-on-docker).
** --- For the moment this approach only works for IP cameras, we don't have a cross-platform method to inject a USB camera or Raspberry Pi camera --- **
A Docker image (x86) is available on [**the Docker Hub**](https://hub.docker.com/u/kerberos/). Before you can run this image you will have to get [**Docker**](https://docker.com) installed. After the installation you can use **docker-compose** to get Kerberos.io up and running. More detailed information can be [**found here**](https://blog.cedric.ws/kerberosio-available-on-docker).
##Docker Compose

View File

@@ -1,4 +1,4 @@
# Advanced
# Generic
* [Machinery](#machinery)
* [Compile](#machinery-compile)
@@ -115,10 +115,11 @@ Install PHP packages by using composer.
sudo mv composer.phar /usr/bin/composer
sudo composer install
Change write permission on the storage directory.
Add write permission for the storage directory, and the kerberos config file.
sudo chmod -R 777 app/storage
sudo chmod 777 app/config/kerberos.php
Install bower globally by using node package manager, this is installed when installing nodejs.
sudo apt-get install npm

View File

@@ -1,6 +1,6 @@
# Multi-camera with Docker
** --- This approach only works for IP-cameras --- **
** --- For the moment this approach only works for IP cameras, we don't have a cross-platform method to inject a USB camera or Raspberry Pi camera --- **
If you own multiple IP-cameras, then you probably **don't want** to setup **a Raspberry Pi for each camera**. Thanks to Docker there is an easier approach: instead of running multiple machines you can run multiple containers on a single machine. When you're processing a lot of cameras, you can **distribute the cameras/containers across multiple machines** by using **Docker Swarm**.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

@@ -28,10 +28,4 @@ The settings page allows you to configure the machinery. You can define the type
The system page allows you to **monitor** the system. On this page you'll get an overview of the **system specifications** (CPU, Memory, Network, etc). When installed KiOS, you'll also get the possibility to **update Kerberos.io** to a newer release. Several actions are available: you can **download system information** (for debugging purposes) and **download or remove** your images.
![System](1_system.png)
### Cloud
On the cloud page you can configure Kerberos.io to **sync the images** to your cloud subscription. All you need to do is fill in your credentials and you're ready to go.
![Cloud](1_cloud.png)
![System](1_system.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 KiB

After

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 182 KiB

146
71_web/4_aPI.md Normal file
View File

@@ -0,0 +1,146 @@
# API
If you want to integrate Kerberos.io into your own application, you're at the right place! The Kerberos.io web interface comes with a **REST**full **API**, that allows you to get and modify data delivered by the Kerberos.io framework.
* Reboot the system
* Disable Kerberos.io
* Health check
* Enable or disable output devices
* ..
## Authentication
To use the RESTfull API of your Kerberos.io instance you need to define an **Authorization header** with each request. We use **Basic Authentication** to secure the different **endpoints**.
"Authorization": "Basic root:root"
An example with Python looks like this.
import requests
import json
import base64
url = "http://ip-of-pi/api/v1/condition/enabled"
username = "user"
password = "passw"
basicAuth = base64.b64encode('%s:%s' % (username, password))
headers = {"Authorization": "Basic " + basicAuth, "Content-Type": "application/json"}
data = '{"active": "true"}'
#Call REST API
response = requests.put(url, data=data, headers=headers)
print(response.text)
If you're using the wrong credentials, Kerberos.io will return following error message.
Invalid credentials.
## Endpoints
All endpoints are prefixed with **api/v[version #]/**, in which the last part defines the API version number. Below you will find all the available endpoints with there signature and response. Note that when you call an endpoint which doesn't exists, Kerberos.io will throw an 404.
{
"error": "API method does not exists"
}
## API version 1
A list of all API methods available for version 1.
<div class="api-method">
GET api/v1/name
</div>
<br/>
**Description**
Retrieve the name of your instance.
**Response**
{
"name": "frontdoor"
}
<div class="api-method">
PUT api/v1/name
</div>
<br/>
**Description**
Change the name of your instance.
**Data**
{
"name": "frontdoor-changed"
}
**Response**
Similar to **GET api/v1/name**.
<div class="api-method">
GET api/v1/condition/enabled
</div>
<br/>
**Description**
Check if enabled or disabled.
**Response**
{
"active": "true",
"delay": "5000"
}
<div class="api-method">
PUT api/v1/condition/enabled
</div>
<br/>
**Description**
Activate or disable the system
**Data**
{
"active": "false"
}
**Response**
Similar to **GET api/v1/condition/enabled**.
<div class="api-method">
GET api/v1/system/health
</div>
<br/>
**Description**
Check if the machinery is running (the stream is connected).
**Response**
{
"status": "false"
}
<div class="api-method">
POST api/v1/system/reboot
</div>
<br/>
**Description**
Restart the system.
<div class="api-method">
POST api/v1/system/shutdown
</div>
<br/>
**Description**
Shutdown the system.

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

0
72_machinery/84_Outputs/1_disk-io-timestamp.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 291 KiB

After

Width:  |  Height:  |  Size: 291 KiB

0
72_machinery/84_Outputs/1_disk-io.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

15
72_machinery/84_Outputs/1_disk.md Normal file → Executable file
View File

@@ -13,6 +13,7 @@ The parameters of the Disk output device can be found in the **config/io**.xml f
<directory type="text">/etc/opt/kerberosio/capture/</directory>
<markWithTimestamp type="bool">false</markWithTimestamp>
<timestampColor type="text">white</timestampColor>
<privacy type="bool">false</privacy>
</Disk>
</ios>
@@ -27,10 +28,20 @@ The directory where the image will be saved to. By default images are saved to t
### Mark with timestamp
When true images are marked with a timestamp.
When this settings is set to **true**, the image is marked with a timestamp .
![Disk timestamp](1_disk-io-timestamp.png)
### Timestamp color
A color can be defined for timestamp: white, black, red, green and blue.
A color can be defined for timestamp: white, black, red, green and blue.
### Privacy
The privacy mode can be activated to remove some parts from the image. This especially helpful if you want to filter out public areas.
![Video privacy](1_privacy-mode.png)
After updating the configuration, you'll see that the pixels outside your region of interest (ROI) are made black; the image below illustrates this.
![Video privacy](1_disk-io-privacy.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@@ -0,0 +1,69 @@
# Video
When a valid event is detected, a video will be recorded for x seconds. When more valid events are detected, while a video is recording, the video file will further record for x seconds; so no new video file be recorded, but the existing one will be expanded.
## Parameters
The parameters of the Video output device can be found in the **config/io**.xml file, but you can also use the web to modify the parameters. Below you see a default configuration file.
<ios>
<Video>
<fps type="number">3</fps>
<recordAfter type="number">5</recordAfter>
<extension type="number">mp4</extension>
<codec type="number">h264</codec>
<fileFormat type="text">timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token</fileFormat>
<directory type="text">/etc/opt/kerberosio/capture/</directory>
<markWithTimestamp type="bool">false</markWithTimestamp>
<timestampColor type="text">white</timestampColor>
<privacy type="bool">false</privacy>
</Video>
</ios>
### FPS
The frames per second of the video being recorded. Please note that this number is limited, and depends heavily on your hardware setup. You'll be receiving following warning in the systems logs, if Kerberos.io can't write the desired FPS. For recommend recording at 5-8FPS for a Rasberry Pi 2/3.
[trivial] IoVideo: framerate is too fast, can't record video at this speed (8/FPS)
### Record after
The number of seconds recorded after the last valid event was detected. This means that when a video is already recording, and a valid event was detected, the video will be expanded with x more seconds.
### Extensions
The extension or container of the video file. We highly **recommend to use the MP4 container** if you want cross-browser support. Leave this setting by default, if you don't know what you're doing.
### Codec
The codec that is used to encode the video file.
### File format
The format that will be used for the name of the image. One or more variables can be defined and will be replaced by the machinery. Note that when you're using a variables name in the file format, that this name should be defined in the JSON object.
### Directory
The directory where the image will be saved to. By default images are saved to the **/etc/opt/kerberosio/capture** directory.
### Mark with timestamp
When this settings is set to **true**, the video is marked with a timestamp (similar to the Disk device).
![Disk timestamp](1_disk-io-timestamp.png)
### Timestamp color
A color can be defined for timestamp: white, black, red, green and blue.
### Privacy
The privacy mode can be activated to remove some parts from the video. This especially helpful if you want to filter out public areas.
![Video privacy](1_privacy-mode.png)
After updating the configuration, you'll see that the pixels outside your region of interest (ROI) are made black; the image below illustrates this.
![Video privacy](1_video-io-privacy.png)

0
72_machinery/84_Outputs/2_TCP_client.md Normal file → Executable file
View File

0
72_machinery/84_Outputs/2_tcp-io.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

0
72_machinery/84_Outputs/3_GPIO.md Normal file → Executable file
View File

0
72_machinery/84_Outputs/3_gpio-io.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

20
72_machinery/84_Outputs/4_webhook.md Normal file → Executable file
View File

@@ -1,8 +1,8 @@
# Webhook
Detailed information (a JSON object) is send as a POST request to a webhook. The JSON object contains the number of changes, the region, the URL of the image, etc.
Detailed information (a JSON object) is send as a POST request to a webhook. The JSON object contains the number of changes, the region, the URL of the image, etc. This is useful if you want to integrate the Kerberos.io events in your own application.
**Make sure that the Webhook comes after the Disk device, otherwise the URL of the image is not included.**
**Make sure** that the Webhook comes after the Disk device, otherwise the URL of the image is not included.
## Parameters
The parameters of the webhook can be found in the **config/io.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
@@ -17,4 +17,18 @@ The parameters of the webhook can be found in the **config/io.xml** file, but yo
### Url
This is the URL, to which Kerberos.io will send a JSON object (as a POST request).
This is the URL, to which Kerberos.io will send a JSON object (as a POST request).
## Output
A JSON object is POSTed to the url you've defined.
[
'regionCoordinates' : [618, 317, 703, 493],
'numberOfChanges' : 5446,
'timestamp' : '1465894497',
'microseconds' : '5-97451',
'token' : 695,
'pathToImage' : '1465894497_5-97451_frontdoor_618-317-703-493_5446_695.jpg',
'instanceName' : 'frontdoor',
]

0
72_machinery/84_Outputs/4_webhook.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,48 @@
# Script
A bash script can be executed after a valid event was detected. A JSON object is send in the first parameter to the script you've defined.
## Parameters
The parameters of the Script output device can be found in the **config/io**.xml file, but you can also use the web to modify the parameters. Below you see a default configuration file.
<ios>
<Script>
<path type="text">/etc/opt/kerberosio/scripts/run.sh</path>
</Script>
</ios>
### Path
The frames per second of the video being recorded. Please note that this number is limited, and depends heavily on your hardware setup. You'll be receiving following warning in the systems logs, if Kerberos.io can't write the desired FPS. For recommend recording at 5-8FPS for a Rasberry Pi 2/3.
## Example
By default the script will point to **/etc/opt/kerberosio/scripts/run.sh**, which contains a template how you should start your script. Note that when using **KiOS**, this script will be read-only, copy it to the **/data** folder and change the path parameter.
#!/bin/bash
# -------------------------------------------
# This is an example script which illustrates
# how to use the Script IO device.
#
# --------------------------------------
# The first parameter is the JSON object
#
# e.g. {"regionCoordinates":[308,250,346,329],"numberOfChanges":194,"timestamp":"1486049622","microseconds":"6-161868","token":344,"pathToImage":"1486049622_6-161868_frontdoor_308-250-346-329_194_344.jpg","instanceName":"frontdoor"}
JSON=$1
# -------------------------------------------
# You can use python to parse the JSON object
# and get the required fields
name=$(echo $JSON | python -c "import sys, json; print json.load(sys.stdin)['instanceName']")
coordinates=$(echo $JSON | python -c "import sys, json; print json.load(sys.stdin)['regionCoordinates']")
changes=$(echo $JSON | pythfon -c "import sys, json; print json.load(sys.stdin)['numberOfChanges']")
image=$(echo $JSON | python -c "import sys, json; print json.load(sys.stdin)['pathToImage']")
The idea is that you can use **Python** in your bash script, to parse the JSON object send as first parameter. Afterwards you can do with the output what you want.

View File

@@ -6,12 +6,22 @@ Another solution would be to use [**the cloud service**](https://cloud.kerberos.
## Video
In the video below you get a brief overview of the different features.
<iframe src="https://player.vimeo.com/video/121532472?autoplay=0&color=943633#t=13m32s" style="width:100%; height: 400px;" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
## How it works?
## How does it works?
Kerberos.io is using AWS S3 to store their images. When the machinery detected something, it will save an image to disk, and maybe trigger some other IO devices. In its turn the machinery will push the image(s) to the appropriate S3 bucket, by using your credentials; the **credentials** you've received **from the cloud application**.
When subscribed to Kerberos.cloud succesfully, you'll receive some credentials which you can enter in to your Kerberos.io installation. From then all the **images** or **videos** you capture are synced to the Kerberos.cloud service.
When the file (image) is stored in the bucket, AWS Lambda will do some validation and post-processing. Lambda will check if the file is realy an image, if the size is not to big, and do some **post-processing** like facerecognition. If the image is valid, the image will be **copied to our production bucket**, and additional information is stored in DynamoDB.
![Cloud subcription](2_cloud_enter-credentials.png)
The cloud application is attached to the production bucket, so **only images that are verified** will be shown in the cloud application. When a user accesses the cloud application, the images from the production bucket are listed. Images that are loaded in the browser will be signed, for a specific time, before they are actually rendered. The signing will expire after 100 seconds.
When opening Kerberos.cloud you'll see your events appear and receive **in-browser notifications**, and if configured Pushbullet notifications on your other devices.
![Cloud dashboard](2_cloud_dashboard.png)
## Where is my data hosted?
We don't own powerful machines to host and protect your data by ourselves, therefore we use services of Amazon Web Services (AWS). For the paranoids this means that your data is in the **cloud**. However we protect your data by the maximum: we **encrypt/decrypt** your data, and **sign** it for a specific amount of time when requested. This means that links are only accessible for x amount of seconds/minutes.
If you feel the need to store the data in your own environment, get in touch with us. We have services to support you.

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB