Esp8266 OTA - No answer after sending invitation

Hi Community,

I am working on enabling OTA on the esp8266 micro controller. I have setup all prerequisites, can compile the firmware and upload using USB cable successfully.
I have identified the IP address for the device using pio device monitor -b 115200.
Upon issuing the following command: pio run -e nodemcuv2 -t upload --upload-port I get stuck after sending the invitation and do not receive a response from the device, see log below.
I found references of this problem here: but was not able to turn this into a resolution.
Has anyone ran into this issue and how did you resolve this?

I have Linux/Ubuntu machine and my network router is NetGear.

Thanks in advance for any guidance,

[Sat Jan 7 13:12:55 2017] Processing nodemcuv2 (platform: espressif8266, board: nodemcuv2, framework: arduino)

Verbose mode can be enabled via -v, --verbose option
Collected 24 compatible libraries
Looking for dependencies…
Library Dependency Graph
| |-- v1.0
| |--
| | |-- v1.0
| |-- v1.0
|-- v1.0
Looking for upload port…
Use manually specified:
Uploading .pioenvs/nodemcuv2/firmware.bin
13:12:56 [DEBUG]: Options: {‘esp_ip’: ‘’, ‘host_port’: 21165, ‘image’: ‘.pioenvs/nodemcuv2/firmware.bin’, ‘host_ip’: ‘’, ‘auth’: ‘’, ‘esp_port’: 8266, ‘spiffs’: False, ‘debug’: True, ‘progress’: True}
13:12:56 [INFO]: Starting on
13:12:56 [INFO]: Upload size: 247776
13:12:56 [INFO]: Sending invitation to:
13:13:06 [ERROR]: No Answer
*** [upload] Error 1
========================== [ERROR] Took 10.98 seconds ==========================

Resolved! After resetting my router the issue disappeared.
Lesson learned, always try a reset before loosing numerous hours of troubleshooting.

This thread is a little old but after searching for a couple of days why my OAT with platformio always gave me this error even with a direct connection (SOFTAP) I found out about adding additional flags inside platformio.ini.

I finally found out a couple of things that can be the issue when not getting an answer:

  1. if OTA required authentification, you need to add this to the platformio.ini file

upload_flags = --auth=otapasswd ; will make it

  1. I noticed that there was an “esp_port” inside the printout ! inside my OTA code it was set to 8081, but inside platformio (basically inside the python code) it was set to 8266 !!

replacing the port to 8266 inside the code solved the problem.

check for:

Last but not least, I then wanted to upload my spiffs part (inside the data directory) this directory contains all the web stuff. It also needs or can be configured inside platformio.ini with the following flag:

upload_flags = --spiffs

That’s all, I hope it is of any help to someone !
Good luck and happy esp programming !!!

1 Like