ESP32 DEVKIT - Failed to connect to ESP32: Timed out waiting for packet header

Hello everyone!
I tried to upload my code to my ESP32 DEVKITV1, but the following error appears:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Serial port /dev/cu.Bluetooth-Incoming-Port
Connecting......................................____An error occurred while uploading the sketch
_
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I tried changing the flash frequency and the upload speed and pressing the BOOT button, this last thing actually worked a little (the error appeared twice and now is only showing in one line) but besides that, I cannot upload it.

Regards

Assume you push the ESP32 boot switch at the appropriate time.


In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.

Use the </> icon from the ‘reply menu’ to attach the copied sketch.

here's a little pearl of information nobody tells you:

start the Arduino IDE without connecting an ESP. note the ports available. note that no selection for an ESP comes up under the board selection page.

connect an ESP. note that a new port exists, with a name like /dev/ttyUSB0 ( in linux. ) that is the port you need to connect to. no other port can work. that port is constructed by the CP2102 driver for the ESP UART.

What do you mean by "board selection page"?

Something important to note is that the Tools > Port menu is only refreshed after you close and then close the menu. So if you omit that step then you can sit there forever watching the menu and the port will never appear.

If you connect two pushbuttons: one to reset (EN 9) and one to boot (GPIO0 23), other side to GND, a 10k resistor between EN 9 and Vin (3.3V)
press and hold RESET, press BOOT, release Reset and then release BOOT, you will have connection and you will be able to upload your program.
Kees

yes I have

as the only port available means that

a) the connection between the computer and the ESP is not working (cable). or
b) the driver is not installed.

What do you mean by the driver?
I changed the cable and even the ESP32, so maybe is the driver.

Your ESP32 board has a USB to serial adapter chip that allows it to communicate with your computer via the USB cable, using a virtual COM port.

Here are some examples of common chips:

WCH CH340

(on a cheap Uno derivative board, but the chip itself will be the same on an ESP32 board

FTDI FT232R

Silicon Labs CP2102

image

A driver is needed in order for your computer to recognize that chip.

Missing drivers is a common cause of the board not being recognized on Windows. However, they are normally not needed on other operating systems and I can tell from the port name that you are not using Windows. So I am a bit skeptical about the driver as the cause.


I think we are getting a bit ahead of ourselves. @Geek_Emeritus shared a valuable technique for identifying the port of your Arduino board. Did you follow it? If so, did you see a new serial port appear under the menu after you connected your ESP32 board to your computer?

In case it will be useful, I'll provide detailed instructions you can follow:

  1. Unplug your Arduino board from the computer.
  2. Select Tools > Port from the Arduino IDE menus.
  3. Note the ports, if any, listed in the menu.
  4. Close the Tools menu.
    The ports list is only updated when the Tools menu is re-opened, so this step is essential.
  5. Plug your Arduino board into the computer.
  6. Select Tools > Port from the Arduino IDE menus. - The new port listed in the menu is the one for your Arduino board.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.