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).
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:
Try with default_rest (seems to be method ck?):
ian@martok:~/Coding/HA/ESP_Projects/ESP_Laufband$ "/usr/bin/python3" "/email@example.com/esptool.py" --before default_reset --after hard_reset --chip esp8266 --port "/dev/ttyUSB0" --baud 230400 write_flash 0x0 .pio/build/d1_mini/firmware.bin
Serial port /dev/ttyUSB0
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:
"/firstname.lastname@example.org/esptool.py" --before no_reset --after hard_reset --chip esp8266 --port "/dev/ttyUSB0" --baud 230400 write_flash 0x0 .pio/build/d1_mini/firmware.bin
Serial port /dev/ttyUSB0
Chip is ESP8266EX
Crystal is 26MHz
Changing baud rate to 230400
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.
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.