Introduction
OTA (Over-the-Air) updates allow you to upload new sketches to your ESP32 over Wi-Fi. This is essential for projects installed in hard-to-reach places.
Setup
Include the ArduinoOTA library in your sketch.
Key Code Sections
#include <WiFi.h>
#include <ArduinoOTA.h>
void setup() {
WiFi.begin(ssid, password);
ArduinoOTA.begin();
}
void loop() {
ArduinoOTA.handle();
}How to Upload
- After uploading the first OTA sketch via USB, the ESP32 will appear in Tools > Port under Network Ports.
- Select it and click Upload!