Skip to content

Setting up AWS IoT Core endpoint

Taraqur Rahman edited this page Sep 11, 2023 · 8 revisions

Setting Up AWS IoT Core with ClusterDuck Protocol: A Step-By-Step Guide

This guide will help you set up AWS IoT Core to work with the ClusterDuck Protocol. It aims to provide a straightforward process for initializing AWS IoT Core, adding devices, and pushing data to external systems.

Table of Contents


Prerequisites

  • Basic knowledge of AWS and IoT concepts.
  • Installed ClusterDuck Protocol on your IoT devices.

Setting Up an AWS Account

  1. Visit the AWS Management Console. You can # for a free AWS account here.

  2. Click on "# to the Console" if you already have an account or "Create a new AWS account" to set up a new account.

  3. Follow the on-screen prompts to complete the account setup.

Configuring an AWS IoT Core Instance

  1. Log in to your AWS account.

  2. Navigate to Services and select IoT Core. AWS Management Console

  3. Click on the IoT Core from the search bar to initialize a new IoT Core instance.

Setup a Device Policy in IoT Core

  1. In the left menu bar, navigate to Security->Policies.\

  2. Click on "Create policy"

  3. Set a policy name and add the following 4 Effects

    • Iot:Publish
    • Iot:Receive
    • Iot:Subscribe
    • Iot:Connect
  4. Add a * to all policy resources Policy

Creating Devices and Obtaining Certificates

  1. In the left Menu bar, navigate to Manage -> Things.

  2. Click "Create Things" to add a new device. Create Device

  3. Create a new name for your Papa Duck and click "Next" Device Details

  4. Click on "Auto-generate a new certificate (recommended)" and click "Next"

  5. Attach your policy to your Thing and click on "Create thing" Policy

  6. During this process, you will also be prompted to download the required certificates; make sure to keep them in a safe place. Credentials Save

Using ClusterDuck Protocol's Papa Duck Example for AWS IoT Core

  1. Clone or download the ClusterDuck Protocol repository from GitHub.

  2. Open the Papa Duck Example for AWS IoT Core in Arduino IDE.

Applying Credentials

  1. Open MQTT Test Client inside your AWS IoT Core dashboard. Click on "Connection details" to retrieve your endpoint. AWS Endpoint

  2. Make sure to put your endpoint in the PapaDuck.h file in the designated spot inside char server[] = ORG "YOUR ENDPOINT";

  3. Give your PapaDuck a unique ID of 8 characters Input info

  4. In Arduino, navigate to the secrets.h tab and enter your endpoint and the ThingID.

  5. Open the ROOT CA 1, Public Key, and Private key in a code editor and copy and paste the contents in the designated spot in secrets.h

  • Root CA 1 = Amazon Root CA 1
  • Public Certificate = Device Certificate (Top one)
  • Private Key = Private Key File

Setting Up Rules to Push Data to External Systems

  1. In the AWS IoT Core dashboard, go to "Act" > "Rules".

  2. Click "Create" to set up a new rule.

  3. Configure the rule to forward incoming data from your IoT device to an external system of your choice.

  4. Save the rule and test to confirm that data is being forwarded appropriately.

Congratulations, you've successfully set up AWS IoT Core to work with your ClusterDuck Protocol devices! For further assistance or more advanced configurations, you may refer to the official AWS IoT Core documentation.

Clone this wiki locally