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

I am trying to flash a new ESP8266, but when connecting it to my server using USB, after the compile phase I am having the following error:

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  41.6% (used 34044 bytes from 81920 bytes)
Flash: [===       ]  34.5% (used 360204 bytes from 1044464 bytes)
Building /data/desk_display/.pioenvs/desk_display/firmware.bin
Creating BIN file "/data/desk_display/.pioenvs/desk_display/firmware.bin" using "/data/desk_display/.pioenvs/desk_display/firmware.elf"
========================= [SUCCESS] Took 32.43 seconds =========================
INFO Successfully compiled program.
INFO Running:  esptool.py --before default_reset --after hard_reset --baud 460800 --chip esp8266 --port /dev/ttyACM0 write_flash 0x0 /data/desk_display/.pioenvs/desk_display/firmware.bin
esptool.py v2.8
Serial port /dev/ttyACM0
Connecting........_____....._____....._____....._____....._____....._____....._____

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

Any idea of what the problem might be? the usb cable i am using seems to be fine, tested it by connecting my phone to my pc and I am able to read the phone contents.

EDIT: Problem solved. Apparently the USB port selected in the top right drop down menu was not the correct one. Had to restart ESPHOME add-on while the ESP8266 was plugged in my server, and a new port appeared. Selected this new port and all worked fine.

1 Like