After serial upload when upload on air for first time appear this error:
Update error: ERROR[11]: Invalid bootstrapping state, reset ESP8266 before updating
simply before uploading ... need to reset esp module!
response:
The documentation already says that if you upload a sketch through serial, you'll have to reset the board first manually, before OTA will work, ie. upload via serial, reset the board, then use OTA.
https://github.com/esp8266/Arduino/issues/3915
..............................................................................................................................
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;
const char *ssid = "ESP8266"; // The name of the Wi-Fi network that will be created
const char *password = ""; // The password required to connect to it, leave blank for an open network
void setup() {
Serial.begin(115200);
delay(10);
Serial.println('\n');
MDNS.begin(host);
httpUpdater.setup(&httpServer);
httpServer.begin();
MDNS.addService("http", "tcp", 80);
Serial.printf("HTTPUpdateServer ready! Open http://%s.local/update in your browser\n", host);
}
void loop() {
httpServer.handleClient();
}
............................
in ESP8266Basic.ino i insert:
line 48 #include <ESP8266HTTPUpdateServer.h>
line 49 ESP8266HTTPUpdateServer httpUpdater;
line 1218 httpUpdater.setup(server);