How to Do Over the Air (OTA) Programming for ESP32 & ESP8266

by RonFrtek in Circuits > Arduino

400 Views, 2 Favorites, 0 Comments

How to Do Over the Air (OTA) Programming for ESP32 & ESP8266

How to Do Over the Air (OTA) Programming for ESP32 & ESP8266

In this tutorial we are going to Update the ESP32 board using the over-the-air (OTA) process.

This functionality is very useful in case of no physical access to the board and lets you update or upload a new program to the ESP32 or ESP8266 board over the Wi-Fi without having to connect the ESP32 or ESP8266 to the computer via the USB cable. 

Watch the video!

What You Will Need

ESP-32S.jpg
download (1).jpg
WEATHER (12).png


Start Visuino, and Select the ESP32 Board Type

select-board-uno.jpg
FVOOM76KELE690W.jpg

The Visuino: https://www.visuino.com also needs to be installed. Download Free version or register for a Free Trial.

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select your ESP32 board in this example we will use "TTGO T-Display ESP32" as shown on Picture 2

In Visuino Set WiFi

FZQ7QLZLDEJBN66.jpg
FYM6N04LDEJBN64.jpg
FPV4C6VLDEJBN68.jpg
  • Select TTGO T-Display ESP32 board and in the properties window expand "Modules>WiFi>Connect To Access Points
  • Click on the Connect To Access Points 3 Dots button
  • In the AccessPoints window drag "WiFi Access Point" to the left side
  • In the properties window set SSID (name of your WiFi hotspot or router)
  • In the properties window set Password (password of your WiFi hotspot or router)
  • Close the AccessPoints window


In Visuino Set OTA Programming Over the Air

2023-07-10_20-55-49.jpg
2023-07-10_20-58-08.jpg
2023-07-10_21-02-35.jpg
  • Select TTGO T-Display ESP32 board and in the properties window expand "Modules>WiFi>Operations
  • Click on the Operations 3 Dots
  • In the Operations window drag "Program Over WiFi" to the left side
  • In the properties window set Hostname for this example I will set it to "Test1"
  • In the properties window Optionally set the Password (password that you would need when accessing (Programming Over The Air )
  • Close the Operations window


Generate, Compile, and Upload the Code

FN4S857LDEJBS3Z.png

For the first time you need to connect the ESP32 board to your USB port.

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Making the Project

2023-07-10_21-15-51.jpg
2023-07-10_21-25-01.jpg
2023-07-10_21-25-26.jpg
  • Select TTGO T-Display ESP32 board and in the properties window expand "Modules>Display>Elements" Click on the Elements 3 Dots
  • In the Elements window Drag "Draw Text" to the left and in the properties window set  "text" to TEST


Uploading Using OTA

2023-07-10_21-09-16.jpg
2023-07-10_21-28-27.jpg

After Uploading the IP will appear in the PORT window, select the IP ,then click on the "Compile/Build and Upload" button.

A window will open requesting a password. If you did not set any password in the Operation window then just hit Enter button. and Visuino will start uploading the Project Over the WiFi.

Note: Sometimes a windows Firewall or Antivirus programs can block the connection, preventing the upload. In that case pause the firewall or add an exception to it.

Play

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Tutorial, you can download it and open it in Visuino: https://www.visuino.eu

Downloads