1. Over-the-Air Update Prerequisites
参考链接:https://docs.aws.amazon.com/freertos/latest/userguide/ota-prereqs.html
To use over-the-air updates, you need to do the following:
- Create an Amazon S3 Bucket to Store Your Update.
- Create an OTA Update Service Role.
- Create an OTA User Policy.
- Create a Code-Signing Certificate.
并将ecdsasigner.crt的内容到copy到demos/common/include/aws_ota_codesigner_certificate.h中,如图:
- If you are using Code Signing for AWS IoT, Grant Access to Code Signing for AWS IoT.
- Download Amazon FreeRTOS with the OTA Library.
2.进入tools\aws_config_quick_start,配置相应参数,如:
{
"afr_source_dir":"../..",
"thing_name":"freeRTOS_iot7",
"wifi_ssid":"TGI-WiFi",
"wifi_password":"29****00",
"wifi_security":"eWiFiSecurityWPA2"
}
3.在当前目录输入:python SetupAWS.py setup 将在iot console生成对应的Thing, Certificate和Policy, 同时demos\common\include目录下的aws_clientcredential.h和aws_clientcredential_keys.h将被更新
4.Make sure that vStartOTAUpdateDemoTask is the only function called in the DEMO_RUNNER_RunDemos() function in demos/common/demo_runner/aws_demo_runner.c. You can define CONFIG_OTA_UPDATE_DEMO_ENABLED in the file amazon-freertos\vendors\espressif\boards\esp32\aws_demos\config_files\aws_demo_config.h
5.进入demos\espressif\esp32_devkitc_esp_wrover_kit\make或amazon-freertos\vendors\espressif\boards\esp32\aws_demos目录,输入make menuconfig配置端口
6.Creating an OTA Update Job in AWS IoT Console like some of the below screenshots.
7. Input an unique ID:
8. After creating a job to tigger an OTA update and updating successfully, it will show below