Close Menu
Circuit of Things
  • Home
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • About Us
  • Get In Touch
  • 3D Print
  • Shop Now !
  • Electro Calc

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

Instagram WhatsApp
  • Terms and Conditions
  • Disclaimer
  • Privacy Policy
Circuit of Things Circuit of Things
  • Home
  • Projects
    • Raspberry Pi Projects
    • Arduino Projects
    • ESP8266 Projects
    • ESP32 Projects
    • IoT Tutorials
    • Sensors & Modules
    • IoT Basics
  • About Us
  • Get In Touch
  • 3D Print
  • Shop Now !
  • Electro Calc
Hire us
Circuit of Things
Home»ESP32 Projects»ESP32 OTA Updates: Program Your Board Over Wi-Fi with Arduino IDE
ESP32 Projects

ESP32 OTA Updates: Program Your Board Over Wi-Fi with Arduino IDE

Sai Preetham KoyyalaBy Sai Preetham KoyyalaMay 4, 2026No Comments2 Mins Read
Share Facebook Twitter Pinterest LinkedIn Tumblr Reddit Telegram Email
Share
Facebook Twitter LinkedIn Pinterest Email
Contents
  • Introduction
  • How OTA Works
  • Step 1: Install Required Tools
  • Step 2: Upload the OTA Base Code
  • Step 3: Upload Over Wi-Fi
  • Security Tip
  • Conclusion

Introduction

OTA (Over-The-Air) updates allow you to upload new firmware to your ESP32 over Wi-Fi, without physically connecting a USB cable. This is a game-changer for deployed IoT projects — imagine updating the code on a sensor mounted on your roof without climbing up to get it!

How OTA Works

The ESP32 runs a small OTA server in the background. When you upload from the Arduino IDE, it sends the compiled binary over your local Wi-Fi network directly to the ESP32, which writes it to flash and reboots into the new code.

Step 1: Install Required Tools

OTA requires Python 3 on your computer. Install it from python.org. The ESP32 Arduino core includes the necessary OTA libraries automatically.

Step 2: Upload the OTA Base Code

This code must be uploaded once via USB. After that, all future updates go over Wi-Fi.

#include <WiFi.h>
#include <ArduinoOTA.h>
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASSWORD";
void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) delay(500);
  Serial.println("IP: " + WiFi.localIP().toString());
  ArduinoOTA.setHostname("esp32-iot-device");
  ArduinoOTA.setPassword("your_ota_password");
  ArduinoOTA.onStart([]() { Serial.println("OTA Start"); });
  ArduinoOTA.onEnd([]() { Serial.println("\nOTA Done!"); });
  ArduinoOTA.onProgress([](unsigned int prog, unsigned int total) {
    Serial.printf("Progress: %u%%\r", (prog / (total / 100)));
  });
  ArduinoOTA.onError([](ota_error_t error) {
    Serial.printf("Error[%u]\n", error);
  });
  ArduinoOTA.begin();
  Serial.println("OTA Ready!");
}
void loop() {
  ArduinoOTA.handle(); // Must be called every loop!
  // Your normal code here...
  delay(1000);
}

Step 3: Upload Over Wi-Fi

  1. After uploading the base code via USB, open the Arduino IDE.
  2. Go to Tools > Port — you will now see a network port listed as your ESP32’s hostname.
  3. Select it and upload your new sketch normally. It will transfer over Wi-Fi!

Security Tip

Always set a strong OTA password with ArduinoOTA.setPassword(). Without a password, anyone on your network can overwrite your ESP32 firmware.

Conclusion

OTA updates are essential for any production IoT deployment. Once set up, you will never need to physically access your ESP32 again for firmware updates.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
Previous ArticleLDR Light Sensor with Arduino: Auto Night Light Project
Next Article Arduino Servo Motor Control: Sweep, Potentiometer and Button Projects
Sai Preetham Koyyala
  • Website
  • Facebook
  • X (Twitter)
  • Instagram
  • LinkedIn

Hello, I am Sai Preetham Koyyala. I'm an electronics engineer by profession, a DIY enthusiast by passion. ESP32 and Arduino are the main topics of my work.

Related Posts

ESP32 Projects

ESP32 Firebase Realtime Database: Send and Receive Data from the Cloud

May 4, 2026
ESP32 Projects

ESP32 Bluetooth Tutorial: Wireless Serial Communication with Arduino IDE

May 4, 2026
ESP32 Projects

ESP32 Deep Sleep Mode: Extend Battery Life in IoT Projects

May 4, 2026
Add A Comment
Leave A Reply Cancel Reply


KSP Electronics
✓ Trusted Store
Everything for Your
Next IoT Build
Boards, sensors, modules & kits delivered fast across India.
ESP32 Arduino Sensors Modules DIY Kits
500+
Products
Fast
Delivery
★★★★★
Rated
🛒 Shop Now →
kspelectronics.in
💻
● Available for Projects
Hire Me for
IoT Projects
ESP32, LoRaWAN, cloud dashboards & custom hardware — end-to-end IoT solutions for your needs.
ESP32 LoRaWAN MQTT Arduino Cloud PCB Design
3+
Yrs Exp
20+
Projects
★★★★★
Rated
💬 Chat on WhatsApp
View services →
Top Posts

Raspberry Pi: How to Control a DC Motor with L298N and PWN on a Web Server

July 14, 2023

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Follow Us
  • Telegram

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

Most Popular

Raspberry Pi: How to Control a DC Motor with L298N and PWN on a Web Server

July 14, 2023

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

Esp8266 / NodeMCU Pinout: A Comprehensive Guide for Beginners

June 25, 2023
Our Picks

Relay Module with Arduino: Control High Voltage Appliances Safely

May 4, 2026

NodeMCU ESP8266 Sensor Data to ThingSpeak IoT Platform

May 4, 2026

ESP32 Firebase Realtime Database: Send and Receive Data from the Cloud

May 4, 2026

Stay in the Loop!

Subscribe to get the latest IoT tutorials, Arduino projects, and electronics guides delivered straight to your inbox.

© 2026 Circuit of Things. All Rights Reserved. Built with ❤️ for the Maker Community.

  • About
  • Privacy
X (Twitter) Instagram YouTube WhatsApp
  • Book an Appointment
  • My Bookings
  • Support Us
© 2026 Circuit of Things. Designed by Sai Preetham Koyyala.

Type above and press Enter to search. Press Esc to cancel.