Post series on integrating Tinkerforge Bricklets like Humidity Bricklet 2.0 and Segment Display 4×7 Bricklet to Eclipse IoT. The aim of this project is to send telemetry data from the Bricklet to Eclipse Kapua using Eclipse Kura as Gateway, while additionally sending commands from Eclipse Kapua to the Segment Display 4×7 Bricklet to display a few numbers.
What we want to achieve
When working in IIoT it´s all about sending large amounts of telemetry data from a machine to the cloud where the data can be further processed, analyzed and visualized. Furthermore we want to send commands back to the machine to influence the behavior of the machine.
Our simple example here will transport humidity readings from a sensor to the cloud and display numbers on a LCD received from the cloud. So a quite simple approach that is not to far away from a real scenario.
What you need
Before we can start to assemble our sensors, configure our edge gateway and implement our storage cloud infra structure we need to setup an architecture to support our aims.
We´ve chosen the sensors from Tinkerforge. An excellent provider for reliable products that are easy to access and assemble. If you´re keen enough to follow all of the parts of this post series, you need at least the following 3 bricklets: Tinkerforge Master Brick 2.1, Segment Display 4×7 Bricklet and Humidity Bricklet 2.0. These bricklets will cover the sensor reading discipline.
The gateway will be realized on a Raspberry Pi (RPi), the RPi 3 will be connected to the Master Brick 2.1 and Ethernet/Wireless and will run Eclipse Kura 4.1 as a IoT Gateway solution to connect the sensor network to the cloud.
The IoT cloud platform will be Eclipse Kapua 1.0.7 running on Openshift OKD. Openshift is totally optional and not mandatory. We will also run Grafana on Openshift for Data Visualization.
These posts will not describe how-to install Eclipse Kura, Eclipse Kapua or Grafana and we will assume that you´re able to setup these requirements.
Prerequirements for this project are:
- RaspberryPi with Raspbian and Eclipse Kura 4.1
- Tinkerforge Master Brick 2.1 and Humidity Bricklet 2.0
- Python 2.7 with PIP
- Eclipse Kapua instance
- Grafana instance
- Raspberry Pi 2,3,4
- Tinkerforge Master Brick 2.1, Segment Display 4×7 Bricklet and Humidity Bricklet 2.0
Setting up the hardware
We have reduced the list of hardware elements needed for this project to a minimum in order to make assembly as simple as possible. The hardware setup should be really just take a couple of minutes. Just connect the Raspberry Pi to the Master Brick and connect the Master Brick with the two bricklets.
Prepare Tinkerforge Brick Daemon
Before we can use the Tinkerforge Bricklets to read temperature and humidity, we need to prepare the Brick Daemon and retrieve the ID of the connected Humidity Bricklet 2.0.
At first we need to download the latest release of the Brick Daemon for the armhf architecture. All of the required downloads can be found on download section on Tinkerforge Homepage.
The Brick Daemon will be automatically started and detect the connected Master Brick. The blue LEDs on the Master Brick should light up. Now we need to retrieve the ID for the connected bricklets. To do this, we could use the Brick Viewer application available for Linux, macOS, Windows. But we will stick to the shell and use the Shell Binding.
To install the Shell Binding follow these steps.
Now you can use the command
tinkerforge enumerate to retrieve a list of all connected bricklets. The output of this command should look like the following. But it will depend on your Tinkerforge setup.
Just search the output for the
device-identifier=humidity-v2-bricklet and note down the uid from this block. In the example give we would note down the uid with the value HrY. We need this uid to retrieve values from the sensor.
Go on to the next article where we will show how-to use mqtt to transfer telemetry data from the sensor to Eclipse Kura and Eclipse Kapua.