How can a data source be connected to Amazon’s AWS IoT Cloud via MQTT? We guide you step by step using the OPC router as MQTT client.
The Amazon AWS Cloud is one of the leading cloud environments on the market. Like all platforms, AWS offers an IoT environment (AWS IoT) in which objects can be created. As it is often the case in IoT, the objects are linked to the field via MQTT. The OPC Router with its MQTT client plug-in thus becomes a possible data supplier for AWS IoT objects. For this purpose, the OPC Router obtains data from various sources with its plug-ins and transfers it bidirectionally to the cloud services.
MQTT connection of the AWS IoT Cloud
The connection takes place in the following steps, which we will explain in detail below.
- Create an object in the AWS IoT console via “Manage→Things” and then “Register a thing”.
- Then “Create a single thing”.
- Register the thing.
- Create a certificate for the newly created object using the “Create certificate” option.
- Download the certificate via “Download” at “A certificate for this thing”.
- Download the private key via “Download” at “a private key”.
- Activate the certificate via the “Activate” button.
- Finish the process with “Done”.
- Import the certificate in the MQTT Client, here the OPC Router, under Extras->Settings->Certificate management.
- To import the certificate, import the Private Key.
- Open the IoT thing in the AWS IoT console via Administration things.
- In the “Interact” area, copy the end point for the broker connection.
- In the MQTT Broker configuration of the MQTT client (here OPC Router->MQTT Plug-in (create new MQTT Plug-in instance)) enter the endpoint.
Example: Temperature Transfer to AWS IoT Cloud with the OPC Router
In this example, data from a temperature acquisition system is loaded from an SQL database and sent to the configured AWS IoT thing formatted as a character string. With the MQTT client integrated in the AWS IoT console, the received data is displayed again.