grafana with azure iot hub and esp32

108 views Asked by At

I am a beginner using grafana, here I’m trying to use grafana and azure monitor to read data and visualize in dashboard. The data I’m getting is from azure IoT hub and a device receiving temperature data in json format e.g ; {“temp”:25}. I configured azure monitor and app registration and successfully integrated with azure monitor but how to read this particular data and display it in dashboard.

configured Grafana and from azure side did role assignment and app registrations. slelected logs and tried the below query.

devices | where deviceId == 'ESPDEVICE01' and measureName == 'temp' | project value

1

There are 1 answers

0
Naveen Sharma On

Azure IoT Hub doesn’t act as Telemetry database for querying the data. Indeed it’s storing the data for the specified time defined in the retention policy but you don’t have a direct access to it from the portal. To get the data you can do the following -

  • Create a Message Route on the Device Telemetry Messages that will route your messages to an external storage

  • Create an Azure Function with IoT Hub trigger that will get the messages and then you can programmatically route them.

  • Use tools like Azure IoT Device Explorer

  • Use the EventProcessorHost library to get the data

  • Another method is log the data / message data to Application Insights which being send to azure IoT Hub

    • The sample code for monitoring services with Application Insights and sending message data from Azure IoT Hub to Application Insights is taken from the following docs:
  • Send cloud-to-device messages with IoT Hub

  • Monitor services and apps with Application Insights.

enter image description here

enter image description here

enter image description here