diff --git a/1_getting_started.md b/1_getting_started.md index d464427..4ad60a4 100644 --- a/1_getting_started.md +++ b/1_getting_started.md @@ -6,6 +6,7 @@ * [Features](#features) * [Installation](#installation) + ## Why Kerberos.io? diff --git a/6_license.md b/6_license.md index 95cebac..f45f91a 100644 --- a/6_license.md +++ b/6_license.md @@ -1,4 +1,4 @@ -#CC-NC-ND +# CC-NC-ND THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. @@ -6,9 +6,9 @@ BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE B ## Exceptions / Commercial use -Any exceptions regarding this license, and/or business opportunities should be discussed with **cedric@verstraeten.io**. +Any exceptions regarding this license, and/or business opportunities should be discussed with **cedric@verstraeten.io**. -##Definitions +## Definitions "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. @@ -72,4 +72,4 @@ If any provision of this License is invalid or unenforceable under applicable la No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. -The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. \ No newline at end of file +The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. diff --git a/70_installation/1_first_things_first.md b/70_installation/1_first_things_first.md index f379dc1..599f72e 100644 --- a/70_installation/1_first_things_first.md +++ b/70_installation/1_first_things_first.md @@ -1,4 +1,4 @@ -#First things first +# First things first 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. @@ -8,13 +8,13 @@ Before you decide which installation method you will use, it might be interestin 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 [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.
-###Raspbian +### 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 and download the different parts of Kerberos.io (the machinery and the web) without the need for complex and time consuming compiling. @@ -26,13 +26,13 @@ If you have *an Armb -##Docker +## 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. -##Generic +## Generic You can install Kerberos.io on any Linux based OS like Ubuntu, Debian, Raspbian, OSX, etc. The only thing you need to do is to compile the machinery and install the web interface. Kerberos.io can't be compiled on a native Windows machine, if you want to use Kerberos.io on windows you should Docker. diff --git a/70_installation/1_upgrade.md b/70_installation/1_upgrade.md index 537bdc6..a936e61 100644 --- a/70_installation/1_upgrade.md +++ b/70_installation/1_upgrade.md @@ -54,7 +54,7 @@ Reboot the system (or only Nginx). 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 +### Append or change version number The easiest way is to update your **docker-compose.yml** file by changing or adding the version number. @@ -62,7 +62,6 @@ The easiest way is to update your **docker-compose.yml** file by changing or add image: kerberos/machinery:v2.2.0 ports: - "8889" - web: image: kerberos/web:v2.2.0 ports: diff --git a/70_installation/2_KiOS.md b/70_installation/2_KiOS.md index b4ce688..2dd4026 100644 --- a/70_installation/2_KiOS.md +++ b/70_installation/2_KiOS.md @@ -8,6 +8,7 @@ * [Power on the Raspberry Pi](#poweron) * [Access the Raspberry Pi with SSH](#access) + ## Introduction [KiOS](https://github.com/kerberos-io/kios) (Kerberos.io Operating System) is our own **custom linux OS**, 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. If you want to get Kerberos.io up and running at a short time frame, this is the **most simple** and **basic** installation procedure. @@ -52,14 +53,14 @@ Installing Kerberos.io to your IoT device, has never been so easy. By usiAll releases are stored on the KiOS Github repository, each release contains several images (for every Raspberry Pi version a different image is created). It's important to download the correct image; installing an image for another Raspberry Pi version will not work. After downloading, make sure to unzip the release.
-
+
For the advanced installation we'll use Etcher, it will handle the flashing for us. As you may have noticed the installer, used in the Basic installation, is forked from the original Etcher application. The major difference between Etcher and our own installer is that we've added some configurational sugar on top of Etcher, setup your network configuration and automatic downloading of the KiOS release.
-
+
So the only thing you'll need to do for flashing, the hard way, is to go to Etcher.io and download the Etcher installer that matches your OS. After installation you can simply open Etcher and go with the flow: select the KiOS image which you've previously downloaded, select your SD card and click the flash button. Tadaaaa, and you're ready to rumble.
@@ -75,13 +76,10 @@ Installing Kerberos.io to your IoT device, has never been so easy. By usi#####################################################################
# Enter the IP-address you want to have, followed by the subnet mask
# e.g. 192.168.0.10/24
-
static_ip=""
-
#####################################################################
# Enter the Gateway and DNS, this will be your router in most cases
# e.g. 192.168.0.1
-
static_gw=""
static_dns=""
@@ -91,7 +89,6 @@ static_dns=""
update_config=1
ctrl_interface=/var/run/wpa_supplicant
-
network={
scan_ssid=1
ssid=""
diff --git a/70_installation/3_Raspbian.md b/70_installation/3_Raspbian.md
index 6c61616..cfa1b00 100644
--- a/70_installation/3_Raspbian.md
+++ b/70_installation/3_Raspbian.md
@@ -20,7 +20,7 @@ A short video explaining how to install Kerberos.io on Raspbian.
## Machinery
-###Install package
+### Install package
Update system
@@ -43,12 +43,12 @@ Start the machinery on start-up, and reboot the system.
sudo systemctl enable kerberosio && sudo reboot
-###Configure
+### Configure
The configuration files can be found at **/etc/opt/kerberosio/config**. By default the Raspberry Pi Camera module is set as capture device. You can update the **config.xml** file to change it to **USBCamera** or **IPCamera**. Images are stored in the **/etc/opt/kerberosio/capture** directory by default; this location can be changed by editing the **io.xml** file.
-###Run
+### Run
After kerberos is installed a binary is available at **/usr/bin/kerberosio**. Just run following command in your terminal to start kerberosio
@@ -82,19 +82,15 @@ Copy and paste following config file; this file tells nginx where the web will b
{
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/php/php7.0-fpm.sock;
diff --git a/70_installation/4_Armbian.md b/70_installation/4_Armbian.md
index 6f88178..e33d7de 100644
--- a/70_installation/4_Armbian.md
+++ b/70_installation/4_Armbian.md
@@ -1,4 +1,4 @@
-#Armbian
+# Armbian
* [How to install](#how-to-install)
* [Machinery](#machinery)
@@ -14,7 +14,7 @@
## Machinery
-###Install package
+### Install package
Update system and install dependency avcodec. These installation instructions assume that a fresh Armbian 5.24 or 5.25 installed.
@@ -33,12 +33,12 @@ Start the machinery on start-up, and reboot the system.
sudo systemctl enable kerberosio && sudo reboot
-###Configure
+### 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.
-###Run
+### Run
After kerberos is installed a binary is available at **/usr/bin/kerberosio**. Just run following command in your terminal to start kerberosio
@@ -54,8 +54,9 @@ In case kerberosio does not start and complains about missing libraries, install
### Install webserver + PHP (optional)
-Update the packages and kernel.
+Add Raspbian package repo and update the packages and kernel.
+ echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" | sudo tee --append /etc/apt/sources.list
sudo apt-get update && sudo apt-get upgrade
Install Nginx and PHP (+extension).
@@ -73,19 +74,15 @@ Copy and paste following config file; this file tells nginx where the web will b
{
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/php/php7.0-fpm.sock;
diff --git a/70_installation/4_Docker.md b/70_installation/4_Docker.md
index cff9040..e0e6fda 100644
--- a/70_installation/4_Docker.md
+++ b/70_installation/4_Docker.md
@@ -4,7 +4,7 @@
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
+## Docker Compose
Create a **docker-compose.yml** file and following configuration:
diff --git a/70_installation/5_Generic.md b/70_installation/5_Generic.md
index 5bee985..ba9b04a 100644
--- a/70_installation/5_Generic.md
+++ b/70_installation/5_Generic.md
@@ -105,19 +105,15 @@ Copy and paste following config file; this file tells nginx where the web will b
{
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/php/php7.0-fpm.sock;
diff --git a/70_installation/80_Multi-camera/1_Docker.md b/70_installation/80_Multi-camera/1_Docker.md
index a9acc73..d1988ce 100644
--- a/70_installation/80_Multi-camera/1_Docker.md
+++ b/70_installation/80_Multi-camera/1_Docker.md
@@ -1,6 +1,6 @@
# Multi-camera with 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 --- **
+**--- 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**.
@@ -12,7 +12,6 @@ The approach is equal to [**the traditional Docker approach**](/installation/doc
image: kerberos/machinery
ports:
- "8889"
-
web:
image: kerberos/web
ports:
@@ -31,7 +30,6 @@ Instead of running docker-compose up, we add an additional parameter **-p**. Thi
If you type in the **docker ps** command, you'll get an overview of all the containers that are started; see a stripped output below. In the ports section you'll see the ports that have been exposed to access the web interface of each project.
$ docker ps
-
CONTAINER ID IMAGE CREATED PORTS NAMES
30f74ea52852 kerberos/web 3 seconds ago 443/tcp, 0.0.0.0:32779->80/tcp cameragarden_web_1
873d6bae8ea1 kerberos/machinery 5 seconds ago 0.0.0.0:32778->8889/tcp cameragarden_machinery_1
@@ -42,4 +40,4 @@ If you type in the **docker ps** command, you'll get an overview of all the cont
If we want to connect to the web interface of the **cameragarden** container, we can open our browser and enter the url **http://your-ip:32779**.
-
\ No newline at end of file
+
diff --git a/70_installation/80_Multi-camera/2_Raspbian.md b/70_installation/80_Multi-camera/2_Raspbian.md
index ddf4441..51c4ab6 100644
--- a/70_installation/80_Multi-camera/2_Raspbian.md
+++ b/70_installation/80_Multi-camera/2_Raspbian.md
@@ -1,6 +1,6 @@
# Multi-camera on Raspbian
-When you've installed Kerberos.io on your **Raspbian** installation, then you have the possibility **to connect one or more cameras** to the Raspberry Pi. Please note that this functionality **isn't available out-of-the-box**, and therefore requires some technical skills to configure.
+When you've installed Kerberos.io on your **Raspbian** installation, then you have the possibility **to connect one or more cameras** to the Raspberry Pi. Please note that this functionality **isn't available out-of-the-box**, and therefore requires some technical skills to configure.
## Install Raspbian
@@ -24,7 +24,7 @@ What this will do is start two new kerberosio processes, and **connect each USB
## Where can I find those variables?
-When Kerberos.io is started it will write to a log file located at**/etc/opt/kerberosio/logs/log.stash**, which you can see on the system page of the web interface. In the log file you'll see the startup configuration with all the different settings. You can overwrite every setting which is listed in this overview, just keep in mind that you have to prefix every option with **a double dash --**.
+When Kerberos.io is started it will write to a log file located at **/etc/opt/kerberosio/logs/log.stash**, which you can see on the system page of the web interface. In the log file you'll see the startup configuration with all the different settings. You can overwrite every setting which is listed in this overview, just keep in mind that you have to prefix every option with **a double dash --**.
26/10/2016 08:11:36.135 INFO [trivial] Reading configuration
26/10/2016 08:11:36.141 INFO [trivial] Final configuration:
@@ -57,4 +57,3 @@ When Kerberos.io is started it will write to a log file located at**/etc/opt/ker
## Where can I find my images?
All images will be stored at the same location, so they will be mixed in the webinterface. We don't provide a way to see the images independent (on a camera basis), if you would like to have this then you should check out our [**cloud application**](https://cloud.kerberos.io) which has some additional features.
-
diff --git a/71_web/2_contribute.md b/71_web/2_contribute.md
index 3867343..6cdd044 100644
--- a/71_web/2_contribute.md
+++ b/71_web/2_contribute.md
@@ -67,7 +67,7 @@ The web is created with two frameworks and a lot of third-party libraries.
### Laravel 5.4
-[**Laravel**]((http://laravel.com) is a very **powerful** and **popular** PHP framework. This is also the main reason why the web is created with Laravel, the community is huge. A lot of people are writing tutorials and recording webcasts. This makes **getting started** with contributing to the web repository so **easy**. You will find all the information you need on the Laravel [**documentation site**](http://laravel.com/docs/5.4).
+[**Laravel**](http://laravel.com) is a very **powerful** and **popular** PHP framework. This is also the main reason why the web is created with Laravel, the community is huge. A lot of people are writing tutorials and recording webcasts. This makes **getting started** with contributing to the web repository so **easy**. You will find all the information you need on the Laravel [**documentation site**](http://laravel.com/docs/5.4).
### BackboneJS
diff --git a/71_web/3_project_structure.md b/71_web/3_project_structure.md
index ac18ba7..bfb98f3 100644
--- a/71_web/3_project_structure.md
+++ b/71_web/3_project_structure.md
@@ -5,6 +5,7 @@
* [Client](#client)
* [Settings page](#settings-page)
+
The web contains several important concepts and this is the right place where we will explain them briefly.
diff --git a/71_web/4_aPI.md b/71_web/4_aPI.md
index 2726f6b..8703c62 100644
--- a/71_web/4_aPI.md
+++ b/71_web/4_aPI.md
@@ -11,7 +11,7 @@ If you want to integrate Kerberos.io into your own application, you're at the ri
## 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**.
+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"
@@ -54,7 +54,8 @@ A list of all API methods available for version 1.
GET api/v1/name
-**Description**
+
+**Description**
Retrieve the name of your instance.
@@ -68,7 +69,8 @@ Retrieve the name of your instance.
PUT api/v1/name
-**Description**
+
+**Description**
Change the name of your instance.
@@ -86,7 +88,8 @@ Similar to **GET api/v1/name**.
GET api/v1/condition/enabled
-**Description**
+
+**Description**
Check if enabled or disabled.
@@ -101,7 +104,8 @@ Check if enabled or disabled.
PUT api/v1/condition/enabled
-**Description**
+
+**Description**
Activate or disable the system
@@ -119,7 +123,8 @@ Similar to **GET api/v1/condition/enabled**.
GET api/v1/system/health
-**Description**
+
+**Description**
Check if the machinery is running (the stream is connected).
@@ -133,7 +138,8 @@ Check if the machinery is running (the stream is connected).
POST api/v1/system/reboot
-**Description**
+
+**Description**
Restart the system.
@@ -141,6 +147,7 @@ Restart the system.
POST api/v1/system/shutdown
-**Description**
+
+**Description**
Shutdown the system.
diff --git a/72_machinery/3_contribute.md b/72_machinery/3_contribute.md
index 6ef542c..b8fa40e 100644
--- a/72_machinery/3_contribute.md
+++ b/72_machinery/3_contribute.md
@@ -15,7 +15,7 @@
* [Compile](#compile)
* [Adding a test](#adding-a-test)
* [Create the test file](#create-the-test-file)
-
+
Contributing to the **machinery** repository requires C++ sklls. This document describes how to contribute to Kerberos.io and describes all the technical stuff you will need to know. If you want to contribute, the first thing you will need to do is installing the source code on your local environment.
@@ -41,7 +41,7 @@ That's it..
## Versioning
-As you've probably seen in the **installation summary** we are hosting our repositories on [**github**](https://github.com/kerberos-io). As any larger project we are also using a versioning strategy; an easy one :) we don't want to get the things complicated. The version strategy is based on this [**branching model**](http://nvie.com/posts/a-successful-git-branching-model/).
+As you've probably seen in the **installation summary** we are hosting our repositories on [**github**](https://github.com/kerberos-io). As any larger project we are also using a versioning strategy; an easy one :) we don't want to get the things complicated. The version strategy is based on this [**branching model**](http://nvie.com/posts/a-successful-git-branching-model/).
The model includes:
@@ -52,7 +52,7 @@ The model includes:
The idea is that the **master** branch always contains a stable release and development happens on the **develop** branch. When we plan to create a new release we merge the develop branch to the master branch and create a new release. If **bugs are introduced** in the master branch (stable release), **hotfixes** are pushed to the master branch and merged back to the develop branch. Believe me, it's very straight-forward if you are into it.
-##IDE
+## IDE
### CLion
@@ -60,7 +60,7 @@ The idea is that the **master** branch always contains a stable release and deve
Contributing to the machinery by using CLion is **very easy**. You just need to **open the root folder** of the machinery and run the project. CLion will compile the source code by using cmake. You don't have to do anything.
-## Testing
+## Testing
### Continous integration
@@ -73,7 +73,7 @@ The machinery is build automatically on **Travis-CI**, when a new commit/release
We strongly recommend testing as a best practice in complex projects. Therefore the machinery uses the popular C++ test library: Google Test and Google Mock. The tests can be found in the **test** directory. You can run the test by executing following command:
make check
-
+
## Adding a new class
@@ -97,12 +97,9 @@ First we will need to create a new header file in the **include/kerberos/machine
// The program(s) may be used and/or copied .
//
/////////////////////////////////////////////////////
-
#ifndef __AnotherAlgorithm_H_INCLUDED__ // if AnotherAlgorithm.h hasn't been included yet...
#define __AnotherAlgorithm_H_INCLUDED__ // #define this so the compiler knows it has been included
-
#include "machinery/algorithm/Algorithm.h"
-
namespace kerberos
{
char AnotherAlgorithmName[] = "AnotherAlgorithm";
@@ -111,11 +108,9 @@ First we will need to create a new header file in the **include/kerberos/machine
private:
Image m_result;
int m_parameter;
-
public:
AnotherAlgorithm(){}
void setup(const StringMap & settings);
-
void initialize(ImageVector & images);
Image evaluate(ImageVector & images, JSON & data);
void setParameter(int parameter);
@@ -135,7 +130,6 @@ The inheritance of the creator class can be a little bit strange, but it is requ
Ofcourse we also need to have an implementation file, therefore we need to create a new source file in the **src/kerberos/machinery/algorithm** directory. Just like the previous example, you can copy an existing class and implement the member functions you've declared in the header file. An example would be:
#include "machinery/algorithm/AnotherAlgorithm.h"
-
namespace kerberos
{
void AnotherAlgorithm::setup(const StringMap & settings)
@@ -144,24 +138,19 @@ Ofcourse we also need to have an implementation file, therefore we need to creat
int parameter = std::atoi(settings.at("algorithms.AnotherAlgorithm.parameter").c_str());
setParameter(parameter);
}
-
void AnotherAlgorithm::initialize(ImageVector & images)
{
....
}
-
Image AnotherAlgorithm::evaluate(ImageVector & images, JSON & data)
{
- Image evaluation;
-
- ... do something ..
-
+ Image evaluation;
+ ... do something ..
return evaluation;
}
-
void AnotherAlgorithm::setParameter(int parameter)
{
- m_parameter = parameter;
+ m_parameter = parameter;
}
}
@@ -175,7 +164,6 @@ Open the CMakeLists.txt in the **src/kerberos** directory file and append the na
# - classes are registered on compile time, so they
# don't belong to a library. New algorithms, expositors
# or Io classes belong here.
-
set(KERBEROS_FACTORY_ENTITIES
capture/USBCamera.cpp
machinery/condition/Time.cpp
@@ -194,16 +182,14 @@ Open the CMakeLists.txt in the **src/kerberos** directory file and append the na
### Create a new entry in the config file
-Open the algorithm.xml file in the **config** directory, and add a new tag with exactly the same name you've used in the header file; so in our example "AnotherAlgorithm". Within the new tag we can add properties that we will be use to configure our algorithm, in our example we defined a field **parameter** so we can add this field in the config file.
+Open the algorithm.xml file in the **config** directory, and add a new tag with exactly the same name you've used in the header file; so in our example "AnotherAlgorithm". Within the new tag we can add properties that we will be use to configure our algorithm, in our example we defined a field **parameter** so we can add this field in the config file.
One thing you will need to do is to attach a **type** to a property. The type will be used by the web to **automatically render** the properties. For simplicity we can use the type number, this will show an input box on the settings page of the web where we are able to add numbers.
-
5
-
You can retrieve the parameter in the **setup** function with the settings parameter.
@@ -229,40 +215,33 @@ Add a new file to the **test/** directory, prefix the file with **test_** e.g. t
#include "gmock/gmock.h"
#include "Factory.h"
#include "Types.h"
-
using ::testing::AtLeast;
using ::testing::Return;
using namespace kerberos;
-
// ----------------------------------------
// Enabled condition: allowed function
-
TEST(ENABLED_CONDITION, ALLOWED)
{
Condition * condition = Factory::getInstance()->create("Enabled");
-
// This is only for mocking
ImageVector images;
-
StringMap settings;
settings["conditions.Enabled.delay"] = "2000";
-
// Enable condition
settings["conditions.Enabled.active"] = "true";
condition->setup(settings);
bool canExecute = condition->allowed(images);
EXPECT_EQ(true, canExecute);
-
// Disable condition
settings["conditions.Enabled.active"] = "false";
condition->setup(settings);
canExecute = condition->allowed(images);
EXPECT_EQ(false, canExecute);
- }
+ }
### Run tests
-To execute the test you can run the **make check** in the **build/** directory. When you've added a new test file, you will need to execute the **cmake** command again.
+To execute the test you can run the **make check** in the **build/** directory. When you've added a new test file, you will need to execute the **cmake** command again.
cd build/
cmake ..
@@ -285,31 +264,26 @@ You will get following output
[ RUN ] ENABLED_CONDITION.ALLOWED
[ OK ] ENABLED_CONDITION.ALLOWED (2002 ms)
[----------] 1 test from ENABLED_CONDITION (2002 ms total)
-
[----------] 2 tests from HELPER
[ RUN ] HELPER.T_TO_STRING
[ OK ] HELPER.T_TO_STRING (0 ms)
[ RUN ] HELPER.NORMALIZE_PATH
[ OK ] HELPER.NORMALIZE_PATH (0 ms)
[----------] 2 tests from HELPER (0 ms total)
-
[----------] 1 test from HULL_EXPOSITOR
[ RUN ] HULL_EXPOSITOR.CALCULATE
[ OK ] HULL_EXPOSITOR.CALCULATE (1 ms)
[----------] 1 test from HULL_EXPOSITOR (1 ms total)
-
[----------] 1 test from RECTANGLE_EXPOSITOR
[ RUN ] RECTANGLE_EXPOSITOR.CALCULATE
[ OK ] RECTANGLE_EXPOSITOR.CALCULATE (0 ms)
[----------] 1 test from RECTANGLE_EXPOSITOR (0 ms total)
-
[----------] 1 test from SEQUENCE_HEURISTIC
[ RUN ] SEQUENCE_HEURISTIC.IS_VALID
[ OK ] SEQUENCE_HEURISTIC.IS_VALID (1005 ms)
[----------] 1 test from SEQUENCE_HEURISTIC (1005 ms total)
-
[----------] Global test environment tear-down
[==========] 6 tests from 5 test cases ran. (3008 ms total)
[ PASSED ] 6 tests.
[100%] Built target check
- macbook:build cedricverstraeten$
\ No newline at end of file
+ macbook:build cedricverstraeten$
diff --git a/72_machinery/70_captures/1_USB-camera.md b/72_machinery/70_captures/1_USB-camera.md
index 4faec39..67f3595 100644
--- a/72_machinery/70_captures/1_USB-camera.md
+++ b/72_machinery/70_captures/1_USB-camera.md
@@ -7,7 +7,6 @@ Kerberos.io supports a whole range of USB-cameras. You will find a complete list
The parameters of the USB-camera can be found in the **config/capture.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
1280
720
@@ -15,7 +14,6 @@ The parameters of the USB-camera can be found in the **config/capture.xml** file
0
0
-
### Framewidth and -height
diff --git a/72_machinery/70_captures/2_IP-camera.md b/72_machinery/70_captures/2_IP-camera.md
index 75ed59c..dbc2edc 100644
--- a/72_machinery/70_captures/2_IP-camera.md
+++ b/72_machinery/70_captures/2_IP-camera.md
@@ -7,7 +7,6 @@ Kerberos.io can be used with any IP-camera, that provides a RTSP (or MJPEG) stre
The parameters of the IP capture device can be found in the **config/capture.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
http://username:password@ipaddress/image.jpg
800
@@ -15,7 +14,6 @@ The parameters of the IP capture device can be found in the **config/capture.xml
0
0
-
### URL
diff --git a/72_machinery/70_captures/3_RPi-camera.md b/72_machinery/70_captures/3_RPi-camera.md
index ffe1607..6d4579c 100644
--- a/72_machinery/70_captures/3_RPi-camera.md
+++ b/72_machinery/70_captures/3_RPi-camera.md
@@ -7,7 +7,6 @@ You can use the Raspberry Pi Camera Module with Kerberos.io. You just need [**to
The parameters of the Raspberry Pi Camera Module can be found in the **config/capture.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
640
480
@@ -19,7 +18,6 @@ The parameters of the Raspberry Pi Camera Module can be found in the **config/ca
0
50
-
### Framewidth and -height
diff --git a/72_machinery/80_conditions/1_time.md b/72_machinery/80_conditions/1_time.md
index c115351..89e7891 100644
--- a/72_machinery/80_conditions/1_time.md
+++ b/72_machinery/80_conditions/1_time.md
@@ -7,12 +7,10 @@ It can be helpful to **enable or disable Kerberos.io at specific times**. Theref
The parameters of the Time condition can be found in the **config/condition.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
-
@@ -22,4 +20,4 @@ The times property contains a list of times, delimited by a "-". The first item
### Delay
-The delay value is used when the condition failed, so when the current time isn't in the selected time range for that day. In that case Kerberos.io will idle for the specified delay time. The value of the delay is expressed in miliseconds.
\ No newline at end of file
+The delay value is used when the condition failed, so when the current time isn't in the selected time range for that day. In that case Kerberos.io will idle for the specified delay time. The value of the delay is expressed in miliseconds.
diff --git a/72_machinery/80_conditions/2_enabled.md b/72_machinery/80_conditions/2_enabled.md
index 4fbf463..37325b3 100644
--- a/72_machinery/80_conditions/2_enabled.md
+++ b/72_machinery/80_conditions/2_enabled.md
@@ -7,12 +7,10 @@ This condition makes it possible to **disable/enable Kerberos.io**, with a simpl
The parameters of the Time condition can be found in the **config/condition.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
true
5000
-
### Active
@@ -21,4 +19,4 @@ The active field is boolean value (true/false). When the active field is true, K
### Delay
-The delay value is used when the condition failed, so when enabled is set to false. In that case Kerberos.io will idle for the specfied delay time. The value of the delay is expressed in miliseconds.
\ No newline at end of file
+The delay value is used when the condition failed, so when enabled is set to false. In that case Kerberos.io will idle for the specfied delay time. The value of the delay is expressed in miliseconds.
diff --git a/72_machinery/81_algorithms/1_differential_images.md b/72_machinery/81_algorithms/1_differential_images.md
index 9fac70e..18aa8a2 100644
--- a/72_machinery/81_algorithms/1_differential_images.md
+++ b/72_machinery/81_algorithms/1_differential_images.md
@@ -6,7 +6,7 @@ To get a more technical explanation: the algoritm will substract 2 or more image

-In the image above the method of *Collins et al.* is illustrated. For this method we will process three images. The images are a sequence (from left to right), so the first (A) image was taken before the second (B) one, and the second (B) before the third (C) one. Next we will do a first comparision (C-B) of the third (C) image and the second (B) image, and after that we will do a second comparison (C-A) of the third (C) image and first (A) image.
+In the image above the method of *Collins et al.* is illustrated. For this method we will process three images. The images are a sequence (from left to right), so the first (A) image was taken before the second (B) one, and the second (B) before the third (C) one. Next we will do a first comparision (C-B) of the third (C) image and the second (B) image, and after that we will do a second comparison (C-A) of the third (C) image and first (A) image.
After the comparison we will end up with two difference images (C-B) and (C-A); both will mark the white pixels as changed pixels and black as non-changed pixels. To finish the algorithm we will do a logical AND-operation of the two difference images; this will give us the final black and white image ((C-B)&&(C-A)).
@@ -19,12 +19,10 @@ A more detailed explanation can be found [here](http://blog.cedric.ws/opencv-sim
The parameters of the Differential images algorithm can be found in the *config/algorithm.xml* file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
5
20
-
### Erode
@@ -35,6 +33,6 @@ The higher the number of the erode parameter, the more aggressive the eroding wi
### Threshold
-When doing the comparison of two images, we won't end up with a clean black and white image. In most of the cases the values will be between 0 and 255; so gray values. This means that the value **0** will mean that both pixels where the same in both image, and values **255** mean that both pixels where totally different in both images. Of course we will also have values between 0-255, so pixels that are a little bit different in both images. So to make the resulting black and white image, we will need to apply a threshold value.
+When doing the comparison of two images, we won't end up with a clean black and white image. In most of the cases the values will be between 0 and 255; so gray values. This means that the value **0** will mean that both pixels where the same in both image, and values **255** mean that both pixels where totally different in both images. Of course we will also have values between 0-255, so pixels that are a little bit different in both images. So to make the resulting black and white image, we will need to apply a threshold value.
-The threshold will specify how much a pixel has to be different in the two images. So for example when the threshold is 30, it means that the difference between two pixels has to be equal or more then 30. The higher the threshold the more the pixel needs to be different, to be marked as changed.
\ No newline at end of file
+The threshold will specify how much a pixel has to be different in the two images. So for example when the threshold is 30, it means that the difference between two pixels has to be equal or more then 30. The higher the threshold the more the pixel needs to be different, to be marked as changed.
diff --git a/72_machinery/81_algorithms/2_background_subtraction.md b/72_machinery/81_algorithms/2_background_subtraction.md
index b73c5fc..338cee1 100644
--- a/72_machinery/81_algorithms/2_background_subtraction.md
+++ b/72_machinery/81_algorithms/2_background_subtraction.md
@@ -9,7 +9,6 @@ The algorithm is described in [**following paper**](http://personal.ee.surrey.ac
The parameters of the Background images algorithm can be found in the *config/algorithm.xml* file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
true
50
@@ -19,7 +18,6 @@ The parameters of the Background images algorithm can be found in the *config/al
7
20
-
### Shadows
@@ -28,7 +26,7 @@ The shadows parameter is a true or false. By using this parameter you can make t
### History
-This is an integer which tells the system, **the amount of images the system should take into account (history)**, to calculate the background model. The higher the history integer, the more images it will use to calculate the background model. By **increasing the history** you get **a more stable background** model, but a **less flexibl**e. As more images from the past are taken into account, the slower the background model will adapt to a new scenario. E.g. when a car drives into your street, and stands still for 5 minutes.
+This is an integer which tells the system, **the amount of images the system should take into account (history)**, to calculate the background model. The higher the history integer, the more images it will use to calculate the background model. By **increasing the history** you get **a more stable background** model, but a **less flexibl**e. As more images from the past are taken into account, the slower the background model will adapt to a new scenario. E.g. when a car drives into your street, and stands still for 5 minutes.
Finding the ideal history parameters, depends heavily in the application you want to use it. In practice this **is achieved by trial and error**.
@@ -50,4 +48,4 @@ Dilate is exactly the same as the erode parameter, except that it has the revers
### Threshold
-Find a more detailed explanation at the [**Differential images section**](algorithms/Differential_images).
\ No newline at end of file
+Find a more detailed explanation at the [**Differential images section**](algorithms/Differential_images).
diff --git a/72_machinery/82_expositors/1_rectangle.md b/72_machinery/82_expositors/1_rectangle.md
index 9a1194a..647578e 100644
--- a/72_machinery/82_expositors/1_rectangle.md
+++ b/72_machinery/82_expositors/1_rectangle.md
@@ -7,7 +7,6 @@ This rectangle is a trivial expositor. A rectangle region can be defined to cons
The parameters of the rectangle expositor can be found in the **config/expositor.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
0
@@ -16,10 +15,9 @@ The parameters of the rectangle expositor can be found in the **config/expositor
720
-
### Region
-The region parameter contains 4 values; x1, y1, x2 and y2 respectively. The values x1 and y1 indicate the x- and y-coordinate of the left upper starting point. The values x2 and y2 are the bottom right coordinates. A virtual rectangle will be drawn from (x1,y1) to (x2,y2). Pixels of interest that lie within this rectangle are valid pixels; if not they are invalid.
\ No newline at end of file
+The region parameter contains 4 values; x1, y1, x2 and y2 respectively. The values x1 and y1 indicate the x- and y-coordinate of the left upper starting point. The values x2 and y2 are the bottom right coordinates. A virtual rectangle will be drawn from (x1,y1) to (x2,y2). Pixels of interest that lie within this rectangle are valid pixels; if not they are invalid.
diff --git a/72_machinery/82_expositors/2_hull.md b/72_machinery/82_expositors/2_hull.md
index af079fe..3475a91 100644
--- a/72_machinery/82_expositors/2_hull.md
+++ b/72_machinery/82_expositors/2_hull.md
@@ -9,14 +9,12 @@ This hull is a more complex expositor than the rectangle. A hull can be selected
The parameters of the hull expositor can be found in the **config/expositor.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
347,361|627,266|975,328|1091,328|1148,413|1158,516|1121,534|962,567|699,648|531,700|243,613|423,550|665,453|850,470|666,361|467,385|325,460|165,372
-
### Region
-The region parameter contains n values. Each value represents a coordinate (x,y) and are seperated by the "|" delimiter. These coordinates are used to calculate the concave hull. Pixels of interest that lie within the concave hull are valid pixels; if not they are invalid.
\ No newline at end of file
+The region parameter contains n values. Each value represents a coordinate (x,y) and are seperated by the "|" delimiter. These coordinates are used to calculate the concave hull. Pixels of interest that lie within the concave hull are valid pixels; if not they are invalid.
diff --git a/72_machinery/83_heuristics/1_sequence.md b/72_machinery/83_heuristics/1_sequence.md
index 806276c..b224728 100644
--- a/72_machinery/83_heuristics/1_sequence.md
+++ b/72_machinery/83_heuristics/1_sequence.md
@@ -1,19 +1,17 @@
# Sequence
-This is a trivial heuristic. The sequence heuristic will store a single integer in memory, that will count the numbers of valid detections. When the heuristic will detect a false detection, it will decrease the count. The sequence heuristic will return true, if a threshold is reached; for example when something was detected three times in a row.
+This is a trivial heuristic. The sequence heuristic will store a single integer in memory, that will count the numbers of valid detections. When the heuristic will detect a false detection, it will decrease the count. The sequence heuristic will return true, if a threshold is reached; for example when something was detected three times in a row.
## Parameters
The parameters of the Sequence heuristic can be found in the **config/heuristic.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
+
-
1
1
2000
-
@@ -27,4 +25,4 @@ The minimum number of detections in a row to be a valid detection.
### No motion delay time
-When the heuristic failed, due to not enough pixels changed or not x detections in a row, the heuristic will idle for some time.
\ No newline at end of file
+When the heuristic failed, due to not enough pixels changed or not x detections in a row, the heuristic will idle for some time.
diff --git a/72_machinery/83_heuristics/2_counter.md b/72_machinery/83_heuristics/2_counter.md
index 76afa2a..c6a1a60 100644
--- a/72_machinery/83_heuristics/2_counter.md
+++ b/72_machinery/83_heuristics/2_counter.md
@@ -4,7 +4,7 @@

-The quality of the Counter heuristic depends heavily on the accurancy of the chosen algorithm (Differential, Background subtraction, etc). Therefore **we recommend** to use the **Background Subtraction algorithm** as this is the most accurate one; the algorithm is used for segmentation and it will distinguish background and foreground.
+The quality of the Counter heuristic depends heavily on the accurancy of the chosen algorithm (Differential, Background subtraction, etc). Therefore **we recommend** to use the **Background Subtraction algorithm** as this is the most accurate one; the algorithm is used for segmentation and it will distinguish background and foreground.
After the algorithm did its magic, the segmented image is used by the Counter heuristic to calculate some features: the **center of mass** is calculated for each foreground segment, and is stored in memory together with the height and width of the segment. By using the coordinates of the center of mass a trajectory is calculated.
@@ -19,7 +19,7 @@ While the capture device is taking images, the counter heuristic will calculate
The idea of the feature list is that it contains the trajectory of an object which is moving from one point to another (a person walking by). A feature list exists for every moving object in the viewport of the camera and each feature list contains the sequence of center of masses (the x- and y-coordinates of the object).
-After the center of masses are calculated, existing feature lists are expanded or new feature lists are created (the start of a new object). By using the feature lists, **the direction of the moving objects** can be calculated, as it contains the initial center of mass and the last found center of mass.
+After the center of masses are calculated, existing feature lists are expanded or new feature lists are created (the start of a new object). By using the feature lists, **the direction of the moving objects** can be calculated, as it contains the initial center of mass and the last found center of mass.

@@ -28,9 +28,8 @@ As we know the trajectory of an object (and thus its direction), the intersectio
## Parameters
The parameters of the Counter heuristic can be found in the **config/heuristic.xml** file, but you can also use the web to modify the parameters. Below you see a default configuration file.
-
+
-
5
90
@@ -40,7 +39,6 @@ The parameters of the Counter heuristic can be found in the **config/heuristic.x
1000
100,100|100,200|200,100|200,200
-
### Appearance
@@ -85,4 +83,4 @@ The whole point of the counter heuristic is counting objects. Therefore when one
'token' : 695,
'pathToImage' : '1465894497_5-97451_frontdoor_618-317-703-493_5446_695.jpg',
'instanceName' : 'frontdoor',
- ]
\ No newline at end of file
+ ]
diff --git a/72_machinery/84_Outputs/1_disk.md b/72_machinery/84_Outputs/1_disk.md
index 89cd227..7f57a34 100755
--- a/72_machinery/84_Outputs/1_disk.md
+++ b/72_machinery/84_Outputs/1_disk.md
@@ -7,15 +7,13 @@ An image can be saved to disk.
The parameters of the Disk 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.
-
timestamp_microseconds_instanceName_regionCoordinates_numberOfChanges_token.jpg
/etc/opt/kerberosio/capture/
false
white
false
-
-
+
### File format
@@ -44,4 +42,4 @@ The privacy mode can be activated to remove some parts from the image. This espe
After updating the configuration, you'll see that the pixels outside your region of interest (ROI) are made black; the image below illustrates this.
-
\ No newline at end of file
+
diff --git a/72_machinery/84_Outputs/1_video.md b/72_machinery/84_Outputs/1_video.md
index 8fc5631..10ebca1 100755
--- a/72_machinery/84_Outputs/1_video.md
+++ b/72_machinery/84_Outputs/1_video.md
@@ -7,22 +7,20 @@ When a valid event is detected, a video will be recorded for x seconds. When mor
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.
-
-
-
+
### FPS
diff --git a/72_machinery/84_Outputs/2_TCP_client.md b/72_machinery/84_Outputs/2_TCP_client.md
index 302906e..cbb75f0 100755
--- a/72_machinery/84_Outputs/2_TCP_client.md
+++ b/72_machinery/84_Outputs/2_TCP_client.md
@@ -1,19 +1,17 @@
# TCP/IP client
-The TCP/IP client will send a TCP packet to a server.
+The TCP/IP client will send a TCP packet to a server.
## Parameters
The parameters of the TCP/IP client 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.
-
127.0.0.1
1337
it's so fluffy
-
### Server
@@ -30,4 +28,4 @@ You can send some data to a TCP server.
## Examples
-More information can be found [here](/addons/TCP_Listener).
\ No newline at end of file
+More information can be found [here](/addons/TCP_Listener).
diff --git a/72_machinery/84_Outputs/3_GPIO.md b/72_machinery/84_Outputs/3_GPIO.md
index 67c68ab..35cfce9 100755
--- a/72_machinery/84_Outputs/3_GPIO.md
+++ b/72_machinery/84_Outputs/3_GPIO.md
@@ -7,13 +7,11 @@ A GPIO pin can be set as output device.
The parameters of the GPIO pin 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
5
100000
-
### Pin
@@ -26,4 +24,4 @@ The number of times the pin will be triggered.
### Period time
-The time in microseconds that the pin will be set *high*.
\ No newline at end of file
+The time in microseconds that the pin will be set *high*.
diff --git a/72_machinery/84_Outputs/4_webhook.md b/72_machinery/84_Outputs/4_webhook.md
index f670d15..aaa7323 100755
--- a/72_machinery/84_Outputs/4_webhook.md
+++ b/72_machinery/84_Outputs/4_webhook.md
@@ -8,11 +8,9 @@ Detailed information (a JSON object) is send as a POST request to a webhook. The
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.
-
- http://kerberos.web/api/v1/webhook
-
-
+ http://kerberos.web/api/v1/webhook
+
### Url
@@ -31,4 +29,4 @@ A JSON object is POSTed to the url you've defined.
'token' : 695,
'pathToImage' : '1465894497_5-97451_frontdoor_618-317-703-493_5446_695.jpg',
'instanceName' : 'frontdoor',
- ]
\ No newline at end of file
+ ]
diff --git a/72_machinery/84_Outputs/5_script.md b/72_machinery/84_Outputs/5_script.md
index a78f281..4c9a5ca 100755
--- a/72_machinery/84_Outputs/5_script.md
+++ b/72_machinery/84_Outputs/5_script.md
@@ -7,11 +7,9 @@ A bash script can be executed after a valid event was detected. A JSON object is
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.
-
-
### Path
@@ -23,23 +21,18 @@ The location of the script that will be executed on detection.
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']")
diff --git a/72_machinery/92_streaming.md b/72_machinery/92_streaming.md
index 1451b1b..c236d3c 100644
--- a/72_machinery/92_streaming.md
+++ b/72_machinery/92_streaming.md
@@ -7,7 +7,6 @@ The machinery has the ability to stream your capture device as a MJPG stream.
The parameters for the supported streaming protocols can be found in the *config/stream.xml* file, but you can also use the web to modify the parameters. Below you see a default configuration file; at the moment of writing only a MJPG stream is supported.
-
true
8889
@@ -15,7 +14,6 @@ The parameters for the supported streaming protocols can be found in the *config
75
-
@@ -35,4 +33,4 @@ The quality is a value between [0-100]. The lower the quality, the more the imag
You can **secure** the MJPEG streaming **with a username and password**. These credentials will be used to authorize your requests using **Basic Authentication**. Please note that once enabled, the live stream on the dashboard page can fail; however it will work if you open it directly in your browser or ip camera client. The format of the streaming url, after authentication enabled, will look as following:
- http://username:password@ip-camera:8899
+ http://username:password@ip-camera:8899
diff --git a/73_addons/1_TCP_Listener.md b/73_addons/1_TCP_Listener.md
index 6fb2a96..1152b47 100644
--- a/73_addons/1_TCP_Listener.md
+++ b/73_addons/1_TCP_Listener.md
@@ -8,7 +8,7 @@ One of the addons you can use in combination with Kerberos.io is a TCP Listener.
You can use **nodejs** to build a simple TCP server, this is a lot easier than if we would have to do it in C; but ofcourse that's also possible. A cool feature would be to use the **say.js** library. You can use **say.js** on OSX/Linux to execute speech to text. So you could send a message from the Kerberos.io instance to the node TCP server, and on receiving the message you could make your TCP server speak.
-For example you can configure the Kerberos.io TCP client with a message "There's someone at the frontdoor". When Kerberos.io detects something it will execute the TCP client and send a TCP packet - which includes the message - to the predefined IP address of the TCP server, afterwards the TCP server will use the say.js library to actually say the message.
+For example you can configure the Kerberos.io TCP client with a message "There's someone at the frontdoor". When Kerberos.io detects something it will execute the TCP client and send a TCP packet - which includes the message - to the predefined IP address of the TCP server, afterwards the TCP server will use the say.js library to actually say the message.
@@ -18,60 +18,53 @@ Install npm
Create a new node file
- nano listener.js
+ nano listener.js
and copy-paste the code below
- // Import libraries
- var net = require('net');
- var say = require('say');
- require('date-utils');
-
- // Variables
- var listenerPort = 1337;
- var time1 = new Date();
-
- net.createServer(function (socket)
- {
- // Handle incoming messages from the magnet controller.
- socket.once('data', function (data)
- {
- var time2 = new Date();
- var timeBetween = time1.getSecondsBetween(time2);
- if(timeBetween > 30)
- {
- say.speak('Victoria', data);
- }
-
- time1 = time2;
- });
-
- }).listen(listenerPort);
-
- // Put a friendly message on the terminal of the server.
- console.log("Kerberos.io listener running at port 1337\n");
+ // Import libraries
+ var net = require('net');
+ var say = require('say');
+ require('date-utils');
+ // Variables
+ var listenerPort = 1337;
+ var time1 = new Date();
+ net.createServer(function (socket)
+ {
+ // Handle incoming messages from the magnet controller.
+ socket.once('data', function (data)
+ {
+ var time2 = new Date();
+ var timeBetween = time1.getSecondsBetween(time2);
+ if(timeBetween > 30)
+ {
+ say.speak('Victoria', data);
+ }
+ time1 = time2;
+ });
+ }).listen(listenerPort);
+ // Put a friendly message on the terminal of the server.
+ console.log("Kerberos.io listener running at port 1337\n");
Run script
- node listener.js
-
+ node listener.js
+
### Pushbullet notifications
You can expand the Text-To-Speech feature (described above), with pushbullet notifications. Pushbullet is a free notifcation service, which you can use to send messages to your devices; smartphone, tablet, and/or workingstation. You can download the pushbullet node library with **npm**, and use it in the TCP listener.
- npm install pushbullet
+ npm install pushbullet
When the library is installed correctly, you can use following code in the TCP listener.
- var PushBullet = require('pushbullet');
-
- var pusher = new PushBullet('your key');
-
- pusher.devices(function(error, response)
- {
- var devices = response.devices;
- devices.forEach(function(device)
- {
- pusher.note(device.device_iden, "Kerberos.io: " + data.toString(), data.toString());
- });
- });
+ var PushBullet = require('pushbullet');
+ var pusher = new PushBullet('your key');
+ pusher.devices(function(error, response)
+ {
+ var devices = response.devices;
+ devices.forEach(function(device)
+ {
+ pusher.note(device.device_iden, "Kerberos.io: " + data.toString(), data.toString());
+ });
+ });