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.

AWS IoT Cloud MQTT Connection

MQTT connection of the AWS IoT Cloud

The connection takes place in the following steps, which we will explain in detail below.

  1. Creating and Registering an Object in AWS IoT
  2. Creating and downloading a certificate in the AWS console
  3. Set up an AWS IoT policy in the AWS Console and append it to a certificate
  4. Importing an AWS IoT certificate into the MQTT client

Creating and Registering an Object in AWS IoT

  1. Create an object in the AWS IoT console via “Manage→Things” and then “Register a thing”.
    AWS IoT MQTT Create Object
  2. Then “Create a single thing”.
    AWS IoT MQTT Create Object Detail
  3. Register the thing.
    AWS IoT MQTT Register Object

    AWS IoT MQTT Register Object

Creating and downloading a certificate in the AWS console 

  1. Create a certificate for the newly created object using the “Create certificate” option.
    AWS IoT MQTT Create Certificate
  2. Download the certificate via “Download” at “A certificate for this thing”.
  3. Download the private key via “Download” at “a private key”.
  4. Activate the certificate via the “Activate” button.
  5. Finish the process with “Done”.
    AWS IoT MQTT Certificate download

Set up an AWS IoT policy in the AWS Console and append it to a certificate 

  1. Create a Policy in the “Policies” section.
    AWS IoT MQTT Create Policy 1
  2. Create a policy for the action “iot:*” and the Ressourcen-ARN “*”.
    AWS IoT MQTT Create Policy 2
  3. In the “Certificates” area, click on the desired certificate and perform the action “Attach policy”.
    AWS IoT MQTT Policy to Certificate 1
  4. Select and confirm the policy you have created.
    AWS IoT MQTT Policy to Certificate 2

Importing an AWS IoT certificate into the MQTT Client 

  1. Import the certificate in the MQTT Client, here the OPC Router, under Extras->Settings->Certificate management.
    AWS IoT Certificate Import OPC Router 1
  2. To import the certificate, import the Private Key.
    AWS IoT Certificate Management OPC Router 1
  3. Open the IoT thing in the AWS IoT console via Administration things.
    AWS IoT Broker Endpoint 1
  4. In the “Interact” area, copy the end point for the broker connection.
    AWS IoT Broker Endpoint 2
  5. In the MQTT Broker configuration of the MQTT client (here OPC Router->MQTT Plug-in (create new MQTT Plug-in instance)) enter the endpoint. Attention: SSL Protocol has to be TSLLv1.2!AWS IoT Broker Endpoint 3

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.

AWS IoT MQTT Beispiel Anbindung OPC Router
AWS IoT Cloud MQTT Client

AWS IoT Cloud connection by Drag & Drop!

With the OPC Router you connect your graphical production systems with the AWS Cloud via MQTT.

Request your download and test the MQTT connection!