Failed to upload to ESP-01S/ESP-01

I was tried to upload the default blink example for esp8266 to my ESP-01 using platformIO, but it seems doen’t work, here’s the Hardware I used: two different USB downloaders, both’s chip is CH340, 4 ESP-01 and 2 ESP-01S
Software I used: I tried to set ESP-01 512K and ESP-01 1M in platformIO and the framework is arduino

The situation is I looked up in the forum, the problem is seems like CH340 chip can not work on high baud rate, so I tried to change the rate in many diffent value: I tried 115200 and higher, and also tried 28000 and lower, but both of ways did not work, the platformIO showed :
Connecting……_____
A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
(I tried to press RST pin on USB downloader, but still doen’t work)

Then I tried 57600 and 74880, the LED on ESP-01 blinked rapidly but finally failed to uploader, and platformIO showed:
A fatal error occurred: Failed to connect to ESP8266: Invalid head of packet (0x08)
even this only happed for few times, and rest fo the time it just told me time out

I thought it is the chip’s problem, but I can upload the program by using Arduino IDE with 115200 baud rate and higher successfully.

Have you tried different reset methods?

Are you on Linux or which OS?

When you open a serial monitor at 74880 baud (e.g., miniterm.py /dev/ttyUSB0 74880) and do the reset procedure (GPIO0 to GND, reset pulse to GND once), what messages do appear?

Maxgerhardt
I am on WIndows 10 and using platformIO on VScode
I set the the reset method as nodemcu and now it can work properly, and problem has been solved, thank you.

1 Like