ESP8266: Arduino IDE uploads, PlatformIO does not

Board: ESP8266 ESP-01
Programmer: USB to ESP8266, CH340C

OS: Manjaro, kernel 5.16.7
PlatformIO Core: 5.2.5
Framework: Arduino

I have been getting the following error when attempting to upload to the ESP8266 via PlatformIO:

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

platformio.ini

[env:esp01_1m]
platform = espressif8266
board = esp01_1m

I have tried various upload_speed settings, 9600, 74880 and 115200. I can monitor serial output sent by the board after pressing the Reset button on the programmer using a 74880 baud rate, but uploading always fails.

However I can successfully upload with Arduino IDE, using the Generic ESP8266 Module board, which is good news and hopefully means that I’m just a setting or two off in PlatformIO.

Is there anything that jumps out at anybody that I am doing wrong?

You have to use the same reset method and flash mode to get the same results. This seems like the same topic as in ESP01 code upload works with Arduino IDE but not with PIO?.

Thanks, sorry I missed that one! This works…

[env:esp01_1m]
platform = espressif8266
board = esp01_1m
upload_resetmethod = nodemcu
1 Like

I was just about to give up on platformio when I found this answer. It worked for me also. Thank You.

Same here; ordered new ESPs and USB boards,

Had to add:

upload_resetmethod = nodemcu

to this section to make it work:

[env:esp01]
platform = espressif8266
board = esp01
framework = arduino
upload_resetmethod = nodemcu