programmer131 / ESP8266_ESP32_SelfUpdate

89 stars 71 forks source link

Error 101 Server Did Not Report Size from OTA Upgrade framework via git hub #8

Closed soheilpaper closed 3 years ago

soheilpaper commented 3 years ago

I have tried this video:

ESP8266 Self Update OTA from GitHub

Instruction and made this GitHub repo:

And changed the main code to this type, but I get this error:

HTTP_UPDATE_FAILD Error (-101): Server Did Not Report Size

enter image description here when the FirmwareUpdate(); code is running. So I don't know why GitHub don't answer to the esp8266, as said here:

The error has nothing to do with your sketch. Also, the error code is not a HTTP 101 error. The problem is that your server does not send the response header 'Content-Length'

I have some dupt about the bin URL file address which have many dot on the end of it (https://github.com/soheilpaper/ota_github_blink/blob/main/BlinkWithoutDelay.ino.esp8285.bin) on it, could it be the reason for none answering and giving the 101 code form GitHub server!

Any suggestion would be good help to fix this bug.

Update:

I have changed the bin file name to this kind :

 BlinkWithoutDelay.ino.esp8285.bin  ---->      BlinkWithoutDelay_ino_esp8285.bin

But I have again the same GitHub 101 error.

Also asked here: https://arduino.stackexchange.com/questions/80890/error-101-server-did-not-report-size-from-ota-upgrade-framework-via-git-hub

Thanks.

programmer131 commented 3 years ago

there is issue with your firmware url, it should be something like this URL_fw_Bin "https://raw.githubusercontent.com/programmer131/otaFiles/master/firmware.bin" your link points to webpage, not to bin file https://github.com/soheilpaper/ota_github_blink/blob/main/BlinkWithoutDelay_ino_esp8285.bin

soheilpaper commented 3 years ago

there is issue with your firmware url, it should be something like this URL_fw_Bin "https://raw.githubusercontent.com/programmer131/otaFiles/master/firmware.bin" your link points to webpage, not to bin file https://github.com/soheilpaper/ota_github_blink/blob/main/BlinkWithoutDelay_ino_esp8285.bin

Thanks
Based on the timemage answer via the other question, I have changed the address of bin and TXT file by finding the download link of those files form the GitHub. And it has been working by changing the blob part of address to raw, so the bin address changed form https://github.com/soheilpaper/ota_github_blink/blob/main/BlinkWithoutDelay_ino_esp8285.bin to https://github.com/soheilpaper/ota_github_blink/raw/main/BlinkWithoutDelay_ino_esp8285.bin And the https://github.com/soheilpaper/ota_github_blink/blob/main/version.txtto https://raw.githubusercontent.com/soheilpaper/ota_github_blink/main/version.txt

And now that error has been fixed as you can see below:

enter image description here

Although I gave some dupt about upgrading the main code by getting this output via serial port:

Device already on latest firmware version

And I would check it after some resting!.

Thanks.

programmer131 commented 3 years ago

closing as issue is already fixed.