-->
Page 2 of 4

Re: ESP updates another ESP using ESP8266HTTPUpdateServer

PostPosted: Sun Sep 10, 2017 4:04 am
by diffstorm
@martinayotte your idea is OK, the problem is how to share the firmware using WebServer. I just found a simple way to share a file, but I do not know where to read the firmware into buffer then share it byte per byte.. I think nobody did this before.

Re: ESP updates another ESP using ESP8266HTTPUpdateServer

PostPosted: Sun Sep 10, 2017 9:02 am
by martinayotte
The SDWebServer example simply do that for many kind of files :
https://github.com/esp8266/Arduino/blob ... Server.ino
Then, you can use the WebUpdater.ino to get the file by providing the URL pointing to your SDWebServer.
https://github.com/esp8266/Arduino/blob ... pdater.ino

Re: ESP updates another ESP using ESP8266HTTPUpdateServer

PostPosted: Mon Sep 11, 2017 5:14 am
by diffstorm
You didn't read my answer, everything is OK except how to read the firmware programatically from ESP itself

Re: ESP updates another ESP using ESP8266HTTPUpdateServer

PostPosted: Mon Sep 11, 2017 9:28 am
by martinayotte
Do you mean reading it own firmware and send it to the other ESP ?
Pretty easy : simply use ESP.flashRead() function in a loop until the end of the firmware.
Take a look at ESP.getSketchMD5() function, it is pretty similar to calculate the MD5 by reading firmware byte per byte.