Overview

The interesting part, from a developer’s perspective, begins here. Let’s take a look at the project’s schema.

Project's schema

A Raymarine Arm Wind Vane is connected to a KingPigeon/BLIIOT M100T Modbus module. The wind vane outputs the wind direction through two analog outputs that correspond to the sine and cosine of the wind angle.

The wind vane is connected to the Modbus module in order to provide three Modbus registers: the cosine of the wind direction’s angle, the sine of the wind direction’s angle and a counter. From these, we need to deduce an angle and a speed.

We want the wind direction and speed to be continuously output and displayed on a dashboard. We will use Grafana to setup a dashboard for that purpose.

The point of the tutorial is to develop and package application bindings (for more details, refer to Application Framework Bindings) so that the value of Modbus registers are read and converted to human-readable values (angle and speed), published to a timeseries into Redis and dispayed in a Grafana dashboard.

While modbus-binding, and redis-tsdb-binding are services already available in the Application Framework Binder, we will have to develop a small custom binding that does the value conversion and publish them into Redis.

We will cover in this part how to configure the Modbus binding for our needs and how to write a small custom binding in Python.