• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

[NEARLY SOLVED] Failed to connect to ESP32

Q&A Forum › Category: ESP32 › [NEARLY SOLVED] Failed to connect to ESP32
0 Vote Up Vote Down
Steph asked 5 years ago

Hello,

My comment seems to have gone unnoticed on the following tutorial:

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

So I’ll ask my question here again and hope for the best of luck:

Why do you use a 10 µF electrolytic capacitor? How did you choose this value?
In an empirical way, or is there a logical explanation for that?

Can you explain by what miracle this solution solves the problem?

3 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Hello! There’s no miracle 🙂 basically some ESP32 dev boards miss a capacitor in the auto-programming circuit. If you add a capacitor in those pins, it solves the problem.

You can add a 1uF capacitor or even lower, but during my tests I found that a 10uF capacitor worked reliably while testing with multiple boards. It’s not the perfect value, but it has been working flawlessly for me.

If your ESP32 automatically auto-programs without holding the BOOT button, your ESP32 was properly designed and it comes with capacitor in the auto-programming circuit.

I hope that helps!

0 Vote Up Vote Down
Steph answered 5 years ago

Hi Rui,

Thank you for your answer!
Nevertheless, it explains the how… but not really the why.

In the meantime, I also found an explanation that matches yours:

ESP32 Boot Mode Selection / Automatic bootloader

I was joking about miracles, of course… but until I understand what’s going on, it’s all the same to me… Well, I then came across a discussion that sheds more light on the matter (look especially at username‘s answers), and in particular with this diagram:

So, as I understand it, the winning scenario is to prevent EN from returning to a logical HIGH level AFTER IO0. And since EN is pull-up, you just have to place the capacitor (a priori 100 nF is enough… but the results can vary according to the boards, as you said) which, as soon as it is charged (i.e. very quickly), will become insulating and therefore, EN will go back to a HIGH logic level almost immediately, BEFORE the auto-programming sequence lets IO0 go back to the HIGH state too.

Here’s what I understand… and it makes sense to me now.

But tell me if I’m wrong…

0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Yes.
For the ESP32 to go into bootloader mode, both the EN and GPIO 0 must be pulled GND.

“The ESP32 will enter the serial bootloader when GPIO0 is held low on reset. Otherwise it will run the program in flash.”

The capacitor makes sure the ESP32 will go into bootloader mode and not simply a reset.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.