arduino OTA远程Web升级

/*
  An OTA sample for ESP8266 by Victor.Cheung
*/
#include 
#include 
#include 
#include 

#ifndef STASSID
#define STASSID "******"
#define STAPSK  "******"
#endif

const char* ssid = STASSID;
const char* password = STAPSK;

ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;

void setup(void) {

  Serial.begin(115200);
  Serial.println();
  Serial.println("Booting Sketch...");
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);

  Serial.print("Connecting...");
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(300);
  }

  Serial.println();

  httpUpdater.setup(&httpServer);
  httpServer.begin();

  Serial.print("HTTPUpdateServer ready! Open http://");
  Serial.print(WiFi.localIP());
  Serial.println("/update in your browser");
}

void loop(void) 
{
  httpServer.handleClient();
}

你可能感兴趣的:(单片机,前端,gnu,蓝桥杯)