Arduino mega OTA using ESP32 through UART

Hi Developers.

I am using a ATmega2560 board and a ESP32 development board. I wanted to know if there is any way to do OTA to the atmega board using ESP32.

If it is possible can you give me some documentation for the same. It will be very helpful.

I tried MCUdude MegaCore bootloader but was unsucessful in doing the OTA. can anyone help with the same. It will be very helpful.

Thanks in advance :slightly_smiling_face:

I moved your topic to an appropriate forum category @gr8rithic.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Thanks very much @pert

1 Like

there are multiple options. which to use depends on what other requirements does you project have

@Juraj The ESP32 for my project is connected to the Serial1 of the arduino mega. I wish to do OTA firmware update to the arduino through UART that is connected to the ESP32. I would like to store the firmware hex file in spiffs of the esp32, and then using this spiffs file to update the arduino mega.

Thats the only requirements as of now.

If possible can you also provide me with the steps or document for the same, it will be very helpful.

Thanks in advance.

that would require something like avrdude for serial bootloader implementaion on esp32 and bootloader listening on Serial1 in Mega. both are possible, but I guess there is no tutorial for that.

so what I can offer is:

  1. If you use Linux on your PC, you can bridge avrdude over telnet to Mega. that would still require a bootloader listening on Serial1. the binary wouldn't be stored in spiffs.

  2. a self update of Mega with my ArduinoOTA library:
    2a) a normal way is to use a networking library to receive the update binary from the IDE. so with esp32 as WiFi adapter you would put AT firmware into the esp32 and use my WiFiEspAT library in Mega.
    2b) you make your own transport of the update binary (maybe over Serial1 from esp32 spiffs) and you use InternalStorage from ArduinoOTA library to store and apply the update binary

@Juraj I wanted to know how to perform the the 2nd option. Anything in the 2nd one is fine. Just wanted to know if I use WiFiEspAT library then can I continue working with the esp32 as well or I will have to do some particular changes so that I can use both the microcontrollers.

And if possible some links or some documentaion for step by step approach.

Thanks for the reply @Juraj

with 2a) you have to put the AT firmware into the esp32 so it will work only as a simple WiFi adapter. it is an acceptable role for a C3. I wouldn't use more capable esp32 versions for this inferior task

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.