Advanced Setup

Integrating with AWS IoT Core via MQTT

Connecting your Atmocube to AWS IoT Core allows you to leverage the powerful cloud capabilities of AWS for data analysis, storage, and integration with other services. This guide will walk you through the process.

Part 1: Configuring AWS IoT

Step 1: Create an AWS Account

If you haven't already, sign up for an AWS account at aws.amazon.com.

Step 2: Access AWS IoT Core

Log in to your AWS account, search for "IoT Core" in the Services menu, and open the AWS IoT console.

Step 3: Create a 'Thing'

Navigate to the ‘Things’ dashboard using the sidebar menu and click on ‘Create things’. Choose ‘Create single thing’ or ‘Create many things’ as needed.

Step 4: Specify Thing Properties

Enter a unique ‘Thing name’, which could be your Atmocube's device ID, and then proceed to the next step.

Step 5: Configure Device Certificate

On the ‘Configure device certificate’ page, opt for ‘Auto-generate a new certificate’, then proceed to the next step.

Step 6: Attach Policies to Certificate

Click ‘Create policy’ to define permissions for your device. In the new tab:

  • Set a Policy Name.
  • Effect: Allow.
  • Action: Use ‘*’ for all actions.
  • Resource: Enter ‘*’ to apply the policy broadly or enter an ARN resource to apply the policy to.

Select the newly created policy back in the ‘Attach policies to certificate’ page and finalize by clicking ‘Create thing’.

Step 7: Download Certificates

In the ‘Download certificates and keys’ dialog, download the device certificate, private key file, and Amazon Root CA 1 (RSA 2048-bit key). Keep track of each certificate while downloading and rename each file as below:

  • Device certificate to client.crt
  • Private key file to client.key
  • Amazon Root CA 1 to ca.crt (convert format from .pem to .crt)

Note: Ensure that each file is renamed exactly as specified above, or Atmocube may not detect the files in later steps.

Part 2: Configuring Atmocube

Step 1: Atmocube Configuration Tool

Visit the Atmocube configuration tool portal at: https://config.atmocube.app/ and select your Atmocube SKU (with or without PoE)

Step 2: Enter Wi-Fi Details

In the Wi-Fi tab, input your network details, ensuring it's a 2.4GHz network.

Step 3: MQTT Configuration

In the MQTT tab, uncheck 'Production' to reveal configuration fields:

  • MQTT host: Enter your AWS endpoint, found in the AWS IoT Core console under Settings.
  • MQTT port: Use 8883 for AWS.
  • MQTT security: Select MQTT TLS and input the filenames of the certificates you renamed earlier.
  • Click ‘Generate Config’ to create a config.json file and save it to the root of a FAT-formatted USB flash drive, along with the certificates. Ensure that the configuration file name is config.json, not a copy like config(1).json

Step 4: Install Configuration on Atmocube

  1. Disconnect the Atmocube from the power source (if powered on).
  2. Insert the USB flash drive into the USB-A slot in Atmocube.
  3. Re-connect the Atmocube to the power source.
  4. Once the Atmocube is turned on, it will access the config.json file from the USB flash drive. The power status LED will turn a solid purple color to indicate that the USB flash drive has been detected.
  5. The network LED turning green indicates that the connection to the MQTT broker was successful.

Part 3: Testing Connection

Step 1: Access MQTT Test Client

Back in the AWS IoT console, navigate to the ‘MQTT test client’.

Step 2: Subscribe to a Topic

In the ‘Subscribe to a topic’ tab, use the wildcard ‘#’ to subscribe to all topics and click ‘Subscribe’. You should start seeing data from your Atmocube (this may take a minute as data is received every minute).

You've successfully connected your Atmocube to the AWS IoT Core.

Troubleshoot:

If the Atmocube power LED does not turn purple immediately when powered on with the USB flash drive inserted:

  • Try to reboot the Atmocube again by disconnecting and reconnecting power. 
  • Try an alternate USB flash drive.