How to visualize in live the data from InfluxDB

Hi all,

I use InfluxDB v2.1.1 and Grafana v8.4 in docker. Sensors data are pushed from an embedded electronic module. I use a C# Influxdb client with the line protocol.
I can refresh the dashboard every 5s and see the new data from InfluxDB.
What is the best solution to get a “live stream” the sensors data from InfluxDB ?

BR,
Pat

welcome to the :grafana: forum, @patopat

here is some documentation on Grafana Live, plus a small tutorial:

Hi Matt,

Could you say me what tools/plugins I need to use to achieve the live streaming from InfluxDB to Grafana ? I’m novice and there are a lot of plugins, so if you could enumerate all tools I need then I can learn the right ones.

From your previous answer the telegraph is needed I guess. So InfluxDB, Grafana, telegraph and …?

Best regards,
Pat

Hi,

Anyone can help me ?

From my PLC I send sensor measurements to InfluxDB, then I connect Grafana to show data at 5s refresh rate. What is the best plug-ins or tools to view in “live” the data ?

Best regards,
Pat

1 Like

Hi Grant2,

In case I also would like to store data on InfluxDB, so have both store and live streaming ?

Thank you for your previous answer.

Best regards,
Pat

I do that exact thing…store the data in InfluxDB and stream the data live via MQTT. I set up each of my Grafana panels to use one of these 2 data sources.

My signal chain looks like this:

  1. device sends data (e.g. thermocouple, RS232 device, Modbus data, etc.) is received via Node-RED. There are thousands of Nodes and it’s easy to get going. Their forums are great too.
  2. Node-RED publishes data to InfluxDB (say, once a minute) and simultaneously sends data (say, once a second) to an MQTT broker.
  3. Grafana’s datasources are set up with InfluxDB and MQTT. Select the source and you can see the data (historical, i.e. Influx or live, i.e. MQTT).
1 Like

Hi Grant2,

Thank you for sharing your data path.

I’m using C# InfluxDB client to send data to InfluxDB and I was wondering if InfluxDB has an MQTT client ?

My idea is that InfluxDB and Grafana could subscribe to the same broker ?

Best regards,
Pat

Hi @patopat

Yes, InfluxDB and Grafana should be able to subscribe to the same MQTT broker so long as you use a plugin like this…The MQTT Consumer Telegraf Input Plugin reads from specified MQTT topics and adds messages to InfluxDB. Messages are in the Telegraf input data formats. This plugin reads from specified MQTT topics and adds messages to InfluxDB. The plugin expects messages in the Telegraf Input Data Formats.

More here.

1 Like

Hi @grant2,

All parts are working well except the Grafana MQTT plugin.
I use Docker desktop for Windows, all containers (Mosquitto, Telegraf, InfluxDB, Grafana) are working well :

  • My C# application publish data in format “InfluxDB line protocol” to the Mosquitto Broker
  • Telegraf subscribes to the Mosquitto Broker and it send data to the InfluxDB.

The missing part is: how to get the MQTT plugin working in Grafana in my docker ?

Best regards,
Pat

Installing the MQTT datasource plugin was not a straightforward exercise for me. I understand nothing about Go, Mage, etc and had to seek help on this forum to get it done.

If you have not already searched and/or posted, please do so and I am sure you can get it installed on Docker.

@grant2

I opened a new post How install MQTT plugin in container and I successfull installed the MQTT plugin in Docker/container.
Thanks.