Remembering Thoughts
  Twitter GitHub RSS

Azure IoT Edge - using Grafana on the Edge

Series

Part 1 - dotnet vs python vs node - temperature emission - who is cooler?
Part 2 - Developing modules
Part 3 - Custom Containers using Apache Nifi
Part 4 - Custom Module using TimescaleDB
Part 5 - Custom Module using Grafana

Intro

This is part 5 in a series starting here that runs through building an Azure IOT Edge solution. This post will run through setting up Grafana to visualise temperature readings sent from the dot net, python and node custom edge modules.

The code is located at: https://github.com/chrismckelt/edgy

Grafana is the open source analytics and monitoring solution for every database

Steps to add the module

1. add a new custom module 

2. add a new deployment file just for Grafana (and amend the full solution file)

3. create the docker file

FROM grafana/grafana:latest
# login with admin and below password to web interface
ENV GF_SECURITY_ADMIN_PASSWORD [YOUR_GRAFANA_PASSWORD_HERE]
ENV GF_AUTH_LDAP_ENABLED=false
ENV GF_DATABASE_TYPE postgres
ENV GF_DATABASE_HOST timescaledb
ENV GF_DATABASE_NAME grafana
ENV GF_DATABASE_USER grafana
ENV GF_DATABASE_PASSWORD [YOUR_DATABASE_PASSWORD_HERE]
COPY ldap.toml /etc/grafana/
COPY custom.ini /etc/grafana/

4. create the custom.ini

make sure to enter the database password on line 75

5. build and run IoT Edge solution in simulator

6. Navigate to http://localhost:8082/ and login (admin + your grafana password)

The Grafana setup board should appear as below

7. Add data source –> PostgreSQL

8. Add a dashboard query & set the query as below

A time series graph will display the 3 temperature readings over time.

Outro

Here we have added Grafana to our IoT Edge solution and created a dashboard from the data stored in TimescaleDB. The generated temperature sent from the 3 modules is analysed by Apache Nifi. When the temperature is greater than 25 degrees a request is sent back to the specific module to activate the air conditioner, which makes the temperature randomly decrease over time.

Think I would prefer the Python room as it appears the coolest   Smile


Published:

Share on Twitter