MQTT Client / Connecting MQTT Client to AWS
In this video of our N3uron Academy, we’re going to configure N3uron’s MQTT Client to publish real-time data from a photovoltaic plant to AWS IoT Core. 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’re going to configure N3uron’s MQTT Client to publish real-time data from a photovoltaic plant to AWS IoT Core. N3uron is already subscribed to an OPC-UA Server at the photovoltaic plant using the OPC-UA Client module, allowing us to receive real-time data. To start, let’s take a look at the data in the Real-Time view to confirm that we are correctly receiving values from the PV plant. Before proceeding with the N3uron MQTT Client configuration, we first need to create a device—or Thing, as AWS calls it—within the AWS IoT Console. To do this, we log into the AWS IoT Console and navigate to the Security section in the left-hand menu, then select Policies. Since we don’t have a policy yet, we create a new one.
[01:03] We name this policy ‘N3uron_Policy’ and define the permissions needed for our MQTT Client to connect, publish, receive, and subscribe. In the Policy resource enter an asterisk as a wildcard character, allowing these policy actions on all resources. Next, we create a new Thing. We navigate to the Manage section, select Things, and click on “Create a thing”. We choose “Create a single thing” and press Next. In the Thing properties section, we enter the Thing name as “N3uron_Gateway” and leave the rest of the settings as default. Then, we click Next. In the Device certificate step, we select “Auto-generate a new certificate”, which is the recommended option, and proceed by clicking Next. In the Attach policies to certificate step, even though it is marked as optional, we select the policy we created earlier—”N3uron_Policy”—to ensure the device certificate has the necessary access. Otherwise, we would have to apply the policy manually later.
[02:03] Next, we download the required certificate files, including the private key, public key, device certificate, and root CA certificate. Once this is complete, we finalize the Thing creation process. With the AWS setup complete, we move to N3uron’s WebUI to configure the MQTT Client module. We start by navigating to the Config tab, selecting Modules, and creating a new instance of the MQTT Client module, naming it ‘MqttClient’ for clarity. After saving the module, we locate it in the Explorer panel, click on it, and navigate to the Model header menu. Here, we create a new connection and name it ‘AWS_IoT_Core’, for example. In the connection settings, we select MQTT 5 as the protocol version, which enables enhanced messaging features.
[03:01] Most importantly, we set ‘AWS IoT Core’ as the destination broker. For the Client ID, we must enter the exact name of the Thing we created in AWS, which in this case is ‘N3uron_Gateway’. Next, we configure the authentication settings. In the certificates section, we upload the previously downloaded certificate files: the device certificate, private key, and root CA certificate. These credentials will authenticate our connection to AWS IoT Core. For the Broker URL, we return to our AWS IoT Console, navigate to the settings, and locate the Device Data Endpoint. Note that this setting has been moved to the Domain Configuration section. We copy the domain name from this section and paste it into the Broker URL field in N3uron’s MQTT Client configuration. Once the connection is established, we create a new Publisher. We assign it a Topic, which we name ‘PVPLANT’.
[04:00] This is where the data from the photovoltaic plant will be published. We configure the publishing settings as needed, leaving most at their default values except for the Publishing Interval, which we adjust based on our requirements. After saving the settings, we navigate to the Diagnostics section, select the MQTT Client module, and verify that the connection to AWS IoT Core is active. We ensure that the module is publishing data without errors. Once confirmed, we return to the AWS IoT Console and access the MQTT Test Client. Here, we subscribe to the same topic, ‘PVPLANT’, and monitor the incoming messages from N3uron.
[05:10] After a short while, we should see real-time data arriving in the AWS IoT Console, confirming that our MQTT Client is successfully publishing data to AWS IoT Core. 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 AWS IoT Core. 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]