Daniel D'Souza
Published

Flash ESP32/ESP8266 OTA Using Your Smartphone

Update ESP32/ESP8266 code wirelessly via WiFi. Upload once via USB, then use a browser to send new code—no cables needed, even in hard spots

IntermediateFull instructions provided1 hour10
Flash ESP32/ESP8266 OTA Using Your Smartphone

Things used in this project

Hardware components

ESP32
Espressif ESP32
×1
NodeMCU ESP8266 Breakout Board
NodeMCU ESP8266 Breakout Board
×1
USB Cable, USB Type C Plug
USB Cable, USB Type C Plug
×1
Android device
Android device
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

ESP32 / ESP8266 OTA Web Updater (Basic)

C/C++
Upload this sketch once using a USB cable. Open Serial Monitor to find the IP address. Enter the IP in your smartphone browser, choose the compiled .bin file, and upload to update firmware wirelessly.
#include <WiFi.h>
#include <WebServer.h>
#include <ElegantOTA.h>

const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";

WebServer server(80);

void setup() {
  Serial.begin(115200);

  WiFi.begin(ssid, password);
  Serial.println("Connecting to WiFi...");

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

  Serial.println("\nConnected!");
  Serial.print("IP Address: ");
  Serial.println(WiFi.localIP());

  server.on("/", []() {
    server.send(200, "text/plain", "ESP OTA Ready");
  });

  ElegantOTA.begin(&server);  // Start ElegantOTA

  server.begin();
}

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

Credits

Daniel D'Souza
2 projects • 0 followers
Embedded systems & robotics engineer with 9+ yrs in IoT & hardware, building practical projects and hands-on STEM learning

Comments