How-To Exchange Data with AWS IoT Core

What Does This Article Cover?

Intelligence Hub’s MQTT Connection can be used to exchange data with AWS IoT Core. The Intelligence Hub MQTT Client exchanges data with IoT Core’s MQTT Message Broker. The process to perform these actions are provided below. These process descriptions assume intermediate level knowledge of building Intelligence Hub component objects including the MQTT Connection.

  • What is AWS IoT Core
  • Configuring AWS IoT Core Authentication
  • Exchanging Data with AWS IoT Core
  • Other related material

What is AWS IoT Core?

AWS IoT Core is used to easily and securely connect devices to the cloud. AWS IoT Core provides a fully managed palette of MQTT-based messaging features. AWS IoT Core lets you connect billions of IoT devices and route trillions of messages to AWS services without managing infrastructure.

Configuring AWS IoT Core Authentication:

When using SSL, certificates need to be imported into the HighByte Intelligence Hub certificate store. You will need to import the self-signed CA certificate and add the Client Certificate (as a certificate) and Client Key. The following describes the configuration process.

First create certificates in AWS IoT Core. Then download the Device Certificate, Private key file, and Amazon trust services endpoint Root CA Certificate (RSA 2048 | Amazon Root CA 1).

Next configure a policy in AWS IoT Core and associate the policy to the certificate.

  • Allow iot:Connect, policy resource “*” (wildcard or other)
  • Allow iot:Publish, policy resource “*” (wildcard or other)
  • Allow iot:Receive, policy resource “*” (wildcard or other)
  • Allow iot:Subscribe, policy resource “*” (wildcard or other)

Import the certificates using Intelligence Hub’s Certificates menu item.

PublicCertificate(RootCACertificate) PublicCertificate(DeviceCertificate) and PrivateKey(PrivateKeyFile)

Finally the certificates may be referenced in the Intelligence Hub MQTT Connection.

Exchanging Data with AWS IoT Core:

The Host for the Intelligence Hub MQTT Connection can be found in IoT Core connection details.

Configuring data exchange with AWS IoT Core consists of defining Topics for Connection Inputs and Outputs. Topics can be static or dynamic. Dynamic topics can include data from the output payload. To include data from the payload, use the following syntax.
/mytopic/{{this.siteid}} At runtime this takes the siteid attribute of the output payload and includes it in the output topic. One or more dynamic outputs can be defined. /mytopic/{{this.siteid}}/{{this.assetid}} When using dynamic outputs, if the output payload does not contain the referenced attribute the output will fail to write.

The following illustrates a simple configuration.

Other related material: