AWS

The AWS IoT platform enables devices to connect to the Amazon cloud and lets applications in the cloud interact with Internet-connected things. Common IoT applications either collect and process telemetry from devices or enable users to control a device remotely. Things report their state by publishing messages, in JSON format, on MQTT topics.

For more information see this PDF File.

Getting Started with AWS IoT

Creating the message broker (Amazon website):

  • Sign in to the AWS Management Console

  • Navigate to the IoT Console by clicking on the AWS IoT link

  • In the left navigation pane, choose Register/Manage

  • Click on the create button, give your device a name and press create

  • Click on the device that has been created

  • On the Details page, in the left navigation pane, choose Security

  • On the Certificates page, choose Create certificate

  • Download all the certificates, then press the Activate and the Attach a Policy buttons. See image

  • Click on the Create New Policy button

  • On the Create Policy page, choose a policy name and the actions to authorise.

  • Go to the certificates page, click on the three dots of your certificate and attach the policy to the certificate as shown in the diagram

Setting up the device (Pycom device):

  • Download the latest sample code from the Pycom GitHub Repository.

  • Connect to the device via FTP and put the root CA certificate, the client certificate (*.pem.crt) and the private key (*.private.pem.key) in the /flash/cert folder.

  • Update the config file with your WiFi settings, the AWS Host and the certificate paths.

  • Put the config.py and the main.py in the device flash

Configuration (config.py):

This file contains the WiFi, certificate paths and application specific settings that need to be updated by the user.

Subscibe / Publish (main.py)

To subscribe to a topic:

  • Go to the AWS Iot page, click on manage and choose your device

  • From the left hand side, choose Activity and then click MQTT client.

  • Choose the topic name you entered in the configuration file.

  • Messages should be published as shown in the diagram

Shadow updater (main.py)

Delta Listener (main.py)

Last updated