Saturday, July 11, 2020

BasicOTA: Program ESP32 (or ESP8266) via ArduinoOTA, on Windows 10/Arduino IDE

One of the very useful feature of ESP32/ESP8266 is OTA (Over-The-Air) programming; such that you can update the firmware without physically connect to the device.

With ESP32/ESP8266 core for Arduino installed to your Arduino IDE, you can find ArduinoOTA examples of BasicaOTA and OTAWebUpdater under Examples for ESP32 Dev Module.


This post show trying BasicOTA examples on ESP32-DevKitC using Arduino IDE running on Windows 10, and fix the problem I faced:  Network Ports no shown and No response from device.


Basically, the default DevKitC firmware have no OTA function. So you have to flash the first firmware with OTA function using serial port (USB). After then, you can update your firmware via OTA without physical connected serial port. Both the computer used to update the firmware and the ESP devices to be updated have to be in the same network.

The ESP device I used in this example is ESP32-DevKitC with ESP32-WROOM-32 module. It should be a relatively old and original version.


Somebody (include me) reported there are no Network Ports shown up. 


Somebody suggested to install Python, somebody suggested to reboot router, or install Bonjour... All of them not work for me. In order to eliminate the problem outside my computer, I decide to use Windows 10's Mobile hotspot.


Open BasicOTA example and change ssid and password according to my network setting. Upload the ESP32 device via serial port (USB, or COM5 in this example).

Turn on Windows 10's Mobile hotspot with matched ssid/password.

Now the Network ports shown, with attached device (the programmed ESP32 with OTA function) and its assigned ip.


Once Network port selected, the Arduino IDE's Serial Monitor not work on network. So I run Putty to monitor the output from ESP device via serial port.

Now, upload your second program via OTA. But still fail due to No response from device.


Now, open Windows Security and Allow espota.exe to communicate through Windows Defender Firewall.

Upload again, and Done uploading.
(In the various steps, the assigned ip of the ESP device may be changed. Double check the ip in Putty and select the Network port accordingly.)


1 comment:

  1. Thank you for your post. It showed me the right direction.
    I had the same problem with "No response from device" and an ESP8266 NodeMCU 1.0. For an ESP 8266 you have a python-script "espota.py" instead of "espota.exe", so that you have to allow "python3.exe" to communicate through the Windows Defender Firewall. Now everything works fine.

    ReplyDelete