Program ESP32 Wirelessly via OTA with Arduino IDE

Engineering illustration: Program ESP32 Wirelessly via OTA with Arduino IDE

After setting up Arduino IDE for wired ESP32 programming in an earlier article, this article opens up a wider possibility: uploading code wirelessly over WiFi with no USB cable at all — a feature known as Over-The-Air (OTA) programming.

The library responsible

This feature relies on the ArduinoOTA library, already bundled with the ESP32 support package in Arduino IDE, so no separate installation is needed.

A prerequisite step: the first wired upload

Wireless uploading can't start directly; the ESP32's default factory firmware doesn't support OTA out of the box. So the first sketch containing OTA code must be uploaded via a traditional USB connection, and Arduino IDE provides a ready-made example for this under File > Examples > ArduinoOTA > BasicOTA — just edit the WiFi credentials (SSID and password) in it before uploading.

Wireless uploads afterward

Once the first wired upload succeeds, the board automatically appears in Arduino IDE's Tools > Port menu with a name like "esp32-xxxxxx at your_esp_ip_address," and any future code update can be uploaded directly over the network with no cable connected.

An essential condition for continuity

Every new sketch uploaded afterward must include the same OTA code; omitting it in any upload loses the board's ability to update wirelessly going forward, requiring a return to a wired connection.

You can find ESP32 boards suited to wireless programming projects at Juthour Tech.

Leave your comment

*
*
Only registered users can leave comments.