I have a project which is using OTA and all was fine.
But I need to reinstall my computer and now, I have Arduino 1.6.12 and I update my esp8266 boradmanager.
Now i can't do any OTA update.
AFter a try, I need to erase the flash before downloding the sktech from Arduino IDE again.
I try on an ESP07 and an ESP12F.
My Flash configuration is 512k with 64ko SPIFFS
I validate the debug information on the ESP and I have this trace:
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld
Booting Sketch...
wifi evt: 0
wifi evt: 3
Connecté!
adresse IP DHCP: 192.168.0.17HTTPUpdateServer ready! Open http://esp8266-webupdate.local/update </br> http://192.168.0.17/update in your browser
WS:ac
:ref 1
WS:av
:ref 2
:ur 2
New client
:ref 2
:ur 2
:rn 344
method: GET url: /update search:
headerName: Host
headerValue: 192.168.0.17
headerName: User-Agent
headerValue: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
headerName: Accept
headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
headerName: Accept-Language
headerValue: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
headerName: Accept-Encoding
headerValue: gzip, deflate
headerName: Connection
headerValue: keep-alive
headerName: Upgrade-Insecure-Requests
headerValue: 1
:c0 1, 344
args:
Request: /update
Arguments:
:wr
:sent 116
:ww
:wr
:sent 226
:rcl
:abort
:ww
:ur 1
WS:dis
:del
:urn 61
:urd 9, 61, 13
:urd 4, 61, 23
:urd 11, 61, 28
WS:ac
:ref 1
WS:av
:ref 2
:ur 2
New client
:ref 2
:ur 2
:rn 1460
method: POST url: /update search:
headerName: Host
headerValue: 192.168.0.17
headerName: User-Agent
headerValue: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0
headerName: Accept
headerValue: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
headerName: Accept-Language
headerValue: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
headerName: Accept-Encoding
headerValue: gzip, deflate
headerName: Referer
headerValue: http://192.168.0.17/update
headerName: Connection
headerValue: keep-alive
headerName: Upgrade-Insecure-Requests
headerValue: 1
headerName: Content-Type
headerValue: multipart/form-data; boundary=---------------------------402932169941
headerName: Content-Length
headerValue: 260231
args:
Parse Form: Boundary: ---------------------------402932169941 Length: 260231
PostArg FileName: ProGOTA.ino.generic.bin
PostArg Name: update
PostArg Type: application/octet-stream
Start File: ProGOTA.ino.generic.bin Type: application/octet-stream
sleep disable
[begin] roundedSize: 0x00029000 (167936)
[begin] updateEndAddress: 0x0006B000 (438272)
[begin] currentSketchSize: 0x00041000 (266240)
[begin] _startAddress: 0x00042000 (270336)
[begin] _currentAddress: 0x00042000 (270336)
[begin] _size: 0x00029000 (167936)
.......
:rch 4380, 842
:c 1, 1460, 5222
:c 1, 1460, 3762
:c 1, 1460, 2302
ERROR[1]: Flash Write Failed
premature end: res:1, pos:167936/167936
End File: ProGOTA.ino.generic.bin Type: application/octet-stream Size: 260016
:c0 1, 842
Done Parsing POST
Request: /update
Arguments:
:wr
:sent 115
:ww
:wr
:sent 14
:rcl
:abort
:ww
state: 5 -> 0 (0)
rm 0
del if0
bcn 0
del if1
usl
wifi evt: 1
STA disconnect: 8
:ur 1
WS:dis
:del
:ur 1
"@*rjrA(!‹Sëq‹ÐšöXËAz~‡êQª!KUI…�¸É*E,±±©Äк¡ûþA¬�þní*e"HèInA,P'áÝîAP'¡Ð+КS[Í/Qámr§
Then my ESP boot endlessly.
My sketch is based on the example ESP8266httpUpdate
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
const char* host = "esp8266-webupdate";
const char* ssid = "XXXX";
const char* password = "YYYY";
ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
void setup(void){
Serial.begin(74880);
Serial.println();
Serial.println("Booting Sketch...");
/*WiFi.softAPdisconnect(true);
WiFi.disconnect(true);
ESP.eraseConfig();
ESP.reset();*/
WiFi.mode(WIFI_AP_STA);
WiFi.begin(ssid, password);
while(WiFi.waitForConnectResult() != WL_CONNECTED){
WiFi.begin(ssid, password);
Serial.println("WiFi failed, retrying.");
}
Serial.print ("Connecté!\n adresse IP DHCP: " + WiFi.localIP().toString());
MDNS.begin(host);
httpUpdater.setup(&httpServer);
httpServer.begin();
MDNS.addService("http", "tcp", 80);
Serial.printf("HTTPUpdateServer ready! Open http://%s.local/update </br> http://%s/update in your browser\n", host, WiFi.localIP().toString().c_str());
}
void loop(void){
httpServer.handleClient();
}
Any idea will be welcome