#include #include #include ADC_MODE(ADC_VCC); // USER CONFIGURED SECTION START // const char* ssid = "YOURSSID"; const char* password = "YOURPASSWORD"; ESP8266WebServer httpServer(80); ESP8266HTTPUpdateServer httpUpdater; void setup() { Serial.begin(115200); WiFi.persistent(false); WiFi.mode(WIFI_STA); WiFi.setSleepMode(WIFI_LIGHT_SLEEP); WiFi.hostname(WiFi.macAddress()); WiFi.setPhyMode(WIFI_PHY_MODE_11N); WiFi.begin(ssid, password); httpServer.on("/", handle_root); httpServer.on("/reboot", reboot); httpUpdater.setup(&httpServer); httpServer.begin(); } void loop() { httpServer.handleClient(); delay(10); } void handle_root() { String webpage = String("") + "WebFlash Bootloader\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "
ESP8266 Infomation
MAC Address:" + WiFi.macAddress().c_str() + "
CPU Speed:" + ESP.getCpuFreqMHz() + " MHz
CPU ID:" + ESP.getChipId() + "
Vcc:" + ESP.getVcc() + " mV
Flash Chip ID:" + ESP.getFlashChipId() + "
Flash Size:" + ESP.getFlashChipSize() + " bytes
Flash Real Size:" + ESP.getFlashChipRealSize() + " bytes
Flash Speed:" + (ESP.getFlashChipSpeed() / 1000000) + " Mhz
Flash Mode:" + ( ESP.getFlashChipMode() == FM_QIO ? "QIO" : ESP.getFlashChipMode() == FM_QOUT ? "QOUT" : ESP.getFlashChipMode() == FM_DIO ? "DIO" : ESP.getFlashChipMode() == FM_DOUT ? "DOUT" : "UNKNOWN") + "
WiFi mode:" + WiFi.getPhyMode() + "
WiFi status:" + WiFi.status() + "
WiFi RSSI:" + WiFi.RSSI() + "
\n" + "
- Reboot
- Update Firmware" + "

" + ESP.getFullVersion() + ""; httpServer.sendHeader("Refresh", "10"); httpServer.send(200, "text/html", webpage); } void reboot() { String webpage = "Rebooting"; httpServer.send(200, "text/html", webpage); httpServer.handleClient(); delay(100); ESP.restart(); }