espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.28k stars 7.35k forks source link

Delta firmware OTA (DFOTA) #4366

Closed nzagorec closed 3 years ago

nzagorec commented 3 years ago

Hi,

Has anyone tried to generate delta between two binaries and use it to upgrade the firmware on ESP32? Would this require some support from IDF or can it be done completely in code? I'd like to shrink my upgrade packages as much as possible so I can use LPWAN to transfer them to the MCU.

Thanks! N

lbernstone commented 3 years ago

You will certainly need to use the idf functions to pull and modify the ota partitions, but it should be possible to it with a stream oriented diff method and the release version arduino libraries.

nzagorec commented 3 years ago

Thanks @lbernstone !

I tried using bsdiff to generate delta between two binaries and it worked great, delta bin is only 17KB big. When I convert it to hex it's 75KB which is still ok to transfer.

Imagine I have this hex on my ESP's flash, what would be the next step towards re-constructing an original binary?

Appreciate your help! N

lbernstone commented 3 years ago

This forum is for discussing issues about the codebase. For general discussion or fishing for someone to write your code, please take it to esp32.com.

nzagorec commented 3 years ago

No need to be rude, I'm not fishing for anything, just wanted someone to point me into right direction. Will tackle it on my own.

Cheers! N