-->
Page 3 of 4

Re: ESP updates another ESP using ESP8266HTTPUpdateServer

PostPosted: Mon Sep 11, 2017 9:55 am
by diffstorm
Yes I do!
Are you sure that's all?

Can you share more details about it, how I can understand the end of firmware? Where it starts and finished, so what it's size etc?
Also can it read it's own firmware with its firmware? So there is an inception, maybe a RAM function needed or to read backup of the firmware?
I'll be glad if you enlighten me as much as you do know about the subject.
Thanks.

Re: ESP updates another ESP using ESP8266HTTPUpdateServer

PostPosted: Mon Sep 11, 2017 10:27 am
by rudy
ESP.getSketchMD5() returns a lowercase String containing the MD5 of the current sketch.

Maybe this will be helpful for you. https://github.com/esp8266/Arduino/issues/2228

Re: ESP updates another ESP using ESP8266HTTPUpdateServer

PostPosted: Mon Sep 11, 2017 11:08 am
by martinayotte
diffstorm wrote:Can you share more details about it, how I can understand the end of firmware? Where it starts and finished, so what it's size etc?
Also can it read it's own firmware with its firmware? So there is an inception, maybe a RAM function needed or to read backup of the firmware?
I'll be glad if you enlighten me as much as you do know about the subject.
Thanks.


The firmware is starting at address 0 and ends at address given by ESP.getSketchSize().
Of course the firmware can read itself, like this ESP.getSketchMD5() is doing.
The only limitation here, is that if you need to send it to the other ESP using chunks, usally the chunk size should be the network packet size, which is 1460 bytes (instead of 512 used my getSketchMD5(), although keeping at 512 would also work).
So, in other words, remove all the stuff related to MD5 calculation, but keep the loop with the flashRead() and sent the buffer to the other ESP.

Re: ESP updates another ESP using ESP8266HTTPUpdateServer

PostPosted: Mon Sep 11, 2017 11:23 am
by diffstorm
Guys, thank you so much! This was the example I was searching for.
I'll try to make it working.

Sincerely.