0

I've just spent a few hours on this and I am starting to go crazy. I have code to do a firmware update over HTTP working on several ESP32s. I'm trying to adapt that code to work on an ESP8266, but can't get it to work. I've copied several examples from the internet that work for everyone else, not to mention my own code that works on the ESP32. The error is

HTTP_UPDATE_FAILD Error (-106): Verify Bin Header Failed

I would attribute that to an issue with my bin URL, however, when I copy/paste the link in to a browser, it downloads it fine, and I even tried using the same URL that is working with my ESP32 boards, with the same result. My code is below, and is pretty darn close to the provided example (I'm on the ESP 3.0.0 core).

    #include <ESP8266WiFi.h>
    #include <ESP8266HTTPClient.h>
    #include <ESP8266httpUpdate.h>
    
    #define URL_fw_Bin "https://raw.githubusercontent.com/[my profile]/[my project]/main/[firmware].bin"
    
    void setup() {
      Serial.begin(9600);
      WiFi.begin();
      while(WiFi.status()!=WL_CONNECTED){
        delay(1000);
        Serial.print(".");  
      }
    
      WiFiClientSecure client;
      client.setInsecure();
      ESPhttpUpdate.setLedPin(LED_BUILTIN, LOW);
      t_httpUpdate_return ret = ESPhttpUpdate.update(client, URL_fw_Bin);
    
      switch (ret) {
      case HTTP_UPDATE_FAILED:
        Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
   
      case HTTP_UPDATE_NO_UPDATES:
        Serial.println("HTTP_UPDATE_NO_UPDATES");
        break;
    
      case HTTP_UPDATE_OK:
        Serial.println("HTTP_UPDATE_OK");
        break;
      }
    }
    void loop() {
    }
1
  • The error message "Verify Bin Header Failed" suggests there might be an issue with the header of the binary file.
    – tepalia
    Apr 3 at 9:42

1 Answer 1

0

have "solved" the issue -- this is due to a bug in the ESP8266 core 3.0.0. Using core 2.7.4 solves the issue. This issue appears to describe the issue, but perhaps the fix hasn't made it to the full release yet:

https://github.com/esp8266/Arduino/issues/8079

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.