{"id":5028,"date":"2025-11-28T08:00:02","date_gmt":"2025-11-28T16:00:02","guid":{"rendered":"https:\/\/www.cloudacm.com\/?p=5028"},"modified":"2025-11-27T23:09:29","modified_gmt":"2025-11-28T07:09:29","slug":"influxdb-and-grafana-with-node-red-data-from-mqtt-iot-topics","status":"publish","type":"post","link":"https:\/\/www.cloudacm.com\/?p=5028","title":{"rendered":"InfluxDB and Grafana with Node-Red data from MQTT IoT topics"},"content":{"rendered":"<p>In this post, I&#8217;ll be providing a high level view of IoT data gathering, processing, and presentation. The post won&#8217;t contain exact details that may pertain to your needs, but this overview should cover most items to get started.<\/p>\n<p>This video demonstration steps through the process of setting up InfluxDB for use with Node-Red.<\/p>\n<p><iframe loading=\"lazy\" title=\"How to Connect Node-Red with InfluxDB v2.0 | Latest Method\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/VlSmUEcJyvg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>It is followed up with another video that continues with Grafana integration with InfluxDB.<\/p>\n<p><iframe loading=\"lazy\" title=\"Connect Node-RED with InfluxDB and Grafana dashboards: EASY Guide\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/7t62iu3W7Y4?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>I found these demonstrations to be concise and to the point. IoT devices can publish their data topics to a MQTT Broker. Node-Red can subscribe to those topics and pass them along to InfluxDB. Grafana can query InfluxDB to display the data in a quick and broad way. Here is a simplified diagram view of that environment.<\/p>\n<p><a href=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2025\/11\/IoT-Network-Services-Diagram.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5030\" src=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2025\/11\/IoT-Network-Services-Diagram.png\" alt=\"\" width=\"739\" height=\"510\" srcset=\"https:\/\/www.cloudacm.com\/wp-content\/uploads\/2025\/11\/IoT-Network-Services-Diagram.png 739w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2025\/11\/IoT-Network-Services-Diagram-300x207.png 300w, https:\/\/www.cloudacm.com\/wp-content\/uploads\/2025\/11\/IoT-Network-Services-Diagram-391x270.png 391w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><\/a>First we&#8217;ll need a MQTT Broker for the IoT device to publish its data to. I used these commands to set up the service on Linux.<\/p>\n<pre>sudo apt install -y mosquitto\r\nsudo systemctl enable mosquitto.service\r\nsudo service mosquitto restart\r\nexit<\/pre>\n<p>Validating that the services work can be done with these commands on another Linux host.<\/p>\n<pre>Subscribe to a topic from the MQTT Broker\r\nmosquitto_sub -h &lt;mqtt-broker-ip-address&gt; -p &lt;mqtt-broker-port&gt; -v -t \"Device\/Message\"\r\n\r\nPublish a test topic to the MQTT Broker\r\nmosquitto_pub -h &lt;mqtt-broker-ip-address&gt; -p &lt;mqtt-broker-port&gt; -t \"Device\/Message\" -m \"Testing testing 1 2 3\"<\/pre>\n<p>Next, Node-Red will need to be setup. I used these commands for installation.<\/p>\n<pre>sudo apt install build-essential git curl\r\nbash &lt;(curl -sL https:\/\/raw.githubusercontent.com\/node-red\/linux-installers\/master\/deb\/update-nodejs-and-nodered)\r\nsudo systemctl start nodered.service &amp;&amp; sudo systemctl enable nodered.service\r\nsudo systemctl status nodered.service\r\nexit<\/pre>\n<p>From there, the flows can be created to interface MQTT subscriptions to InfluxDB data buckets. The following command was used to install InfluxDB on Linux.<\/p>\n<pre>sudo tee \/etc\/apt\/sources.list.d\/influxdb.list&lt;&lt;EOF\r\ndeb [signed-by=\/usr\/share\/keyrings\/influxdb-keyring.gpg] https:\/\/repos.influxdata.com\/ubuntu jammy stable\r\nEOF\r\ncurl -fsSL https:\/\/repos.influxdata.com\/influxdata-archive_compat.key|sudo gpg --dearmor -o \/usr\/share\/keyrings\/influxdb-keyring.gpg\r\nsudo apt update\r\nsudo apt install influxdb2\r\nsudo systemctl start influxdb &amp;&amp; sudo systemctl enable influxdb\r\nsudo systemctl status influxdb<\/pre>\n<p>The Grafana installation steps are provided by the Grafana team, <a href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/setup-grafana\/installation\/debian\/#2-start-the-server\">https:\/\/grafana.com\/docs\/grafana\/latest\/setup-grafana\/installation\/debian\/#2-start-the-server<\/a>.<\/p>\n<p><iframe loading=\"lazy\" title=\"Install Grafana in Debian and Ubuntu | Grafana\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/_Zk_XQSjF_Q?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>Hopefully this will provide you with footing on the complex topic of IoT.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, I&#8217;ll be providing a high level view of IoT data gathering, processing, and presentation. The post won&#8217;t contain exact details that may pertain to your needs, but this overview should cover most items to get started. This video demonstration steps through the process of setting up InfluxDB for use with Node-Red. It is followed up with another video that continues with Grafana integration with InfluxDB. I found these demonstrations to be concise and to the point. IoT&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.cloudacm.com\/?p=5028\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5028","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/5028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5028"}],"version-history":[{"count":5,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/5028\/revisions"}],"predecessor-version":[{"id":5033,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=\/wp\/v2\/posts\/5028\/revisions\/5033"}],"wp:attachment":[{"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudacm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}