Here we compare two major OGC Sensorthings implementaions. Go-Sensorthings (GOST) release V0.5 ( docker release on 05-Mar-2018) vs FRaunhofer Opensource SensorThings Server (FROST) release V1.6 (docker release on 05-Mar-2018).
|License||LGPL||MIT||MIT is bit relaxed than LGPL in redistribution|
|Compliance to OGC|
|FROST is compliant|
|Docker image sizes||582MB||14.2MB|
|Memory usage idle||463.1MiB||13.7MB|
The goal of this Hackaton is to become familiar with several LinkSmart components and at the same time, create something useful.
In the following steps we will setup the DHT Adafruit Library and LinkSmart Device Gateway on a Raspberry Pi 3 in order to read measurements from a DHT22 sensor and publish them in SenML format to a MQTT broker.
1) Setup the DHT Library
- Install the latest stable Docker for debian-stretch (armhf).
- Follow the instructions here (Tip: stretch>jessy>wheezy). Too lazy to follow instructions? Skip to step c.
Optional: Post-installation (Manage Docker as a non-root user), so that docker commands run without
- Click here to expand...
If you didn't go through steps a and b. Run the following commands:
Log out and log in. Then to verify that Docker CE is installed correctly, run the hello-world image. This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
Create and enter the directory structure
Download Adafruit_DHT_SenML.py. This script reads temperature and humidity values from a DHT sensor and prints the measurements in SenML format. (You need appropriate drivers to run it)
Use the following command to download an image with DHT drivers and runs it once. The command tries to read from a
DHT22sensor with data pin connected to
GPIO 4and SenML basename
bn/. Remove these arguments to see usage instructions.
The SenML output should be similar to:
2) Deploy Device Gateway
We'll use the DHT library container to run Device Gateway.
Follow instructions in previous section to get the DHT Library docker container working.
Download and configure Device Gateway: https://docs.linksmart.eu/display/DGW.
(In this example, we use
device-gateway-linux-armand create a timer that executes the python script for getting measurements every 120 seconds.) After downloading the file, make it executable.
Configure the DGW service. Modify (replace <name> with the device hostname, e.g. linksmart-cyan) and place in
Configure the device agent. Modify (replace <name>s with the device hostname, e.g. linksmart-cyan) and place in
With the above configuration, Device Gateway executes the Python script every 120 seconds and exposes the resulting data over two protocols:
MQTT: Publishes the sensor data to the given topic. The MQTT broker was configured in previous step.
- REST: Exposes a REST endpoint to GET the latest collected data. The HTTP server was configured in the previous step. E.g for getting data:
Run the container:
It should be in priviledged mode in order to access Raspberry Pi GPIO.
If there were no errors, make a container that starts after boot and runs in detached mode (background):
Refer to docker run reference to understand the given arguments.