Email Us at [email protected]

Download N3uron

Back to videos

MQTT Client / Publishing Data to InfluxDB with MQTT Client

Publishing Data to InfluxDB with MQTT Client

Description

In this video of our N3uron Academy, we are going to publish wind turbine analog sensor data for gearbox temperature, shaft bearing temperature, and wind speed using N3uron’s MQTT Client module to an InfluxDB instance. Let’s get started!

  • [05:06] Publishing Data to InfluxDB with MQTT Client

Transcription

[00:00] Hello everyone! In this video, we are going to publish wind turbine analog sensor data for gearbox temperature, shaft bearing temperature, and wind speed using N3uron’s MQTT Client module to an InfluxDB instance. To follow along, make sure you have an InfluxDB account, along with the Telegraf program installed, which we will use to collect and process MQTT data before storing it in InfluxDB. First, let’s create a new MQTT Client module in N3uron. Navigate to the “Config” tab, select “Modules,” and click on “New Module”. Assign a name such as “MqttClient” and set the Module type to “MqttClient”. Save the configuration. Now, select the newly created MQTT Client module in the Explorer panel and click on the module header menu.

[01:00] Choose “New Connection” and name it “mosquitto”, for example. Since we want to establish a secure connection, we will provide authentication credentials and a certificate. Enter the username and password, and upload the required certificate file. Next, let’s create a new publisher agent within the Mosquitto broker connection. Click on “New Agent” and select “Publisher”. Set the topic to “Turbine_Data” and configure the publishing interval to 5000ms to send data updates every five seconds. Change the “Message Format” serialization option to “InfluxDB,” which ensures that the data structure is compatible with InfluxDB’s time-series format.

[02:03] Provide a measurement name, such as “TurbineMeasurements,” and create a filter to select the tags to be published. Save the configuration. Now that everything is set up, let’s verify that data is flowing correctly. In the N3uron WebUI, navigate to the “Diagnostics” tab and check the “MQTT Client” module logs to confirm successful publishing. Next, let’s move on to configuring InfluxDB to receive MQTT data. Log in to your InfluxDB Cloud account and navigate to the “Telegraf” section. Click on “Create Configuration” and choose the bucket where the data will be stored, in this case, “N3uron”. Next, select “MQTT Consumer” as the input plugin. Configure the MQTT Consumer by specifying the broker URL, setting the topic filter to “Turbine_Data” so that only relevant messages are ingested, entering the username and password, and specifying the path to certificates for a secure connection.

[03:13] Ensure that the data format is set to “Influx” to match the message serialization from the N3uron MQTT Client. Save and apply the configuration. Next, we will set an environmental variable for INFLUX_TOKEN. The example provided by InfluxDB is for Unix-like operating systems using the export command, but in Windows PowerShell, we will use the setx command followed by the environmental variable name, in this case, INFLUX_TOKEN, and then the token string. After setting the environmental variable, we verify its creation. Then open a new terminal to launch the Telegraf agent using the command provided by InfluxDB. After this, navigate to the N3uron bucket, select the correct measurement, and select the tags and fields.

[04:34] As we can see, the data is successfully published from N3uron to InfluxDB. And that’s it! We have successfully configured the N3uron MQTT Client to publish data to InfluxDB. Thanks for watching, and see you in the next video!

Privacy Settings
We use cookies to enhance your experience while using our website. If you are using our Services via a browser you can restrict, block or remove cookies through your web browser settings. We also use content and scripts from third parties that may use tracking technologies. You can selectively provide your consent below to allow such third party embeds. For complete information about the cookies we use, data we collect and how we process them, please check our Privacy Policy
Youtube
Consent to display content from - Youtube
Vimeo
Consent to display content from - Vimeo
Google Maps
Consent to display content from - Google
Spotify
Consent to display content from - Spotify
Sound Cloud
Consent to display content from - Sound