Reset method "nodemcu" no longer works with esptool v3.0?

I have some serious problems to upload to D1 Mini devices. These use reset-method nodemcu and it seems they often no longer reset at all, so upload is not possible.

I tried with different D1 Mini devices (all are “R1”, so these with the ESP-12 module on it) and two different Linux PC. Both use latest platformio 5.2.0 with esptool.py v3.0.

Upload is successful only sporadically (~ 1 out of 10). I also tried with resetmethod=ck - this also works sporadically. It seems that there is a increased chance of sucess just after changing resetmethod to ck, but this may be a coincidence. In case of default method (=nodemcu) it seems that the esp is not reset at all. (One D1 Mini I tried is connected to a dot matrix with some animation which runs continiously)

Upload to ESP-07 works fine (resetmethod=ck, so DTR is connected to GPIO0 and RTS to Reset).

Does it make a difference if you use a higher or lower esptoolpy version? Just add

platform_packages =
   tool-esptoolpy@~1.30100.0

to the platformio.ini to get 3.1.0, or ~1.20800.0 for 2.8.0 (per API).

Thanks for the hint, but unfortunately the problem is same with 3.1.0 or 2.8.0.

However, I found out that upload works fine just after changing reset method after a timeout from default_reset to no_reset. To reproduce, I directly call esptool.py as it would be called from pio run --target=upload -v:

  1. Try with default_rest (seems to be method ck?):
ian@martok:~/Coding/HA/ESP_Projects/ESP_Laufband$ "/usr/bin/python3" "/home/ian/.platformio/packages/tool-esptoolpy@1.30000.201119/esptool.py" --before default_reset --after hard_reset --chip esp8266 --port "/dev/ttyUSB0" --baud 230400 write_flash 0x0 .pio/build/d1_mini/firmware.bin
esptool.py v3.0
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header

If and only if I run this (no_reset, seems to be method nodemcu ?) directly afterwards, the upload succeeds most of the time:

ian@martok:~/Coding/HA/ESP_Projects/ESP_Laufband$ "/usr/bin/python3" 
 "/home/ian/.platformio/packages/tool-esptoolpy@1.30000.201119/esptool.py" --before no_reset --after hard_reset --chip esp8266 --port "/dev/ttyUSB0" --baud 230400 write_flash 0x0 .pio/build/d1_mini/firmware.bin
esptool.py v3.0
Serial port /dev/ttyUSB0
Connecting........
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:d0:15:da
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 230400
Changed.
Configuring flash size...
Compressed 291904 bytes to 212510...
Wrote 291904 bytes (212510 compressed) at 0x00000000 in 9.4 seconds (effective 248.0 kbit/s)...
Hash of data verified.

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

Repeating with no_reset or running esptools several times does not succeed?!

I also tried with on more D1 Mini I have (so 5 different in total), same results…

Hi, I have the same problem. I am running linux mint, everything was working fine until I updated the kernel to 5.4.0-88. If I boot from the kernel 5.4.0-86 the uploads work every time. uploading to a nodemcu module works with any kernel, I am guessing that the problem derives from the fact that the D1 Mini uses a CH341 USB to UART and the nodemcu uses CP2102 USB to UART. I have tried with kernels 5.11 and the problem persist I don’t want to be stuck with an specific kernel version, so any help would be appreciated.

Sounds like Linux specific failure.

1 Like

Thanks for the link.

Downgrading kernel to 5.11.0-36 solved this issue.

1 Like