squix78 / esp8266-ci-ota

Example for a continuus delivery by OTA
36 stars 7 forks source link

'Verify bin header failed' error #2

Open glynhudson opened 8 years ago

glynhudson commented 8 years ago

Hi Dan, as you have probably have gathered I have been working towards re-creating your awesome continuous delivery project, and learning lots in the process. I think I'm almost there. I've got Travis and platformio setup to auto generating the compiled .bin on a release, see blog post. Today I setup the server php script and the ESP code. At first it seemed to work when the build number of the firmware matched the build number on the GitHub release I saw the following output from the ESP:

    Going to update firmware...
    Checking for Update. Current version: 0.0.1
    HTTP_UPDATE_NO_UPDATES

However when I released a point updated release on Github (0.0.1 > 0.0.2), I got the following update from the ESP:

    Going to update firmware...
    Checking for Update. Current version: 0.0.1
    HTTP_UPDATE_FAILD Error (-106): Verify bin header failedGoing to update firmwar. 

Have you any idea what could be causing the bin header failed error? The PHP script is obviously working to serve up the updated .bin, however the ESP http updater seem to be throwing an error.

Here is my ESP code with modified URL for the php scrip. The server code is unchanged ([appart from the repo URL])(https://github.com/openenergymonitor/EmonESP/blob/ota/ota/firmware.php#L3). My php script is served from here if you want to test it.

squix78 commented 8 years ago

Hi Glyn. I think I resolved your issue and I hope you're not gonna hate yourself for it: your php script starts with an empty line, actually with a new line character:

glynhudson commented 8 years ago

Doh indeed! Thanks so much, sometimes the simplest things cause so much pain! Now working beautifully 👍

Checking for Update. Current version: 0.0.3#

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1264, room 16 
tail 0
chksum 0x0f
csum 0x0f
@cp:0
     ld

emonESP Startup
BUILD_TAG: 0.0.4#
Connecting as Wifi Client to xxx epass:xxxx
Connected, IP Address: 192.168.0.75
HTTP server started
Going to update firmware...
Checking for Update. Current version: 0.0.4#
squix78 commented 8 years ago

Sweet! Happy that it works now!

Sent from my iPhone

On 27.06.2016, at 00:32, Glyn Hudson notifications@github.com wrote:

Doh indeed! Thanks so much, sometimes the simplest things cause so much pain! Now working beautifully 👍

Checking for Update. Current version: 0.0.3#

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1264, room 16 tail 0 chksum 0x0f csum 0x0f @cp:0 ld

emonESP Startup BUILD_TAG: 0.0.4# Connecting as Wifi Client to xxx epass:xxxx Connected, IP Address: 192.168.0.75 HTTP server started Going to update firmware... Checking for Update. Current version: 0.0.4# — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.