iot lab work shop
This project is maintained by DanielYEHsieh
In your Cloud9 terminal environment, clone the lab repo:
cd ~/environment
git clone https://github.com/aws/amazon-freertos.git --recurse-submodules
cd ~/environment/amazon-freertos/vendors/espressif/esp-idf
pip install --user -r requirements.txt
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
cd ~/environment/amazon-freertos/vendors/espressif/boards/esp32/aws_demos
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