ESP-MQTT usage for OTA updates

BDesterBE
Posts: 4
Joined: Wed Dec 13, 2023 7:24 pm

ESP-MQTT usage for OTA updates

Postby BDesterBE » Wed Dec 13, 2023 8:27 pm

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

65gitwz3a
Posts: 1
Joined: Wed Dec 20, 2023 1:34 am

Re: ESP-MQTT usage for OTA updates

Postby 65gitwz3a » Wed Dec 20, 2023 1:51 am

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.

BDesterBE
Posts: 4
Joined: Wed Dec 13, 2023 7:24 pm

Re: ESP-MQTT usage for OTA updates

Postby BDesterBE » Wed Mar 13, 2024 1:53 am

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.
Last edited by BDesterBE on Thu Mar 14, 2024 4:32 pm, edited 1 time in total.

chegewara
Posts: 2240
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP-MQTT usage for OTA updates

Postby chegewara » Thu Mar 14, 2024 1:54 am

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

Who is online

Users browsing this forum: No registered users and 186 guests