Email Us at [email protected]

Download N3uron

Back to videos

MQTT Client / Connecting MQTT Client to AWS

Connecting MQTT Client to AWS

Description

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!

  • [05:57] Connecting MQTT Client to AWS

Transcription

[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!

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