MQTT Client / Connecting MQTT Client to Azure
In this video of our N3uron Academy, we’ll configure the N3uron MQTT Client to connect to Azure IoT Hub. Let’s get started!
[09:29] Configuring MQTT Client
[06:30] MQTT Client Custom Parser
[04:07] MQTT Client Custom Payload
[05:57] Connecting MQTT Client to AWS
[04:46] Connecting MQTT Client to Azure
[00:00] Hello everyone! In this video, we’ll configure the N3uron MQTT Client to connect to Azure IoT Hub. We’ll acquire shaft temperature, gearbox temperature, and wind speed data from three wind turbines via the SQL Client module and publish it to Azure IoT Hub. To follow along with this tutorial, you will need to install Azure IoT Explorer on your computer. This tool will help configure our IoT device and verify data flow to Azure IoT Hub. First, navigate to your Azure Portal account and ensure you have an active subscription, a Resource Group, and an IoT Hub resource configured. If you do not have an IoT Hub resource yet, you can create one by clicking on the “Create a resource” shortcut, selecting “IoT Hub” from the “Internet of Things” section, and following the on-screen instructions.
[01:01] More details can be found in the N3uron Knowledge Base. Since I already have an IoT Hub resource ready, I will navigate to it, select “Shared Access Policies,” and choose “iothubowner” to start creating a new device. Next, I will copy the Primary Connection String from the right-hand panel. Now, open the Azure IoT Explorer program and click on the “Add connection” button. Paste the Primary Connection String in the Connection String text box and click “Save.” In the Devices section, click on the “New” button and enter a name for your device. In this example, we will name it “N3uron_Gateway.” For Authentication Type, select “Symmetric key,” check the “Auto-generate keys” field, and click “Create.” After creating the new device identity, expand the “Connection string with SAS token” section. In the Symmetric key drop-down menu, select “Primary Key.” Enter a sufficiently high value in the “Expiration” field, click on “Generate,” and copy the part of the SAS token connection string from the Shared Access Signature and equal sign onwards.
[02:02] Next, let’s configure the MQTT Client module in N3uron. In the Navigation panel, select “Config.” Then, in the Explorer panel, select “Modules.” Click on the “Model” menu and select “New Module.” Assign a name to the module, such as “MqttClient.” In the Explorer panel, select the MQTT Client instance you have just created. Navigate to the module header, click on the burger menu, and select “New Connection.” Name the connection something like “Azure_IoT_Hub.” For the Destination Broker, select “Azure IoT Hub.” In the Password field, paste the SAS token connection string copied earlier. For the Username field, enter the Hostname of your Azure IoT Hub, followed by a forward slash and the name of the device, in this case: N3-IoT.azure-devices.net/N3uron_Gateway. In the Broker URL field, enter the Hostname of your Azure IoT Hub.
[03:01] Leave the remaining settings at their default values. Now, let’s create a new publisher agent to publish the turbine data. Change the Publishing Interval to 5000ms. For the topic, we must use the precise syntax that Azure IoT Hub requires: devices, forward slash, the device ID, which in this case is N3uron_Gateway, forward slash, messages, forward slash, events, and forward slash. Additionally, I’ll modify the message format so that the date is represented as an ISO string, while all other settings remain at their default values. Next, create a new filter to include all the tags from the root folder. Save the changes and navigate to the “Diagnostics” tab to check if the MQTT connection is working correctly and if data is being published successfully. To verify data flow in Azure IoT Explorer, open the program, select the “N3uron_Gateway” device, navigate to the “Telemetry” section, and click on “Start.”
[04:01] You should see data being published to Azure IoT Hub. And that’s it! We’ve successfully set up and configured N3uron’s MQTT Client to establish a connection and transmit real-time data to Azure IoT Hub. Thanks for watching, and see you in the next video!
N3uron software is an Industrial Edge Platform for IIoT and DataOps that streamlines the flow of data between industrial systems and business applications, either on-premise or in the cloud. N3uron provides an out-of-the-box solution for data standardization, normalization and contextualization, seamless integration with industrial and IT systems, efficient information management, and unparalleled scalability and security. The N3uron platform makes it easier for operations teams to aggregate, manage and analyze industrial data, resulting in enhanced productivity and informed decision-making. Whether you're looking to optimize your operations, reduce downtime or improve product quality, the N3uron platform is the answer.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
DLMS® UA MEMBER
N3uron is a member of the DLMS® User Association, the global community that drives standardization in the energy and water industry. Being part of the DLMS UA represents N3uron's commitment to advancing smart metering and energy management solutions.
FOLLOW US
N3uron Connectivity Systems • Paseo de la Castellana, 91, 4º, 1; Madrid, 28046, Spain • +34 911 841 938 • [email protected]
N3uron software is an Industrial Edge Platform for IIoT and DataOps that streamlines the flow of data between industrial systems and business applications, either on-premise or in the cloud. N3uron provides an out-of-the-box solution for data standardization, normalization and contextualization, seamless integration with industrial and IT systems, efficient information management, and unparalleled scalability and security. The N3uron platform makes it easier for operations teams to aggregate, manage and analyze industrial data, resulting in enhanced productivity and informed decision-making. Whether you're looking to optimize your operations, reduce downtime or improve product quality, the N3uron platform is the answer.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
FOLLOW US
N3uron Connectivity Systems • Paseo de la Castellana, 91, 4º, 1; Madrid, 28046, Spain • +34 911 841 938 • [email protected]
N3uron software is an Industrial Edge Platform for IIoT and DataOps that streamlines the flow of data between industrial systems and business applications, either on-premise or in the cloud. N3uron provides an out-of-the-box solution for data standardization, normalization and contextualization, seamless integration with industrial and IT systems, efficient information management, and unparalleled scalability and security. The N3uron platform makes it easier for operations teams to aggregate, manage and analyze industrial data, resulting in enhanced productivity and informed decision-making. Whether you're looking to optimize your operations, reduce downtime or improve product quality, the N3uron platform is the answer.
CONTRIBUTING MEMBER
N3uron is a Contributing Member of the Eclipse Foundation, actively participating in the development of their robust ecosystem. By leveraging EF technologies, we offer innovative products and services that drive our corporate strategy forward. N3uron is Sparkplug Compatible Software.
DLMS® UA MEMBER
N3uron is a member of the DLMS® User Association, the global community that drives standardization in the energy and water industry. Being part of the DLMS UA represents N3uron's commitment to advancing smart metering and energy management solutions.
FOLLOW US
N3uron Connectivity Systems • Paseo de la Castellana, 91, 4º, 1; Madrid, 28046, Spain • +34 911 841 938 • [email protected]