Amazon Freertos workshop using the M5 StickC
View the Project on GitHub onsankawai/amazon-freertos-m5stickc-workshop
In your Cloud9 terminal environment, clone the lab repo:
cd ~/environment
git clone https://github.com/onsankawai/amazon-freertos-m5stickc-workshop.git --recurse-submodules workshop
Navigate to https://yona75.github.io/credformatter/, upload your Certificate and Private key that you downloaded in the previous step and generate an aws_clientcredential_keys.h file.
Copy the file to ~/environment/workshop/amazon-freertos/demos/include/ directory by dragging it there
Open the aws_clientcredential.h file by double-clicking on it. And change the following values:
...
#define clientcredentialMQTT_BROKER_ENDPOINT "[YOUR AWS IOT ENDPOINT]"
...
#define clientcredentialIOT_THING_NAME "[THE THINGNAME YOU CREATED]"
...
#define clientcredentialWIFI_SSID "[WILL BE PROVIDED]"
...
#define clientcredentialWIFI_PASSWORD "[WILL BE PROVIDED]"
...
#define clientcredentialWIFI_SECURITY eWiFiSecurityWPA2
...
Note: clientcredentialWIFI_SECURITY is defined without double quotes
mv ~/environment/workshop/m5stickc ~/environment/workshop/amazon-freertos/vendors/espressif/boards
Run make menuconfig and simply exit. This will setup the defaults.
cd ~/environment/workshop/amazon-freertos/vendors/espressif/boards/m5stickc/aws_demos
make menuconfig
Click Save and then Exit
make all -j4
If compilation is successful, you should be greeted with the following message:
esptool.py v2.6
To flash all build output, run 'make flash' or:
python /home/ec2-user/environment/workshop/amazon-freertos/vendors/espressif/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/cu.usbserial-29568143B4 --baud 1500000 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /home/ec2-user/environment/workshop/amazon-freertos/vendors/espressif/boards/m5stickc/aws_demos/build/bootloader/bootloader.bin 0x20000 /home/ec2-user/environment/workshop/amazon-freertos/vendors/espressif/boards/m5stickc/aws_demos/build/aws_demo.bin 0x8000 /home/ec2-user/environment/workshop/amazon-freertos/vendors/espressif/boards/m5stickc/aws_demos/build/partition-table.bin
Once compilation is done, download these 3 files to your local computer:
Note: the “build” folder is located in ~/environment/workshop/amazon-freertos/vendors/espressif/boards/m5stickc/aws_demos/build