DEV Community

Chris McKelt
Chris McKelt

Posted on • Originally published at blog.mckelt.com on

4 2

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!

Image of AssemblyAI tool

Transforming Interviews into Publishable Stories with AssemblyAI

Insightview is a modern web application that streamlines the interview workflow for journalists. By leveraging AssemblyAI's LeMUR and Universal-2 technology, it transforms raw interview recordings into structured, actionable content, dramatically reducing the time from recording to publication.

Key Features:
🎥 Audio/video file upload with real-time preview
🗣️ Advanced transcription with speaker identification
⭐ Automatic highlight extraction of key moments
✍️ AI-powered article draft generation
📤 Export interview's subtitles in VTT format

Read full post

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay