Skip to main content

AWS IoT Core

In this guide we will walkthrough setting up a “thing” in AWS IoT core to receive data from monoZ:Link. We will configure AWS IoT core configuration in monoZ:Link and attach it to device group.

Setup AWS IoT Core thing

  1. Access the AWS console. AWS IoT Core -> Manage → All Devices → Things
  1. Now click “Create Thing”.
  1. Select “Create Single Thing” and click “Next”.
  1. Enter a name in [Thing name] and click “Next”. Here, we'll name it "XXXXXXXXXXXXXXX5169".
  1. Select “Auto-generate a new certificate (recommended)” and click “Next”
  1. The Attach Policy to Certificate - Options screen appears, where you would typically select a policy and assign it to the certificate. Since no policy has been yet, click “Create Thing” without attaching a policy.
  1. Click the corresponding Download button to download the following four files, and then click “Finish”. You will use these certificates (Device certificate, Public Key File, Private key file, Amazon Root CA 1) later. Now that the thing is created, you can create a policy to assign to the device (thing).
  1. Click Administration → Security → Policies → Create Policy. This time, we will create a new “test” policy that can publish to any MQTT topic.
  1. Set each item and click [Add new statement] and add the following items:

    [Policy Effects][Policy Action][Policy Resources]
    “permission”iot:Connect*
    “permission”iot:Publish*
    “permission”iot:Receive*
    “permission”iot:Subscribe*
  2. Click “Create”. The policy is created.

  1. Next, attach the policy created to the thing certificate. Check the certificate you created and click Actions → Attach Policy.
  1. Select AWS IoT Test, check the “Test” policy you created, and click “Attach Policy”. This completes the registration of the thing in AWS IoT Core.
  1. Finally, we will get the custom endpoint for sending data to AWS IoT Core. This endpoint shall be used when creating configuration in monoZ:Link. Access the AWS IoT console and click [Settings] and copy the contents shown in [Endpoints] under [Device data endpoints].

Setup monoZ:Link

  1. Prepare the following files downloaded upon creating AWS IoT Core Thing

    Endpoint (Unique device data endpoint of AWS IoT core)
    Private key file random string-private.pem.key
    Device certificate random string-certificate.pem.crt
    Amazon Root CA 1 AmazonRootCA1.pem
  2. Open monoZ:Link -> Protocol configuration -> Add Configuration

  1. Select AWS IoT Core from the dropdown list
  1. Add the configuration details and click “Save”

    Source Protocol MQTT
    Configuration Name Test Config (Any suitable name)
    Host Paste the device endpoint from AWS
    CA File (Server Cert) Upload “Amazon Root CA 1” file
    Topic Topic to publish on AWS IoT Core. It could be “Same as incoming” or Custom topic.
    QOS MQTTS QOS for publish to AWS IoT Core. Zero or One
  2. Navigate to Groups → Add Group

  1. Add the necessary details in the fields and click “Save”

    Group Name Test Group (Any Name)
    Available Configuration Test Config (Select from the configuration)
  2. Go to Devices and Click “Edit icon” on the device to be connected to AWS IoT core. Attach following details in their respective fields and click “Update”. The monoZ:Link configuration for AWS IoT core connection now complete.

    Group Select the created Test group
    Client Certificate random string-certificate.pem.crt
    Client Key file random string-private.pem.key

Send data from the device

  1. Before data send, lets setup test client on AWS IoT core to view the incoming data. Navigate to MQTT test client in AWS IoT core console and subscribe to your device push topic.
  1. Send payload data from the Device “XXXXXXXXXXXXXXX5169” to monoZ:Link. monoZ:Link shall translate protocol and push the received data to AWS IoT Core over MQTTS. It can be verified in the MQTT test client feature.

AWS IoT Core Data Push Format

monoZ:Link pushes incoming data to the specified AWS IoT Core broker without any changes to format.

Incoming data from Device to monoZ:Link :

<payload>

monoZ:Link to AWS IoT core:

<payload>

AWS IoT Core Data Push Rule:

  1. Each incoming data packet is pushed as individual data push message.
  2. If AWS IoT core protocol configuration is set with QOS 1, then monoZ:Link shall ensure that the data push message is delivered at least once to AWS IoT Core. In case of not able to deliver the message to AWS IoT Core, the data will be discarded without retries. If the database function is enabled, the data will be stored as failed data.