espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets
Apache License 2.0
257 stars 154 forks source link

Looking for information about ESP AWS OTA example for ESP32 provided by ESP (CA-188) #92

Open YogeshG30 opened 2 years ago

YogeshG30 commented 2 years ago

Hi All,

We are working on ESP32-C3 for BLE Wi-Fi gateway project using ESP IDF and Eclipse. We are looking for features like Web server for Gateway configuration, OTA from AWS, Device connectivity over BLE, Data exchange with AWS S3 We came across sample code for ESP AWS OTA from Amazon site.

For OTA sample code from ESP, i) From ESP sample example, we came across "ESP HTTPS OTA" generic example, which is using "ESP OTA Library". ii) We contacted ESP for "ESP MQTT AWS OTA" reference code compatible to ESP IDF and we came across following reference. Looks like this code use "AWS OTA Lib" https://github.com/espressif/esp-aws-iot/tree/release/beta/examples/ota/ota_mqtt

We have few queries about OTA sample code from ESP i) What is the RAM and Flash requirement of "ESP HTTPS OTA" reference code? ii) How new update notification works for "ESP HTTPS OTA" reference code? iii) What are the advantage and disadvantage of HTTPS based OTA against MQTT based OTA? iv) How about speed of programming for HTTPS against MQTT? v) AWS reference code recommended to turn Off BLE during OTA to limit RAM usage. In "ESP HTTPS OTA" code, how we can turn OFF the BLE when OTA starts. vi) "ESP HTTPS OTA" is generic code and not specific to AWS. Is there any sample code available based on "ESP HTTPS OTA" compatible to AWS. We are looking for code compiling with ESP IDF and Eclipse. vii) What are the advantage and disadvantage of "ESP OTA Library" against "AWS OTA Library"?

Thanks in advance...…

ameyinamdar commented 2 years ago

i) What is the RAM and Flash requirement of "ESP HTTPS OTA" reference code? -> I am afraid, we don't have exact RAM and flash usage requirement for ESP HTTPS OTA. It does require a TLS connection that consumes around 25KB of SRAM. TLS stack is generally anyway pulled into the application image and HTTP client is pretty thin. You can compile the example and check out both flash and SRAM usage.

ii) How new update notification works for "ESP HTTPS OTA" reference code? -> This logic is not a part of ESP HTTPS OTA and needs to be handled at the application level

iii) What are the advantage and disadvantage of HTTPS based OTA against MQTT based OTA? -> MQTT based OTA does not require additional TLS socket connection. But Espressif SoCs are sufficiently powerful to have a separate TLS connection for HTTPS OTA. MQTT based OTA results in more messages between AWS IoT Core and devices.

iv) How about speed of programming for HTTPS against MQTT? -> Speed of flash programming will be same. MQTT OTA and HTTPS OTA transport should take approximately same time. (there is a current known issue in MQTT OTA that makes it quite slow; the fix is under review)

v) AWS reference code recommended to turn Off BLE during OTA to limit RAM usage. In "ESP HTTPS OTA" code, how we can turn OFF the BLE when OTA starts. -> You can use standard BLE APIs in IDF to disable BLE when OTA starts

vi) "ESP HTTPS OTA" is generic code and not specific to AWS. Is there any sample code available based on "ESP HTTPS OTA" compatible to AWS. We are looking for code compiling with ESP IDF and Eclipse. -> HTTPS OTA can fetch from any HTTPS servers. What do you mean by making it compatible with AWS?

vii) What are the advantage and disadvantage of "ESP OTA Library" against "AWS OTA Library"? -> Please see various differences mentioned above.