As the title suggests, is it possible to flash a program to ESP32 (preferably ESP32-WROOM) using another ESP32?
I am trying to read a flashable file for ESP32 from SD card, then I want this file to be flashed on the other ESP32. I found this, but its for ATMega328 and I'm pretty sure its done differently on ESP MCUs.
Yes, I tend to agree, take a look at OTA, really take a look at it.. OTA Source..
It uses update.h, same as what I used here.. nards lib source..
my updates are stored in blob fields inside a database..
the storage medium does not matter and i see no reason why you couldn't use a serial connection to download the patch instead of ethernet..
really only needed to create 3 function, OTAbegin, OTAchunk, OTAend..
Thank you for your reply! I am aware of OTA for ESP32 and I'm not sure if I understood what does "medium does not matter" and "instead of ethernet" means.
My project requires an ESP32 to be programmed by another ESP32, whereas the flashable programs are stored in an SD card. Hence, I cannot use OTA.
your storage medium (media) is going to be an SD card on a adjacent ESP32 (updater)..
The updater will read the new firmware from it's connected SD card and transfer this to the other ESP32 you wish to update..
How you transfer the firmware from the updater to the waiting ESP32 should not matter, does not have to be Over The Air per say, can be serial connection, bluetooth or if you want to go really extreme you can bit bang it in..
Kind of figured you would be using simple serial connection between the 2 esp32's..
Well, I'm planning to connect the two via serial communication if its possible through OTA. But I don't know where to start nor if there are any helpful libraries I could use. I can't find any articles, materials, or good reads on Google either.
You will eventually be using.. update.h
Other OTA libs are based on it..
They do have some examples, one of them being the SD loader I linked to earlier..
What they don't have is an example of using serial to transfer in the update..
Not going to sugar coat it, it's not exactly easy, kind of remember a few frustrating weeks before success..
Going to have to send the update in chunks, I ultimately landed on using a 4kb buffer, seemed to get me best speed, with serial, going to need a smaller buffer,I started out using the default of 128 bytes..
Need to define some type of protocol and with serial probably should add in some type of simple checksum on each packet to make sure they arrive properly..
Thinking the first step is to be able to send any file read off SD and sent by serial to the other ESP, you will find that's the bulk of this task..
Once you get them chunks flying, passing them to update.h is cake..
I've checked out some OTA examples and documentations. I get it now. And I'm hesitating to continue developing my project via UART, I might transfer the flashable program through WiFi instead.