ESP32 & IoTAdvanced

Over-the-Air (OTA) Updates for ESP32

Learn how to update your ESP32 firmware wirelessly without plugging it into your computer.

25 April 202610 min read

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

  1. After uploading the first OTA sketch via USB, the ESP32 will appear in Tools > Port under Network Ports.
  2. Select it and click Upload!
Tags:ESP32OTAWirelessProgramming