Sonoff Basic Esp Http Update
Posted: Wed Apr 18, 2018 5:00 am
Hi.
I am trying to update a sketch on a Sonoff Basic using Esp Http Update.
My sketch binaries are on a RPI web server.
The problem is that it looks like the sketch size is too big for the update , but I can't see why.
The Sonoff Basic is a 1MB and the sketch size is 321Kb.
I am using Spiffs which is set to 64Kb in the Arduino 1.8.5 IDE.
Here is a snippet from the com port output when the update fails.
Update Check
IDE size = 1048576
Flash size = 1048576
Sketch size = 321536
Space size = 638976
Sketch url = http://192.168.0.22/php/updateCheck.php
Update status = 0
HTTP_UPDATE_FAILED Error (-107): New Binary Does Not Fit Flash Size
[34647] Connecting to 192.168.0.22:8080
[34665] Ready (ping: 11ms).
[35218] Time sync: OK
Strangely when I load a smaller sketch 315Kb to the Sonoff and do an update , all works ok.
Here is a snippet from the com port output when the update works.
Update check
IDE size = 1048576
Flash size = 1048576
Sketch size = 315328
Space size = 647168
Sketch url = http://192.168.0.22/php/updateCheck.php
ets Jan 8 2013,rst cause:1, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
@cp:0
ld
/alexaSetup.txt file open failed
/vpinSetup.txt configuration read
/networkSetup.txt configuration read
SSID match found
Configuring network settings for COLIN_Next
IP address = 192.168.0.200
Gateway = 192.168.0.1
Server = 192.168.0.22
Auth token = xxxxxxxxxxxxxx
Bridge 1 token = xxxxxxxxxxxxxx
Bridge 2 token = 0
Bridge 3 token = 0
Device vPin = 0
Bins = 31 32 33 34 0 0 0 0
Bridge 2 virtual pins = 0 0 0 0 0 0 0 0
Bridge 3 virtual pins = 0 0 0 0 0 0 0 0
Device name / port = /
All name / port = /
Scene 1 name / port = /
Scene 2 name / port = /
[8334]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.1 on Arduino
[8348] Connecting to 192.168.0.22:8080
[13349] Connecting to 192.168.0.22:8080
[18588] Connecting to 192.168.0.22:8080
[18610] Ready (ping: 13ms).
[18885] Time sync: OK
Sketch version = SWITCH-102
Minutes remaining to sketch update check = 1424
IDE size = 1048576
Flash size = 1048576
Sketch size = 315440
Space size = 643072
Does anyone know why a sketch size 321Kb with free space 639Kb fails.
But a sketch size 315Kb with free space 647Kb works.
Attached are the working / failed com port output files and a screenshot of the RPI file sizes.
I am trying to update a sketch on a Sonoff Basic using Esp Http Update.
My sketch binaries are on a RPI web server.
The problem is that it looks like the sketch size is too big for the update , but I can't see why.
The Sonoff Basic is a 1MB and the sketch size is 321Kb.
I am using Spiffs which is set to 64Kb in the Arduino 1.8.5 IDE.
Here is a snippet from the com port output when the update fails.
Update Check
IDE size = 1048576
Flash size = 1048576
Sketch size = 321536
Space size = 638976
Sketch url = http://192.168.0.22/php/updateCheck.php
Update status = 0
HTTP_UPDATE_FAILED Error (-107): New Binary Does Not Fit Flash Size
[34647] Connecting to 192.168.0.22:8080
[34665] Ready (ping: 11ms).
[35218] Time sync: OK
Strangely when I load a smaller sketch 315Kb to the Sonoff and do an update , all works ok.
Here is a snippet from the com port output when the update works.
Update check
IDE size = 1048576
Flash size = 1048576
Sketch size = 315328
Space size = 647168
Sketch url = http://192.168.0.22/php/updateCheck.php
ets Jan 8 2013,rst cause:1, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
@cp:0
ld
/alexaSetup.txt file open failed
/vpinSetup.txt configuration read
/networkSetup.txt configuration read
SSID match found
Configuring network settings for COLIN_Next
IP address = 192.168.0.200
Gateway = 192.168.0.1
Server = 192.168.0.22
Auth token = xxxxxxxxxxxxxx
Bridge 1 token = xxxxxxxxxxxxxx
Bridge 2 token = 0
Bridge 3 token = 0
Device vPin = 0
Bins = 31 32 33 34 0 0 0 0
Bridge 2 virtual pins = 0 0 0 0 0 0 0 0
Bridge 3 virtual pins = 0 0 0 0 0 0 0 0
Device name / port = /
All name / port = /
Scene 1 name / port = /
Scene 2 name / port = /
[8334]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/ v0.5.1 on Arduino
[8348] Connecting to 192.168.0.22:8080
[13349] Connecting to 192.168.0.22:8080
[18588] Connecting to 192.168.0.22:8080
[18610] Ready (ping: 13ms).
[18885] Time sync: OK
Sketch version = SWITCH-102
Minutes remaining to sketch update check = 1424
IDE size = 1048576
Flash size = 1048576
Sketch size = 315440
Space size = 643072
Does anyone know why a sketch size 321Kb with free space 639Kb fails.
But a sketch size 315Kb with free space 647Kb works.
Attached are the working / failed com port output files and a screenshot of the RPI file sizes.