**[HELP] NodeMCU ESP8266 Upload Fails — "Timed out waiting for packet header" after Stub Running**

Board: NodeMCU 1.0 (ESP-12E Module)
IDE: Arduino IDE 2.3.8
OS: Windows 10
COM Port: COM6
Upload Speed: 115200
Flash Size: 4MB (FS:2MB OTA:~1019KB)


Problem Description:

I am unable to upload any sketch to my NodeMCU ESP8266 board. The upload process partially succeeds but fails at the "Configuring flash size" stage.

Upload Output Log:

Serial port COM6
Connecting....
A fatal esptool.py error occurred: Timed out waiting for packet header
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 8c:aa:b5:51:7d:c7
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
[FAILS HERE]

Serial Monitor Observations:

  • At 74880 baud: Shows ets Jan 8 2013, rst cause:2, boot mode:(3,7) and boot mode:(1,7) — board CAN enter flash mode
  • At 9600 baud: Garbled output (C♦♦♦)
  • At 115200 baud: Garbled output (r1□1□r□$□□n♦1♦b | ♦♦□□□♦r□b♦b□□nn□1nn□bb□p□$b□1r1)

What I Have Already Tried:

  • Manually holding FLASH/BOOT button during upload
  • Changing upload speed (tried 921600, 115200, 57600)
  • Different USB cables
  • Different USB ports
  • Lowering baud rate

Any help is appreciated. Thank you!

Perhaps I am misunderstanding something. Does this happen on the simple blink sketch? I have never changed a baud rate for an upload, why do you need to do that?

Actually I tried on each baud rate.

But I am not able to upload code.

But through Arduino droid code uploaded successfully but again showing weird symbols on serial monitor

Test with the blink sketch. If it uploads, add some Serial to it. When you do that specify 9600 or 115200 and just make sure the IDE is also set to the same baud rate. If that works all is ok, if it doesn't tell us what happened and show the code in code tags and the serial output in code tags plus a screen grab of the baud setting on the IDE. Here is what I do.

The boot message is always at 74880.

Have you tried holding the boot button down and pressing and releasing reset ?

Try with board parameter:
Erase Flash: All Flash Contents