Fatal error occurred failed to connect to esp32 timed out waiting for packet header

NB: I introduced same issue report at espressif/esptool, because I don't know actually where the problem could be: espressif/esptool#198 Hello ESP32 lovers, I am facing a problem with a WEMS ES...

NB: I introduced same issue report at espressif/esptool, because I don’t know actually where the problem could be: espressif/esptool#198

Hello ESP32 lovers,
I am facing a problem with a WEMS ESP32 dev board which I bough on Aliexpress very recently:
https://fr.aliexpress.com/item/ESP32-Development-Board-WiFi-Bluetooth-Ultra-Low-Power-Consumption-Dual-Cores-ESP-32-ESP-32S-Board/32801337284.html

I am able to flash it using Eclipse/esp-idf/xtensa-esp32-elf triplet. The /dev/tty.SLAB_USBtoUART device configured by «make menuconfig» makes the flashing process a success. Further on, my user application (one of the examples of esp-idf) starts and does what expected.

But, with Arduino IDE, this is not the same story. I have installed the toolchain as written at ESP32-Arduino github page, then selected «ESP32 dev module» as the board in Arduino IDE, and also selected /dev/tty.SLAB_USBtoUART as the flashing device.
Like I did for the Eclipse case, I reset dev board with RST and BOOT buttons. I verified to get the «DOWNLOAD» invite on the terminal, then closed the terminal pushed on flash button of Arduino IDE. All I get in Arduino logs is the following:

Sketch uses 118,890 bytes (11%) of program storage space. Maximum is 1,044,464 bytes.
Global variables use 9,492 bytes (3%) of dynamic memory, leaving 285,420 bytes for local variables. Maximum is 294,912 bytes.
/Users/lmc/Dropbox/arduino/hardware/espressif/esp32/tools/esptool --chip esp32 --port /dev/cu.SLAB_USBtoUART --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_freq 80m --flash_mode dio --flash_size 4MB 0x1000 /Users/lmc/Dropbox/arduino/hardware/espressif/esp32/tools/sdk/bin/bootloader.bin 0x8000 /var/folders/zx/4rs36y2j0315wny99n1j7fj80000gn/T/arduino_build_538507/Blink.ino.partitions.bin 0xe000 /Users/lmc/Dropbox/arduino/hardware/espressif/esp32/tools/partitions/boot_app0.bin 0x10000 /var/folders/zx/4rs36y2j0315wny99n1j7fj80000gn/T/arduino_build_538507/Blink.ino.bin 

esptool.py v2.0-beta
Connecting........_____....._____....._____....._____....._____....._____....._____....._____....._____....._____
 
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

The programming does not detect the dev board in download mode, and the flashing does not start.
As a workaround, I hooked up an external FTDI adapter cable directly to the ESP32, and then Arduino IDE is able to start the flashing. But after, the Arduino sketch does not seems to run. My simple Blink sketch is not running (it toggles a GPIO and prints some text on Serial console).

Issue 1: I saw a post about the problem of the FreeRTOS scheduler not started on Core1, or not enabled Core1, which could resolve the Arduino sketch not running (but I don’t know how to configure it within ESP32-Arduino libraries/board from inside Arduino IDE. Could it be a efuse which should be reset to enable Core1 to start?

Issue 2: Concerning my flashing issue, I don’t understand why my dev module can be successfully programmed by using the Makefile from within Eclipse/esp-idf, while it ends-up with a timeout from within ArduinoIDE/ESP32-Arduino toolchain.

Anyone could help me about my two issues?
Thank you so much.

Learn how to fix the Fatal Error Occurred: “Failed to connect to ESP32: Timed out waiting for packet header” error when trying to upload new code to your ESP32 board once for all.

[SOLVED] Failed to connect to ESP32: Timed out waiting for packet header

Why are you getting this error?

Some ESP32 development boards (read Best ESP32 boards) don’t go into flashing/uploading mode automatically when uploading a new code.

This means that when you try to upload a new sketch to your ESP32, the Arduino IDE fails to connect to your board, and you get the following error message:

Holding the BOOT/FLASH button

One of the ways to solve this is holding-down the “BOOT/FLASH” button in your ESP32 board while uploading a new sketch at the same time. But having to worry about this every time you want to upload new code can be tedious, specially when you’re testing and debugging your code. There is a way to fix this once for all – no need to hold down the “BOOT/FLASH” button anymore.

How to fix the Error?

To make your ESP32 board go into flashing/uploading mode automatically, you can connect a 10 uF electrolytic capacitor between the EN pin and GND.

You may want to test this setup first on a breadboard to make sure it works for your ESP32 development board.

Note: electrolytic capacitors have polarity. The white/grey stripe indicates the negative lead.

If it works, then you can solder the 10 uF electrolytic capacitor to the board. Since the EN and GND pins are far apart from each other, you can simply connect the capacitor between the EN and the GND of the ESP32 chip as shown in the schematic diagram below:

Recommended: ESP32 Pinout Reference: Which GPIO pins should you use?

The following figure shows how my ESP32 looks like after soldering the capacitor. It doesn’t occupy much space, and fortunately you won’t get more trouble connecting to the ESP32 when uploading new code.

Before trying to upload a new code, you should check the connections with a multimeter in continuity mode – check that you haven’t inadvertently solder anything to the next pin.

fix timed out waiting for packet header with capacitor testing

If everything is soldered properly, you won’t need to press the BOOT button when uploading new code. You also won’t get the Fatal Error Occurred: “Failed to connect to ESP32: Timed out waiting for packet header”.

Wrapping Up

We hope you’ve found this trick useful and it solved your problem. Thanks to Ben Hall for the suggestion.

  • For more ESP32 troubleshooting tips, consult the ESP32 troubleshooting guide.
  • To learn more about ESP32 enroll in the Learn ESP32 with Arduino IDE course.
  • More projects about ESP32: 20+ ESP32 Projects and Tutorials

I tried to flash an ESP32 but I didn’t succeed, I tried with esptool.py and Arduino IDE. I tried to press the boot button and reset but it didn’t work. Here is the error:

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

Sercan's user avatar

Sercan

4,4663 gold badges14 silver badges33 bronze badges

asked Dec 30, 2021 at 13:09

ri1_'s user avatar

2

If using the Arduino IDE, try lowering the upload speed (Tools/Upload Speed). Lowering mine from 921600 to 460800 did the trick.

First ensure that you are in download mode:

  • Start the serial monitor and set the speed (mine is 115200).
  • While pressing the «boot» button, press and release the «en» button (your buttons may be labeled differently).
  • You should see something like this on the serial monitor:
    waiting for download
  • Now start the upload

My development machine, a 2013 iMac is connected via USB to the USB-c port on my ESP32 Dev Module. Apparently the iMac’s USB or ESP32 board’s USB cannot keep up at the 921600 upload speed.

answered Nov 30, 2022 at 23:13

Richard Campbell's user avatar

DISCLAIMER! May not be correct answer but may help to save time for someone.

Quick answer if you do not want read my experience: Disconnect all wires from pins and try uploading again! It may help.

I came across with the same error and could not figure it out. I first thought that something is wrong with the code, because it happened after I edited working code while figuring out where to connect what pin 😀. I also wasn’t able to upload simple HelloWorld after it happened with connected wires. But then I disconnected all my wires from the board and the upload works fine.

I can not figure out the WHY factor but I think it must had been the input/data pin I was using, in my case D13. I have the DevKit with fewer pins. Maybe someone can comment why connected pins may make the error come up?

answered Apr 7, 2022 at 19:27

Tarvo Mäesepp's user avatar

Tarvo MäeseppTarvo Mäesepp

4,3273 gold badges40 silver badges89 bronze badges

On some AliExpress-like ESP32s you have to press the boot button in order to upload your sketch.
If you are watching the Arduino IDE console ouput and Connecting ... appears, you have to press the boot button for approximately 2 seconds until the console output changes.

answered Apr 8, 2022 at 9:44

Asder Knaster's user avatar

Try to do this one after the other

  1. Press the boot button when press uploading button until it write the code.
  2. Try disconnect esp32 from the board/header/pcb that you are using right at the time.
  3. Disconnect any other connection that your esp32 might have.
  4. Do not connect to anything even your hand if possible.
  5. Try put it in something that doesnt have a moist surface. look pic number 3.

MY CASES(30 pin version):

Case 1: I dont know why. I was connecting the pin to a female header it doesnt work and sometimes it just work like that. look pic number 1.

Case 2: when Im holding esp32 on my hand sometimes it wont work then i put it on my table and another time it doing well.

Case 3: pressing boot button when uploading it helped sometimes, and the other time it just work like it should.

Case 4: when it connected to pcb its simply just wont work, but when disconnected boom it work like nothing ever happen. look pic number 2.

Maybe just maybe something with capacitive or something like that (just assuming because number Case 1). hope that will help you out.

pic 1pic 2pic 3

answered May 20, 2022 at 17:22

Muhammad Fadhil's user avatar

With Arduino IDE
Make sure the Com port is selected under Tools menu. My experience with ESP32 is Com 5.
If it is not available as an option, try changing USB ports and/or re-select Tools — Board — ESP32 dev module.

Watch the «Compiling Sketch» window.
Press the «Boot» button as soon as you get the red message «Serial port Com 5» You can release the button as soon as it starts to upload.
If this doesn’t work,try plugging into another USB port.

The Reset button only resets the uploaded sketch to re-initialise and has nothing to do with the uploading.

answered Jan 24, 2022 at 17:11

IanO's user avatar

Install expressif.exe and port drivers,connect the port and flash the esp32 ,upload the code using ardiuno,solve the error

answered Oct 27, 2022 at 15:14

Ranjith.A's user avatar

in my case buttons are new but not shorting properly as multimeter showed ..opened both scratched resoldered and all working

answered Dec 3, 2022 at 19:26

sumanta majumdar's user avatar

Changing by upload speed from 921600bps to 115200bps fixed it. No need to press any buttons.

answered Jan 26 at 9:21

Punnerud's user avatar

PunnerudPunnerud

6,6702 gold badges51 silver badges44 bronze badges

Just download the drivers x)

CP210x: CP210x USB to UART Bridge VCP Drivers

FTDI: FTDI Virtual COM Port Drivers

answered Sep 29, 2022 at 14:10

ri1_'s user avatar

ri1_ri1_

871 gold badge1 silver badge5 bronze badges

GeorgeFlorian1

Posts: 160
Joined: Thu Jan 31, 2019 2:32 pm

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

Hello !

After the yesterday’s fiasco, today I’ve been trying to upload any sketch to a new, out-of-the-box ESP32-EVB. But it doesn’t work.

I keep getting:
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

What’s happening ? Maybe the ESP32-Wroom-32 is burned out, but this one is new, never touched.

The ESP32-EVB is only connected to the PC via a USB Cable.
These are the Arduino IDE settings:
https://i.postimg.cc/J4DR3jrC/Screensho … -14-31.png


idahowalker

Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

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

Postby idahowalker » Tue Apr 02, 2019 12:01 pm

Have you tried holding down the EN button during sketch upload?

I found some but not all ESP’s require the EN button to be held down before and until the upload has started. That is till, I added a powered USB hub. Once I added in a powered USB hub the need for sometimes holding down the EN button during a sketch upload went away. Also, have you looked at the basic schematic for the ESP module? You will notice that there is a direct connection from the 5V line to the USB port and your computer. If something happens to your ESP32, the happening can be fed back into your computer if directly connected; another reason to have that added layer of protection of a powered USB hub.


GeorgeFlorian1

Posts: 160
Joined: Thu Jan 31, 2019 2:32 pm

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

Postby GeorgeFlorian1 » Tue Apr 02, 2019 1:18 pm

idahowalker wrote: ↑

Tue Apr 02, 2019 12:01 pm


Have you tried holding down the EN button during sketch upload?

I found some but not all ESP’s require the EN button to be held down before and until the upload has started. That is till, I added a powered USB hub. Once I added in a powered USB hub the need for sometimes holding down the EN button during a sketch upload went away. Also, have you looked at the basic schematic for the ESP module? You will notice that there is a direct connection from the 5V line to the USB port and your computer. If something happens to your ESP32, the happening can be fed back into your computer if directly connected; another reason to have that added layer of protection of a powered USB hub.

I’ve always pressed the EN Button on the ESP32 boards. With the ESP32-Wroom-32 and now with the ESP32-EVB.

With the EVB the trick seems to be to keep holding down the BUT1, then press on RST1, then release BUT1 and it starts uploading. This sometimes works on Arduino IDE. On PlatformIO IDE I couldn’t figure how to upload code.

You’re saying that I can harm the PC if I connect the ESP directly to it via a USB Cable ? I never thought of that.


idahowalker

Posts: 166
Joined: Wed Aug 01, 2018 12:06 pm

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

Postby idahowalker » Tue Apr 02, 2019 7:41 pm

GeorgeFlorian1 wrote: ↑

Tue Apr 02, 2019 1:18 pm


You’re saying that I can harm the PC if I connect the ESP directly to it via a USB Cable ? I never thought of that.

I have experienced the 5V regulator supplying the ESP32 5V, deciding to put out a higher voltage, than 5V. If you look at the ESP32 schematic, you’ll see that the 5V from the USB plug is directly tied to the ESP5V supply line. So, when the 5V regulator decided to put more then 5V onto the 5V line, the ESP32 died, the >5V was felt on my pc’s USB 5V line. Which does wonders for the operation of the PC. My case, I feel I got lucky and will not, from that point on, connect any uController directly to my PC. Instead all uController connections to my PC are through a powered hub. I call it wearing a rubber.


GeorgeFlorian1

Posts: 160
Joined: Thu Jan 31, 2019 2:32 pm

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

Postby GeorgeFlorian1 » Fri Apr 05, 2019 8:42 am

idahowalker wrote: ↑

Tue Apr 02, 2019 7:41 pm

GeorgeFlorian1 wrote: ↑

Tue Apr 02, 2019 1:18 pm


You’re saying that I can harm the PC if I connect the ESP directly to it via a USB Cable ? I never thought of that.

I have experienced the 5V regulator supplying the ESP32 5V, deciding to put out a higher voltage, than 5V. If you look at the ESP32 schematic, you’ll see that the 5V from the USB plug is directly tied to the ESP5V supply line. So, when the 5V regulator decided to put more then 5V onto the 5V line, the ESP32 died, the >5V was felt on my pc’s USB 5V line. Which does wonders for the operation of the PC. My case, I feel I got lucky and will not, from that point on, connect any uController directly to my PC. Instead all uController connections to my PC are through a powered hub. I call it wearing a rubber.

https://i.postimg.cc/ZnxrcQMb/esp-pin.jpg

Measuring the Voltage Regulator that’s on the ESP I noticed that between pin 1 and 3 there are 4.35V when the ESP is connected to the PC using a USB Cable. Is that normal ?


boarchuz

Posts: 492
Joined: Tue Aug 21, 2018 5:28 am

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

Postby boarchuz » Fri Apr 05, 2019 12:04 pm

That’s Vin and GND for the AMS1117. 4.35V seems a little low — you would expect USB to be around 5V +-0.25 — but there might be a diode or something in between to explain that drop. Regardless, it should enough for the voltage regulator to produce a ~3.3V output (probe Vout and GND with the multimeter if you want to check).


karansoi

Posts: 9
Joined: Tue Jul 31, 2018 5:25 pm

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

Postby karansoi » Fri Apr 12, 2019 2:18 pm

GeorgeFlorian1 wrote: ↑

Tue Apr 02, 2019 11:15 am


Hello !

After the yesterday’s fiasco, today I’ve been trying to upload any sketch to a new, out-of-the-box ESP32-EVB. But it doesn’t work.

I keep getting:
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

What’s happening ? Maybe the ESP32-Wroom-32 is burned out, but this one is new, never touched.

The ESP32-EVB is only connected to the PC via a USB Cable.
These are the Arduino IDE settings:
https://i.postimg.cc/J4DR3jrC/Screensho … -14-31.png

By the end of compile connect GPIO0 to GND and keep it till end of upload.
See if you are able to upload. After upload you remove this connection. You can use a jumper wire.



boarchuz

Posts: 492
Joined: Tue Aug 21, 2018 5:28 am

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

Postby boarchuz » Tue Apr 16, 2019 8:42 am

The Boot button is 0.

I’d suggest opening your serial monitor. Then hold down Boot, don’t be shy, you can’t do it too early and there’s no harm in holding it longer than necessary. Give the reset button a good click and you should see some output saying that it’s in download mode.

Make sure that works before attempting to program it. Then close serial.

When you program it, it will probably try to do this automatically. You can give it a helping hand by holding down the Boot button all-the-while to make sure that it boots into download mode (it’s ok to release once it starts uploading). If it doesn’t reset automatically (ie. if it doesn’t start uploading), click the reset button to do it yourself, while still holding down Boot of course.

That should be fairly fool-proof.


GeorgeFlorian1

Posts: 160
Joined: Thu Jan 31, 2019 2:32 pm

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

Postby GeorgeFlorian1 » Tue Apr 16, 2019 11:20 am

boarchuz wrote: ↑

Tue Apr 16, 2019 8:42 am


The Boot button is 0.

I’d suggest opening your serial monitor. Then hold down Boot, don’t be shy, you can’t do it too early and there’s no harm in holding it longer than necessary. Give the reset button a good click and you should see some output saying that it’s in download mode.

Make sure that works before attempting to program it. Then close serial.

When you program it, it will probably try to do this automatically. You can give it a helping hand by holding down the Boot button all-the-while to make sure that it boots into download mode (it’s ok to release once it starts uploading). If it doesn’t reset automatically (ie. if it doesn’t start uploading), click the reset button to do it yourself, while still holding down Boot of course.

That should be fairly fool-proof.

Tried this a long time ago. I got nothing and still getting nothing. I really think the ESP is busted.

I’ve always had to press on BOOT button to be able to upload code the ESP. Now I got a new Wrover-B DevKitV4 and I still have to keep BOOT pressed.


Who is online

Users browsing this forum: Google [Bot] and 19 guests

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:3480
load:0x40078000,len:7804
ho 0 tail 12 room 4
load:0x40080000,len:252
entry 0x40080034
[0;32mI (45) boot: ESP-IDF v2.0-3-gbef9896 2nd stage bootloader[0m
[0;32mI (46) boot: compile time 05:59:45[0m
[0;32mI (77) boot: Enabling RNG early entropy source…[0m
[0;32mI (77) boot: SPI Speed : 40MHz[0m
[0;32mI (78) boot: SPI Mode : DIO[0m
[0;32mI (90) boot: SPI Flash Size : 4MB[0m
[0;32mI (102) boot: Partition Table:[0m
[0;32mI (113) boot: ## Label Usage Type ST Offset Length[0m
[0;32mI (136) boot: 0 phy_init RF data 01 01 0000f000 00001000[0m
[0;32mI (159) boot: 1 otadata OTA data 01 00 00010000 00002000[0m
[0;32mI (183) boot: 2 nvs WiFi data 01 02 00012000 0000e000[0m
[0;32mI (206) boot: 3 at_customize unknown 40 00 00020000 000e0000[0m
[0;32mI (229) boot: 4 ota_0 OTA app 00 10 00100000 00180000[0m
[0;32mI (252) boot: 5 ota_1 OTA app 00 11 00280000 00180000[0m
[0;32mI (276) boot: End of partition table[0m
[0;32mI (289) boot: Disabling RNG early entropy source…[0m
[0;32mI (306) boot: Loading app partition at offset 00100000[0m
[0;32mI (1481) boot: segment 0: paddr=0x00100018 vaddr=0x00000000 size=0x0ffe8 ( 65512) [0m
[0;32mI (1482) boot: segment 1: paddr=0x00110008 vaddr=0x3f400010 size=0x1c5f0 (116208) map[0m
[0;32mI (1498) boot: segment 2: paddr=0x0012c600 vaddr=0x3ffb0000 size=0x0215c ( 8540) load[0m
[0;32mI (1528) boot: segment 3: paddr=0x0012e764 vaddr=0x40080000 size=0x00400 ( 1024) load[0m
[0;32mI (1552) boot: segment 4: paddr=0x0012eb6c vaddr=0x40080400 size=0x1b028 (110632) load[0m
[0;32mI (1631) boot: segment 5: paddr=0x00149b9c vaddr=0x400c0000 size=0x00034 ( 52) load[0m
[0;32mI (1632) boot: segment 6: paddr=0x00149bd8 vaddr=0x00000000 size=0x06430 ( 25648) [0m
[0;32mI (1648) boot: segment 7: paddr=0x00150010 vaddr=0x400d0018 size=0x7a56c (501100) map[0m
[0;32mI (1675) heap_alloc_caps: Initializing. RAM available for dynamic allocation:[0m
[0;32mI (1698) heap_alloc_caps: At 3FFBA6B8 len 00025948 (150 KiB): DRAM[0m
[0;32mI (1719) heap_alloc_caps: At 3FFE8000 len 00018000 (96 KiB): D/IRAM[0m
[0;32mI (1740) heap_alloc_caps: At 4009B428 len 00004BD8 (18 KiB): IRAM[0m
[0;32mI (1761) cpu_start: Pro cpu up.[0m
[0;32mI (1773) cpu_start: Single core mode[0m
[0;32mI (1786) cpu_start: Pro cpu start user code[0m
[0;32mI (1847) cpu_start: Starting scheduler on PRO CPU.[0m
[0;32mI (1945) uart: queue free spaces: 10[0m
Bin version:0.10.0

I (1946) wifi: wifi firmware version: c604573
I (1946) wifi: config NVS flash: enabled
I (1947) wifi: config nano formating: disabled
I (1966) wifi: Init dynamic tx buffer num: 32
I (1966) wifi: wifi driver task: 3ffc4f34, prio:23, stack:3584
I (1967) wifi: Init static rx buffer num: 10
I (1969) wifi: Init dynamic rx buffer num: 0
I (1973) wifi: Init rx ampdu len mblock:7
I (1976) wifi: Init lldesc rx ampdu entry mblock:4
I (1981) wifi: wifi power manager task: 0x3ffca2dc prio: 21 stack: 2560
I (1987) wifi: wifi timer task: 3ffcb35c, prio:22, stack:3584
[0;31mE (1993) phy_init: PHY data partition validated[0m
[0;32mI (2013) phy: phy_version: 329, Feb 22 2017, 15:58:07, 0, 0[0m
I (2014) wifi: mode : softAP (24:0a:c4:30:d1:95)
I (2017) wifi: mode : sta (24:0a:c4:30:d1:94) + softAP (24:0a:c4:30:d1:95)
I (2021) wifi: mode : softAP (24:0a:c4:30:d1:95)

Learn how to fix the Fatal Error Occurred: “Failed to connect to ESP32: Timed out waiting for packet header” error when trying to upload new code to your ESP32 board once for all.

[SOLVED] Failed to connect to ESP32: Timed out waiting for packet header

Why are you getting this error?

Some ESP32 development boards (read Best ESP32 boards) don’t go into flashing/uploading mode automatically when uploading a new code.

This means that when you try to upload a new sketch to your ESP32, the Arduino IDE fails to connect to your board, and you get the following error message:

Holding the BOOT/FLASH button

One of the ways to solve this is holding-down the “BOOT/FLASH” button in your ESP32 board while uploading a new sketch at the same time. But having to worry about this every time you want to upload new code can be tedious, specially when you’re testing and debugging your code. There is a way to fix this once for all – no need to hold down the “BOOT/FLASH” button anymore.

How to fix the Error?

To make your ESP32 board go into flashing/uploading mode automatically, you can connect a 10 uF electrolytic capacitor between the EN pin and GND.

You may want to test this setup first on a breadboard to make sure it works for your ESP32 development board.

Note: electrolytic capacitors have polarity. The white/grey stripe indicates the negative lead.

If it works, then you can solder the 10 uF electrolytic capacitor to the board. Since the EN and GND pins are far apart from each other, you can simply connect the capacitor between the EN and the GND of the ESP32 chip as shown in the schematic diagram below:

Recommended: ESP32 Pinout Reference: Which GPIO pins should you use?

The following figure shows how my ESP32 looks like after soldering the capacitor. It doesn’t occupy much space, and fortunately you won’t get more trouble connecting to the ESP32 when uploading new code.

Before trying to upload a new code, you should check the connections with a multimeter in continuity mode – check that you haven’t inadvertently solder anything to the next pin.

fix timed out waiting for packet header with capacitor testing

If everything is soldered properly, you won’t need to press the BOOT button when uploading new code. You also won’t get the Fatal Error Occurred: “Failed to connect to ESP32: Timed out waiting for packet header”.

Wrapping Up

We hope you’ve found this trick useful and it solved your problem. Thanks to Ben Hall for the suggestion.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Fatal error occurred 4 s3 amazonaws com
  • Fatal error string manager failed to initialize properly
  • Fatal error object reference not set to an instance of an object delphi
  • Fatal error string file not found
  • Fatal error novicam

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии