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

Hi All,

Got my first esp device, tried to flash using both the flasher tool from my windows client and also from hassio addon from my ubuntu server.

I have this device ESP32S.

On the packet the bad english says

  1. When you “make flash”, long press BOOT button
  2. Wait until the connecting…___ stop, then release BOOT button,

I’ve tried this and i cant get it to flash.

Anyone offer any suggestions?

This is the item i purchased fyi: esphome A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

Sam

Not sure what you are talking about when stating

flasher tool from my windows client

but when you tried to flash it from ESPHome in Hassio, did you restart ESPHome plugin once you have connected ESP32 on USB port ? If so you have well selected the ESP device that should appear in top right menu of ESPHome in Hassio ?? :wink:

Yep the device shows up and i select upload but fails with the messages in the title

May you please share a full copy/paste of the compilation/transfer dialog in ESPHome ?
Picture or link of exact module you try to program ?
Did you try with an other module if you have few ones ?

So using the esphome flasher tool;

[2020-07-13 17:05:23,881][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:400][INFO]: ************
[2020-07-13 17:05:23,884][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:401][INFO]: check_res: (True, [[u’C:\\Users\\sam.williams\\Downloads\\kitchen001.bin’, 65536]])
[2020-07-13 17:05:23,887][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:402][INFO]: is running : False
[2020-07-13 17:05:23,888][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:403][INFO]: ************
[2020-07-13 17:05:23,888][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:494][INFO]: *********************
[2020-07-13 17:05:23,891][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:495][INFO]: pic path: ./RESOURCE/IDLE_S.bmp
[2020-07-13 17:05:23,891][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:496][INFO]: ***********************
[2020-07-13 17:05:23,941][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:706][INFO]: rep_path: C:\Users\sam.williams\Desktop\flash_download_tool_v3.8.5\dl_temp/bin_tmp\downloadPanel1
[2020-07-13 17:05:23,944][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:713][INFO]: offset: 65536
[2020-07-13 17:05:23,944][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:714][INFO]: filename: C:\Users\sam.williams\Downloads\kitchen001.bin
[2020-07-13 17:05:23,944][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:715][INFO]: self.cp.disable_change_bin: 1
[2020-07-13 17:05:23,946][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:716][INFO]: ----------------
[2020-07-13 17:05:23,950][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:434][INFO]: TEST!!!
[2020-07-13 17:05:23,951][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:435][INFO]: SELF.COMSTR: COM3
[2020-07-13 17:05:23,953][EspDownloadThread][download_panel_info.py][line:788][INFO]: test running: False
======
CONNECT BAUD: 115200
============
[2020-07-13 17:05:24,279][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:494][INFO]: *********************
[2020-07-13 17:05:24,279][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:495][INFO]: pic path: ./RESOURCE/SYNC_S.bmp
[2020-07-13 17:05:24,280][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:496][INFO]: ***********************
…_____[2020-07-13 17:09:43,019][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:494][INFO]: *********************
[2020-07-13 17:09:43,019][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:495][INFO]: pic path: ./RESOURCE/IDLE_S.bmp
[2020-07-13 17:09:43,022][EspDownloadPanel_ESP32_spi(1)][download_panel_info.py][line:496][INFO]: ***********************
…[2020-07-13 17:09:44,201][ESP8266Loader_spi[1]][espDownloader.py][line:391][ERROR]: Chip sync error: Failed to connect to ESP32: Timed out waiting for packet header
[2020-07-13 17:09:44,201][ESP8266Loader_spi[1]][espDownloader.py][line:550][ERROR]: ESP32 Chip sync error esp_sync_blocking.
no log file output …

With this setup;

When using hassio addon;

INFO Reading configuration /config/esphome/kitchen001.yaml…
INFO Generating C++ source…
INFO Compiling app…
INFO Running: platformio run -d /config/esphome/kitchen001
Processing kitchen001 (board: esp32doit-devkit-v1; framework: arduino; platform: [email protected])


HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES:

  • framework-arduinoespressif32 3.10004.200129 (1.0.4)
  • tool-esptoolpy 1.20600.0 (2.6.0)
  • toolchain-xtensa32 2.50200.80 (5.2.0)
    Dependency Graph
    |-- 1.1.1
    |-- 1.0
    | |-- 1.0
    |-- 1.0
    |-- 1.2.6
    | |-- 1.1.1
    | |-- 1.0
    | |-- 1.0
    |-- 1.1.0
    | |-- 1.0
    |-- 1.0
    |-- 1.0
    Compiling /data/kitchen001/.pioenvs/kitchen001/src/main.cpp.o
    Linking /data/kitchen001/.pioenvs/kitchen001/firmware.elf
    Retrieving maximum program size /data/kitchen001/.pioenvs/kitchen001/firmware.elf
    Checking size /data/kitchen001/.pioenvs/kitchen001/firmware.elf
    Building /data/kitchen001/.pioenvs/kitchen001/firmware.bin
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [= ] 12.9% (used 42320 bytes from 327680 bytes)
    Flash: [===== ] 53.1% (used 870262 bytes from 1638400 bytes)
    ========================= [SUCCESS] Took 6.91 seconds =========================
    INFO Successfully compiled program.
    INFO Running: platformio run -d /config/esphome/kitchen001 -t upload --upload-port /dev/ttyUSB0
    Processing kitchen001 (board: esp32doit-devkit-v1; framework: arduino; platform: [email protected])

HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
PACKAGES:

  • framework-arduinoespressif32 3.10004.200129 (1.0.4)
  • tool-esptoolpy 1.20600.0 (2.6.0)
  • tool-mkspiffs 2.230.0 (2.30)
  • toolchain-xtensa32 2.50200.80 (5.2.0)
    Dependency Graph
    |-- 1.1.1
    |-- 1.0
    | |-- 1.0
    |-- 1.0
    |-- 1.2.6
    | |-- 1.1.1
    | |-- 1.0
    | |-- 1.0
    |-- 1.1.0
    | |-- 1.0
    |-- 1.0
    |-- 1.0
    Retrieving maximum program size /data/kitchen001/.pioenvs/kitchen001/firmware.elf
    Checking size /data/kitchen001/.pioenvs/kitchen001/firmware.elf
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [= ] 12.9% (used 42320 bytes from 327680 bytes)
    Flash: [===== ] 53.1% (used 870262 bytes from 1638400 bytes)
    Configuring upload protocol…
    AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
    CURRENT: upload_protocol = esptool
    Looking for upload port…
    Use manually specified: /dev/ttyUSB0
    Uploading /data/kitchen001/.pioenvs/kitchen001/firmware.bin
    Serial port /dev/ttyUSB0
    Connecting……_____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
*** [upload] Error 2
========================= [FAILED] Took 26.62 seconds =========================

with this setup:

This is the yaml i’m compiling;

esphome:
  name: kitchen001
  platform: ESP32
  board: esp32doit-devkit-v1

wifi:
  ssid: "Home"
  password: "<REMOVED>"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kitchen001 Fallback Hotspot"
    password: "LO1XyjS08GbF"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

I’ve tried with NodeMCU board as well.

I’ve tried holding the boot button and the EN button, but nothing works

OK, if you tried 2 boards and still get an error: try another USB cable.

Try to hold boot button, and then connect it to USB for flashing

Thanks tried, had Audrino port monitor on it and it’s not communicating at all, must be faulty!

Im using this one ESP32

Flashing it first time with https://esphome.io/guides/faq.html#esphome-flasher

  1. Compile and download bin file
  2. Hold “boot” button, connect to laptop with USB, release “boot” button
  3. Detect ESP32 port with flasher
  4. Flash ESP32

After that flashing over OTA forks just fine, exempt 2-5 minutes compiling some times