Amazon Freertos workshop using the M5 StickC
View the Project on GitHub onsankawai/amazon-freertos-m5stickc-workshop
It’s the summer, and its hot outside. Lets play around with remove controlled Air Conditioning units.
For this lab, our M5StickC will act as our Air Conditioning unit.
You can turn the AirCon ON or OFF remotely as well as set a target temperature.
In order to configure the code and your M5StickC for Lab2, 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_LAB2_SHADOW
Replace:
#define M5CONFIG_LAB0_DEEP_SLEEP_BUTTON_WAKEUP
With:
#define M5CONFIG_LAB2_SHADOW
cd ./amazon-freertos/vendors/espressif/boards/m5stickc/aws_demos
make all -j4
Please follow the procedure form the following Setup guide.
Log into your AWS IoT Management console, and open up your Thing.
Click on Shadow.
{
"reported": {
"powerOn": 0,
"temperature": 40
}
}
{
"desired": {
"powerOn": 1,
"temperature": 22
}
}
This should instantly result in a compiled shadow document looking something like:
{
"desired": {
"powerOn": 1,
"temperature": 22
},
"reported": {
"powerOn": 0,
"temperature": 40
},
"delta": {
"powerOn": 1,
"temperature": 22
}
}
Whatch how now that you have turned on your Air Con, the temperature will slowly decrease to your set value.
categories: lab tags: iot-core - shadowNote: Be carefull when setting the temperature value. The code only supports positive integer values. Do not use a floating point value.