Self-updating ( from WEB server HTTP ) OTA firmware for ESP8266 AND ESP32!

I tried everything but result is the same !
“HTTP_UPDATE_FAILD Error (-106): Verify Bin Header Failed”
I don’t know what to do now, is it possible its because of the cloud hosting ? does anybody have files on VPS so i test it ?

did you see this:


also see this:

1 Like

HI @mikekgr

I am going a bit off topic here but I wondered if you had used BearSSL yet?

I upgraded to ESP8266 2.4.2 today and I was expecting to have BearSSL available for selection in the Arduino IDE (under lwip). Maybe it’s just the libraries that are different.

I know there are some new examples like SecureBearSSLUpdater.ino and HelloServerBearSSL.ino etc.

2.4.2 gives just enough extra memory to do a few more SSL things that 2.4.1 didn’t allow.

Good to see that Blynk NTP time comes up correctly now plus all the other new features like URL button, images, number input widget etc.

Hello @Costas Paul, ( relative ) long time no see !
As far as I know ,the new under final debugging/cooking 2.5.0 will have full SSL support, I don’t know if 2.4.2 has partial support, because I sync the Arduino core master…

Best Regards,
Mike Kranidis

Do you have any idea when 2.5.0 will be available?

I did notice there were quite a few “BearSSL” commits after 2.4.2 release but I thought it was implemented in 2.4.2.

I think it is needed a couple of weeks but nobody can be sure…

1 Like

Are there problems with the 2.4.2 release that warrants using the master?

No as far as I know but in Master there are more goods in development…

See here for the progress:

1 Like

Hi @mikekgr

I updated to ESP8266 core 2.5.0-beta1 today and it looks to be running ok.
The new https stream provided by BearSSL means I can reliably pull in 17,000 characters (34kb) with an API call to a crypto trading exchange. Free memory before I start adding my code, but with the API call included is an impressive, and stable, 46,176 bytes.

1 Like

Hi, mikekgr,

I recently started working with esp8266, I did lots of work but am finally stuck with HTTP server OTA.
at that time recently saw your post I thought that this will work for me, I started doing work on that stuff. I uploaded two files what you said in your post(.version and .bin) but finally, I am getting an error like “HTTP_UPDATE_FAILD Error (-101): Server Did Not Report Size”. Now I am not understaing wht it is coming like this, can you please help for this error.

My total output is:

Version - 0.0.0<CR><LF>
Mode: STA<CR><LF>
PHY mode: N<CR><LF>
Channel: 1<CR><LF>
AP id: 0<CR><LF>
Status: 1<CR><LF>
Auto connect: 1<CR><LF>
SSID (7): Pert AP<CR><LF>
Passphrase (8): ta55yoka<CR><LF>
BSSID set: 0<CR><LF>
....Server DisconnectedSERVER_CONNECT<CR><LF><CR><LF>
Checking for firmware updates.<CR><LF>
MAC address: 600194412A13<CR><LF>
Firmware version URL:<CR><LF>
Current firmware version: 18122801<CR><LF>
Available firmware version: 18122802<CR><LF>
Preparing to update<CR><LF>
Firmware image URL:<CR><LF>
HTTP_UPDATE_FAILD Error (-101): Server Did Not Report Size

@UdayPert which Arduino ESP8266 core version are you using?

@UdayPert: If I open the “Firmware image URL” mentioned above in a browser and check the content of the response header I don’t see “Content-Length” as a key.
That is why the result is “HTTP_UPDATE_FAILD Error (-101): Server Did Not Report Size”.


@Costas: This applies for all ESP8266 core versions up to the current 2.5.0-beta2.

@Costas: ESP8266 Core version 2.4.2(Stable version).

@IBK: Okay So where i need to mention the content leangth.

@UdayPert: As I said: “Content-Length” needs to be in the response header that comes from the http server.

@IBK My server person run that PHP script after that i got this response.

HTTP_UPDATE_FAILD Error (-100): Not Enough space

@UdayPert when you compile your sketch what sizes are shown.

A basic sketch is something like:
Sketch uses 331168 bytes (31%) of program storage space. Maximum is 1044464 bytes.

Sketch needs to be less than 50% for OTA update. That is space for original sketch and new sketch.

@UdayPert maybe you only have memory set to 512kb. Your bin file is 276kb which would be 54% i.e. too big.

@IBK: After code compile it shoes like this
Sketch uses 278396 bytes (55%) of program storage space. Maximum is 499696 bytes.
Global variables use 30100 bytes (36%) of dynamic memory, leaving 51820 bytes for local variables. Maximum is 81920 bytes.