FAQ
TL;DR: ESP8266 OTA on Windows often fails due to Bonjour/mDNS, not AV; "The problem is not the defender but the Bonjour service," and one user reports a "100% working solution" using BitBumper. Fix discovery, ensure Python 2.7 for older cores, keep GPIO0 HIGH, and call ArduinoOTA.handle(). [Elektroda, starob, post #17769426]
Why it matters: This FAQ helps Arduino IDE users on Windows quickly fix failed ESP8266 OTA uploads.
Quick Facts
- Discovery protocol: OTA targets are advertised via mDNS/Bonjour and appear as Network Ports in Arduino IDE. [Elektroda, starob, post #17769426]
- Version note: ESP8266 Arduino Core v2.1.0 docs require Python 2.7, not Python 3.5+. [“ESP8266 Arduino: OTA Updates”]
- Pin state: For OTA, set GPIO0 HIGH (normal boot), not LOW (flash mode). [Elektroda, starob, post #17769695]
- Sketch pattern: Call ArduinoOTA.handle() frequently; avoid blocking loop during upload. [Elektroda, starob, post #17769695]
- Hardware constraint: Small‑flash ESP‑07 boards can fail OTA with “not enough memory.” [Elektroda, pier, post #17770860]
What actually blocks ESP8266 OTA on Windows—Defender or something else?
Most OTA failures come from the Bonjour/mDNS service, not antivirus. “The problem is not the defender but the Bonjour service.” Ensure the Bonjour service runs and advertises your ESP. Use a Bonjour Browser to confirm discovery. If Bonjour lists it, Arduino IDE should show its Network Port. [Elektroda, starob, post #17769426]
How can I check if Bonjour/mDNS finds my ESP8266 OTA port?
Install Bonjour Browser and look for your ESP’s OTA hostname. If it appears, mDNS works. Arduino IDE will then list a matching Network Port. If it does not appear, restart the Bonjour service or your router. “Occasionally turning on a printer that presents itself in Bonjour helped.” [Elektroda, starob, post #17769426]
Why do I see “selected serial port does not exist” when trying OTA?
That message appears when the network OTA port disappears during upload. It is not a COM‑port issue in OTA mode. Ensure the ESP stays connected and visible via mDNS. Recheck Wi‑Fi signal and that the OTA target remains listed before uploading. [Elektroda, pier, post #17767792]
Do I need GPIO0 LOW for OTA like I do for serial flashing?
No. Keep GPIO0 HIGH during OTA. LOW puts the chip in serial bootloader mode. OTA needs normal runtime so the sketch can receive the update. [Elektroda, starob, post #17769695]
My OTA upload starts, then the network port vanishes—what should I check?
Verify that Bonjour is stable and your ESP remains advertised. A flaky mDNS service can drop the port mid‑upload. Use Bonjour Browser to confirm visibility. If discovery stalls, restart the service or switch to a dedicated OTA tool. [Elektroda, starob, post #17769426]
Does Python 3 break espota.py for the ESP8266 Arduino core?
For the older core docs (v2.1.0), yes. They require Python 2.7 and explicitly say not to install Python 3.5. Install Python 2.7 to match that toolchain if you follow those instructions. [“ESP8266 Arduino: OTA Updates”]
How should I structure loop() and setup() for reliable OTA?
Initialize ArduinoOTA in setup(), then call ArduinoOTA.handle() in loop(). Avoid long blocking operations. Use a flag to pause your app logic during OTA. “Only ArduinoOTA.handle() executes when you start programming” in the shared pattern. [Elektroda, starob, post #17769695]
Is there a standalone tool when Arduino IDE upload fails?
Yes. Export the compiled binary with Ctrl+Alt+S, then flash using the BitBumper OTA tool. “100% working solution” was one user’s verdict. Place the tool in your project directory and run it alongside the IDE. If this fails, inspect your sketch for blocking logic. [Elektroda, starob, post #17769426]
Why does OTA work on NodeMCU but fails on my ESP‑07?
ESP‑07 modules can have smaller flash, which triggers “not enough memory” during OTA. Your NodeMCU likely has a larger flash chip, so OTA completes. If the network port also disappears, verify Wi‑Fi and Bonjour stability first. [Elektroda, pier, post #17770860]
What is the simplest 3‑step way to upload via OTA in Arduino IDE?
- Load and upload the BasicOTA sketch over serial, and connect the ESP to Wi‑Fi.
- Confirm it appears as a Network Port via Bonjour/mDNS.
- In Arduino IDE, select that Network Port and click Upload. [“ESP8266 Arduino: OTA Updates”]
Should I disable Windows Defender or just adjust the firewall?
Do not disable Defender globally. “Disable the firewall and not all of Defender, or set exceptions.” Allow OTA traffic through the firewall. For testing, you may temporarily disable only the firewall to isolate issues. [Elektroda, Vinnic, post #17767161]
How do I fix “ERROR not answer” from OTA upload?
That error means the ESP did not respond to the OTA script. Recheck Python version and that the device remains visible. Ensure your sketch calls ArduinoOTA.handle() while running. Try again after confirming connectivity. [Elektroda, pier, post #17769620]
Do I need to select a COM port for OTA uploads?
No. OTA uses a Network Port, not a serial COM port. If only COM ports appear, fix Bonjour discovery so the IDE can show the OTA port. [Elektroda, pier, post #17768816]