HTTPS server OTA (HTTP_UPDATE_FAILD Error (-106): Verify Bin Header Failed)

Hi,

I am trying to connect with bitbucket server but I am always getting the error HTTP_UPDATE_FAILD Error (-106): Verify Bin Header Failed.
The code is given below:
Please check and let me know what am I doing wrong?

/**
 * httpUpdate.ino
 *
 *  Created on: 27.11.2015
 *
 */

#include <Arduino.h>

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

#include <ESP8266HTTPClient.h>
#include <ESP8266httpUpdate.h>

#define USE_SERIAL Serial

ESP8266WiFiMulti WiFiMulti;

void setup() {

    USE_SERIAL.begin(115200);
    // USE_SERIAL.setDebugOutput(true);

    USE_SERIAL.println();
    USE_SERIAL.println();
    USE_SERIAL.println();

    USE_SERIAL.println("**** IMAGE 1");
    for(uint8_t t = 4; t > 0; t--) {
        USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
        USE_SERIAL.flush();
        delay(1000);
    }

    WiFiMulti.addAP("***", "***");
}

void loop() {
    // wait for WiFi connection
    if((WiFiMulti.run() == WL_CONNECTED)) {

        USE_SERIAL.println("Updating...");
        t_httpUpdate_return ret = ESPhttpUpdate.update("https://bitbucket.org/MohitTripathi123/my_file1/src/master/image1.bin","","23:40:D5:EB:C5:02:31:DA:FF:93:D1:4F:5E:C3:A7:D8:32:4F:E9:82");
        USE_SERIAL.printf("\nret: %d\n",ret); 
        switch(ret) {
            case HTTP_UPDATE_FAILED:
                USE_SERIAL.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
                break;

            case HTTP_UPDATE_NO_UPDATES:
                USE_SERIAL.println("HTTP_UPDATE_NO_UPDATES");
                break;

            case HTTP_UPDATE_OK:
                USE_SERIAL.println("HTTP_UPDATE_OK");
                break;
        }
    }
}

Please check and let me know what am I doing wrong?

You're using a service that isn't delivering binary data (bitbucket). The error is absolutely correct, requesting that URL returns a HTML document with tons of javascript code. Put your image onto a normal web server and your code probably succeeds.

Yeah,

It is working for another normal server but I wanna make this for bitbucket now. What can be the changes inside code or from bitbucket server?

Thanks

It is working for another normal server but I wanna make this for bitbucket now. What can be the changes inside code or from bitbucket server?

Get a URL from bitbucket that does deliver the binary data. The one you currently use doesn’t not deliver the image the ESP is expecting.