A fatal esptool.py error occured: Write timeout

I have a CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM. I also have a HiLetgo ESP8266 NodeMCU CP2102 ESP-12E Development Board.

I would like to ping the ESP8266 NodeMCU with my Raspberry Pi through a WiFi connection between them. I do not want to do it through a hard wired connection between them.

Until now, I have done exactly what is said in the tutorial below just to establish some sort of connection between the RPi and the ESP8266 NodeMCU but I am getting an Arduino error.

The Arduino code in the above website compiles fine but when I try to upload the Arduino sketch to the ESP8266 NodeMCU, it says that it is done uploading but it also says, "A fatal esptool.py error occured: Write timeout"

Does anyone know how to deal with this error?

I am hoping that if I take care of this error, then I can proceed with the rest of the project in that tutorial in that website.

I have already installed esptool on the Raspberry Pi using $ sudo pip install esptool

Hi @Mars-Sojourner. I'm going to ask you to post the full verbose output from an upload attempt.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino > Preferences... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to "Show verbose output during: compilation" in the "Preferences" dialog.
  3. Check the box next to "Show verbose output during: ☐ upload".
  4. Click the "OK" button.
  5. Attempt an upload, as you did before.
  6. After the upload fails, you'll see a button on the right side of the orange bar in Arduino IDE: Copy error messages. Click that button.
    This copies the full output to the clipboard.
  7. Open a forum reply here by clicking the "Reply" button.
  8. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  9. Press Ctrl+V (Command+V for macOS users).
    This will paste the error output from the upload into the code block.
  10. Move the cursor outside of the code tags before you add any additional text to your reply.
  11. Click the "Reply" button to post the output.

I will get that info to you asap.

In the meantime, I just want to let you know that the LED blink sketch below works perfectly on the Nodemcu.

Hi, I know this might sound annoying to ptillisch but I do not see "Copy error messages" on the right side of the orange bar in Arduino IDE.

The bar did not turn orange but is green as if all is fine and well. It does say 'Done uploading'.

It says Done uploading after I click on 'Upload' ( Ctrl+U ) but at the same time gives this weird 'A fatal esptool.py error occurred: Write timeout' message.

. Variables and constants in RAM (global, static), used 29676 / 80192 bytes (37%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ DATA     1496     initialized variables
╠══ RODATA   1164     constants       
╚══ BSS      27016    zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 60331 / 65536 bytes (92%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ ICACHE   32768    reserved space for flash instruction cache
╚══ IRAM     27563    code in IRAM    
. Code in flash (default, ICACHE_FLASH_ATTR), used 250328 / 1048576 bytes (23%)
║   SEGMENT  BYTES    DESCRIPTION
╚══ IROM     250328   code in flash   
/home/DaveP/.arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I /home/DaveP/.arduino15/packages/esp8266/hardware/esp8266/3.1.2/tools/upload.py --chip esp8266 --port /dev/ttyAMA0 --baud 115200 --before default_reset --after hard_reset write_flash 0x0 /tmp/arduino_build_242935/NodeMCU-PingTest.ino.bin 
esptool.py v3.0
Serial port /dev/ttyAMA0
Connecting...

A fatal esptool.py error occurred: Write timeout

Ah, sorry I missed that detail in your original post.

Despite what the IDE claims, I don't think the upload was successful. The reason being that there is usually much more output from the upload process. For example:

esptool.py v3.0
Serial port COM29
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 4c:75:25:22:10:b3
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 264560 bytes to 195058...
Writing at 0x00000000... (8 %)
Writing at 0x00004000... (16 %)
Writing at 0x00008000... (25 %)
Writing at 0x0000c000... (33 %)
Writing at 0x00010000... (41 %)
Writing at 0x00014000... (50 %)
Writing at 0x00018000... (58 %)
Writing at 0x0001c000... (66 %)
Writing at 0x00020000... (75 %)
Writing at 0x00024000... (83 %)
Writing at 0x00028000... (91 %)
Writing at 0x0002c000... (100 %)
Wrote 264560 bytes (195058 compressed) at 0x00000000 in 17.2 seconds (effective 123.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

I notice this:

My understanding is that /dev/ttyAMA0 is an internal port on the Raspberry Pi computer, not the port that would be created by connecting a "HiLetgo ESP8266 NodeMCU CP2102 ESP-12E Development Board" via a USB cable.

Is your "HiLetgo ESP8266 NodeMCU CP2102 ESP-12E Development Board" connected to your Raspberry Pi with a USB cable?

If so, do you see a port with a name like /dev/ttyUSB0 in the Tools > Port menu in Arduino IDE, or is the only port listed there "/dev/ttyAMA0"?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.