Page 1 of 1

ESP-MQTT usage for OTA updates

Posted: Wed Dec 13, 2023 8:27 pm
by BDesterBE
Hello,

I am trying to determine if the esp-mqtt library is suitable to use for OTA updates via MQTT. The question arose as a result of viewing this other forum post:
viewtopic.php?f=2&p=122070.

It seems that I should generally avoid using the esp-aws-iot library, though AWS has specific documentation pertaining to OTA when using coreMQTT. I cannot find any documentation related to esp-mqtt and OTA specifically though.

Does anybody have any insight into this? Might it be easier to just use esp-aws-iot in this instance? Would using both esp-aws-iot, specifically for OTA, and esp-mqtt, for other MQTT messages, within the same project be an acceptable and easier approach?

Thanks,
Brandon

Re: ESP-MQTT usage for OTA updates

Posted: Wed Dec 20, 2023 1:51 am
by 65gitwz3a
Hi.
I'm also in the process of implementing OTA on AWS. I also felt that the esp-aws-iot examples that use aws sdk libraries are unnecessarily complex. So I decided to implement it using esp-idf libraries.
I used esp-mqtt for provisioning certificates and private keys to devices (provisioning by claim) and really liked the how it turned out. I mostly followed the aws docs and used esp-aws-iot as a template. The final implementation was much more readable and easier to understand.
But I'm not completely sure about OTA as I haven't finished its implementation yet.
For now I decided to not use FreeRTOS OTA job template on aws. Instead I created a custom job template that generates a pre-signed url from S3 and sends it to the esp32 board. After that flashing the firmware from URL is trivial. It's almost the same as the esp-https-ota example.
But updating the aws job status is a little bit awkward as the topics for updating the job depend on the jobId. I'm still trying to find a decent solution for it.
This was more or less my experience with it so far.

Re: ESP-MQTT usage for OTA updates

Posted: Wed Mar 13, 2024 1:53 am
by BDesterBE
Wanted to update, I ended up only using esp-aws-iot to handle both normal MQTT message transmission and OTA. I found the examples to be very bloated, but easy enough to build off of and follow.

Re: ESP-MQTT usage for OTA updates

Posted: Thu Mar 14, 2024 1:54 am
by chegewara
Couple years ago ive been working with AWS-FreeRTOS, which has had support for OTA from aws.
https://docs.aws.amazon.com/freertos/la ... arted.html
Currently it seems to be deprecated, but i found this on freertos site, which i believe is worth to study:
https://freertos.org/lts-libraries.html
And this one should be interesting
https://freertos.org/ota/index.html


https://freertos.org/featured-freertos- ... isc-v-mcu/
https://github.com/FreeRTOS/iot-referen ... qtt_demo.c