Amazon FreeRTOS Workshop

Logo

Amazon Freertos workshop using the M5 StickC

View the Project on GitHub onsankawai/amazon-freertos-m5stickc-workshop

31 October 2019 by teuteuguy

Lab 1 - Create your own AWS IoT Button

A couple years ago, AWS announced the AWS IoT Button you could order from Amazon.com. Why not create our own ?

For this lab, our M5StickC will act as an AWS IoT Button, allowing you to trigger downstream AWS Services.

Configuration

In order to configure the code and your M5StickC for Lab1, you must change the following lines of code:

In file: ./amazon-freertos/vendors/espressif/boards/m5stickc/aws_demos/application_code/m5stickc_lab_config.h

Change the LAB define to: M5CONFIG_LAB1_AWS_IOT_BUTTON

Replace:
#define M5CONFIG_LAB0_DEEP_SLEEP_BUTTON_WAKEUP

With:
#define M5CONFIG_LAB1_AWS_IOT_BUTTON

Rebuild Code

cd ./amazon-freertos/vendors/espressif/boards/m5stickc/aws_demos
make all -j4

Flash Code

Please follow the procedure form the following Setup guide.

Result

Log into your AWS IoT Management console, and subscribe to the following topic:

m5stickc/+
  • Click the button: You should see the following JSON document flow on the broker
{
	"serialNumber": "[YOUR DEVICE SERIAL NUMBER]",
	"clickType": "SINGLE"
}
categories: lab tags: iot-core