espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.01k stars 7.3k forks source link

Failed to connect to ESP32: Timed out waiting for packet header #1497

Closed aniellod closed 1 year ago

aniellod commented 6 years ago

Hardware:

Board: ESP32 LOLIN w/OLED - ESP-WROM32 Core Installation/update date: (see below) IDE name: Arduino IDE 1.8.5 Flash Frequency: 80Mhz Upload Speed: Tried various

Description:

Unable to upload anything to this module.

Have another identical one and same sketch uploads and runs fine. Rules out cable, connection or computer. I tried to upload using esptool.py directly and also using FTDI but same problem.

How can I test if the board damaged? Any tips on how to revive it?

Debug Messages:

(/dev/ttyUSB1) ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2)) waiting for download

Sketch uses 638418 bytes (48%) of program storage space. Maximum is 1310720 bytes.
Global variables use 38948 bytes (13%) of dynamic memory, leaving 255964 bytes for local variables. Maximum is 294912 bytes.
esptool.py v2.3.1
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

Thanks

mrmonteith commented 6 years ago

I take it the port shows and that it just doesn't upload. I've bought a couple of dev boards that they didn't design well. I have to hold down the reset but after esptool starts to try to send for about a second or two and then release and it loads. All my other boards load with no hand holding. Hope that is what the problem is.

aniellod commented 6 years ago

Sadly it's not helping in this case. Any variations of pressing the boot/flash button or holding it, releasing it seems to fail. Oddly enough the problem was gradual. The board was working fine without needing to press "boot", then it stopped working and I had to press "boot" for it to accept the code. Now nothing works. I had a look and tried to diagnose using this information but no luck.

CaptIgmu commented 6 years ago

Make sure certain pins are not connected when uploading programs! In my case, pin 12 was connected to an INT signal from a sensor and could not upload. There may be other ESP32 pins that are sensitive. Also, try DIO mode for the flash in boards.txt file . . .

lbernstone commented 6 years ago

gpio12 and gpio2 are particularly notable on this: https://github.com/espressif/esp-idf/tree/master/examples/storage/sd_card#note-about-gpio12. It can be burned into a state where it will not interfere with your boot. This should interfere with normal boot, not uploading though. I'm afraid your system may be dead. Can you post the link to where you bought it? Maybe we can shame the manufacturers into doing some qc.

aniellod commented 6 years ago

@lbernstone Thanks. The only one who might need to be shamed is myself. I might have done something wrong to the board which broke it. I ordered two and the second one is fine. Perhaps too much voltage on pin 0 and 2.

davidbono commented 6 years ago

I had the same issue and fixed it by rotating 180° lopy4 board when plugin into the expansion board ... shame on me.

pwpolar commented 5 years ago

I'm having this issue with an ESP32 DevKitCV4 board. Loads fine and then all of a sudden get this message: Flashing binaries to serial port COM27 (app at offset 0x10000)... esptool.py v2.1 Serial(port='COM27', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False) Connecting........____................................... A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

Sometimes power cycling board fixes problem other times does not. I can see ESP32 replying using scope on TXD0 but computer is not seeing response.

dcartman commented 5 years ago

I had this same issue with an ESP32 Dev Module V1, to "fix it" I held down the boot button while compiling/uploading the sketch from Arduino.

Once the sketch was uploaded I power cycled by unplugging the USB and plugging back in. Uploads worked fine after that for a while.

Fuzzbinder commented 5 years ago

I take it the port shows and that it just doesn't upload. I've bought a couple of dev boards that they didn't design well. I have to hold down the reset but after esptool starts to try to send for about a second or two and then release and it loads. All my other boards load with no hand holding. Hope that is what the problem is.

This just fixed the same issue for me. Thanks

nello commented 5 years ago

I get this error whenever the tx0 pin is connected to my breadboard. Letting it float free is the only thing that allows me to upload new code. Very strange. My board is an ESP-WROOM-32.

nello commented 5 years ago

FIXED: To be able to upload to the EP-WROOM-32 when connected to a breadboard, you need a 10K (or so) pull-down resistor between RX0 and GND.

Amaktronix commented 5 years ago

@dcartman Thanks. yours solution gave a effect. The problem was solved for me My module is DOIT ESP32 DEVKIT V1 which is the same of ESP32 Dev Module V1 .

fixed the same issue for me. Thanks

lemonbuzz commented 5 years ago

I have a custom board with the same issue. I get the 'waiting for download' prompt but the upload always times out.

pjvander commented 5 years ago

I ran into the same issue and couldn't resolve for the life of me. Turns out I have been shipped (twice, now) an ESP8266 in an ESP32 packaging. Configuring for the ESP8266 solved my issue, naturally. Throwing this out there in case this same thing happened to others.

Stitch0 commented 5 years ago

Hi. In my case, pressing the "boot" button helped. Press button when starting download sketch.

68gt500 commented 5 years ago

I had the same problem on my Windows 10 PC. In my case installing CP210x USB to UART Bridge VCP Drivers solved the issue. Works perfectly, even at the highest baud rate of 921600.

Paelgin commented 5 years ago

I had that Timeout problem, but it only just showed up when using my old Dell Inspiron 1525 (from 2006, but running Win10). My newer laptop had done fine (but sadly, it is not on vacation with me, only my old one) On a hunch, I went out to Best Buy and bought a USB 3.0 powered hub, and with great joy, I found that programming it now works through that hub.

I'm using a "ESP32-01 Breakout and Development Board" from www.ezsbc.com to make Geoff Bunza's "Simplified WiFi Throttle" that he described in Model Railroad Hobbyist (https://model-railroad-hobbyist.com/node/35652).

Phil in gorgeous Young Harris, Georgia, USA

sravanth005 commented 5 years ago

Hi all, I am trying to work with ESP32-CAM (https://robotzero.one/esp32-camera-module/#comment-3073) i can able to take a still with the camera but face detection and face reorganization is not happening, Do any one know for what reason it is not happening.please help me out to solve this issue.

dhcps: send_offer>>udp_sendto result 0 I (63186) camera_httpd: JPG: 6335B 1573ms I (66456) camera_httpd: vflip = 1 dhcps: send_offer>>udp_sendto result 0 I (72716) camera_httpd: JPG: 7267B 118ms I (78976) camera_httpd: face_detect = 1 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 I (1752586) wifi: max connection, deauth! dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 I (1873156) wifi: max connection, deauth! dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 I (2301736) wifi: station: b4:ef:fa:79:e6:e2 leave, AID = 1, bss_flags is 134243 I (2301736) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,0>, prof:6 I (2301736) camera wifi: station:b4:ef:fa:79:e6:e2leave, AID=1 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_offer>>udp_sendto result 0 dhcps: send_nak>>udp_sendto result 0

thanks in advance

Gohith commented 5 years ago

Hardware:

Board: ESP32 LOLIN w/OLED - ESP-WROM32 Core Installation/update date: (see below) IDE name: Arduino IDE 1.8.5 Flash Frequency: 80Mhz Upload Speed: Tried various

Description:

Unable to upload anything to this module.

Have another identical one and same sketch uploads and runs fine. Rules out cable, connection or computer. I tried to upload using esptool.py directly and also using FTDI but same problem.

How can I test if the board damaged? Any tips on how to revive it?

Debug Messages:

(/dev/ttyUSB1) ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2)) waiting for download

Sketch uses 638418 bytes (48%) of program storage space. Maximum is 1310720 bytes.
Global variables use 38948 bytes (13%) of dynamic memory, leaving 255964 bytes for local variables. Maximum is 294912 bytes.
esptool.py v2.3.1
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

Thanks

Just hold the BOOT switch while it says "Connecting......." It solved for me.

Parth7030 commented 5 years ago

I had the same problem on my Windows 10 PC. In my case installing CP210x USB to UART Bridge VCP Drivers solved the issue. Works perfectly, even at the highest baud rate of 921600.

Thanks, It worked for me...

VijayJaybhay commented 5 years ago

Make sure certain pins are not connected when uploading programs! In my case, pin 12 was connected to an INT signal from a sensor and could not upload. There may be other ESP32 pins that are sensitive. Also, try DIO mode for the flash in boards.txt file . . .

Thanks, it worked not sure why it is so

beegee-tokyo commented 5 years ago

Reserved GPIOs - special use GPIOs

daveyman123 commented 5 years ago

I have tried UART drivers. no pins are connected to anything. I am using the sparkfun thing if it matters. I am getting this error and no series of button presses will fix it. How do I start over?

nello commented 5 years ago

@daveyman try a pull down resistor on RX0 (see my comment above).

mikkieg commented 4 years ago

Had the same problem which seems to be fixed now with a 10uF cap between RST and GND

gpratt3151 commented 4 years ago

I found my problem was with the USB port on my laptop. If I use a USB 3.0 cable (USB-A -> USB 3) in the USB 2.0 port, I get the exact error messages above. When I moved the cable to the USB 3.0 port it worked just fine. I didn't realize my laptop had a single 2.0 port which is the one I naturally use due to it's location. As I understand, it should have worked with the USB 2.0 port, but it does not on my laptop either due to the cable or the port. Hope this helps someone.

mehtaSmitK commented 4 years ago

Just make sure whether following conditions meet,

  1. Check if GPIO 0(IO0)) is connected with Ground(gnd),
  2. Press & Hold rst button when you are uploading the code,
  3. In my case, I had connected 5V output instead of 3 .3V output.
men0 commented 4 years ago

3. In my case, I had connected 5V output instead of 3 .3V output.

3 did work for me! thanks a lot.

night021 commented 4 years ago

Just make sure whether following conditions meet,

  1. Check if GPIO 0(IO0)) is connected with Ground(gnd),
  2. Press & Hold rst button when you are uploading the code,
  3. In my case, I had connected 5V output instead of 3 .3V output.

Where is GPIO0 on esp32 dev kit v1

lbernstone commented 4 years ago

GIS: esp32 dev kit v1 pin map There are about 100 images there

DavitecBrasil commented 4 years ago

Hi Everybody! I had this problems a few times when my projects had anything connected to ESP32-WROOM-32 pins RX0 and TXO. (A max485 chip, for example). It take long until I tried to disconnect the max485 from VCC while uploading my sketches to de ESP32... And the problem was gone... Sometimes it also happens when there is some other devices connected to the circuit as a multimeter or a logic analyzer, especially if they are connected to other power sources.

jhoughjr commented 4 years ago

seeing this issue on mac os 10.15.1 latest Arduino. Been dead in the water for a month. ESP was a mistake. Maybe STM32 can actually be programmed reliably.

me-no-dev commented 4 years ago

@jhoughjr would the thought that maybe the problem is in your computer ever passed you head? Obviously if ESP32 was not working on Mac that would have been a huge issue... not just for you. I use Mac too. Yet have no problem, like most other users.

jhoughjr commented 4 years ago

That definitely crossed my mind but considering if one googles this they see the others having the same issue then its not likely to be my computer but the unhandled exception. Considering it works on the same computer on windows ten also makes me think it is not my computer. Im just using windows for now. Last I have seen is wait for apple to change the OS to not throw an exception. That is not my computer.

me-no-dev commented 4 years ago

it is something environment related. I did not mean it's hardware related. If I ever get to experience it, I could look for the issue, but unless that can happen and unless the people that do get to experience it try to get to the bottom of it... it's kinda unfixable.

atanisoft commented 4 years ago

Very likely a driver related issue. The fact that it works on Windows somewhat confirms that.

jvr-ks commented 4 years ago

Pressing and holding (!) the boot-button during flashing the NodeMCU firmware solved it for me with newer Dev board.

JamesNewton commented 4 years ago

On the off chance anyone else is as stupid as I am, the same issue from the Arduino IDE applies here: You must not have the serial monitor open when you try to upload. Unlike the program upload, the SPIFFs ("File System image") upload will not close it, use it's port, and then re-open it in the monitor when done. It just fails. It took me a while longer to figure this out, because I'm using the JTAG debugger and the SPIFFs upload tried to use it's port instead of telling me no port was available.

Not sure if that's worth a feature request...

clzola commented 4 years ago

I have recently acquired LoLin D32 board, and had a problem with uploading basic example:

int LED_PIN = 5;

void setup() {
  pinMode(LED_PIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_PIN, HIGH);
  delay(1000);
  digitalWrite(LED_PIN, LOW);
  delay(1000);
}

I solved my problem with changing Tools > Upload Speed to 230400, I have not tried other values, but this one worked for me... Hope it helps.

stale[bot] commented 4 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

jayaruvan commented 4 years ago

I am having the same issue.

stale[bot] commented 4 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

stale[bot] commented 4 years ago

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

Paelgin commented 4 years ago

Several times I have had problems. Once when I was connected by USB to an old laptop that may have only been USB 1 ports. I bought a powered USB hub to resolve that. Another time was when I unwittingly attached a switch to the Input IO0 (used for boot). When the input was grounded, bad things happened during startup.

This should make this thread UNstale. Phil

stale[bot] commented 4 years ago

[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future.

gadavidd commented 4 years ago

I have the same problems, I changed this line:

//#define CAMERA_MODEL_WROVER_KIT //#define CAMERA_MODEL_ESP_EYE //#define CAMERA_MODEL_M5STACK_PSRAM //#define CAMERA_MODEL_M5STACK_WIDE

define CAMERA_MODEL_AI_THINKER

and It Worked!

maddisondesigns commented 4 years ago

Just recently got a couple of ESP32 boards and changing the upload speed (to 230400) as per @clzola's comment above, worked for me.

adrianTNT commented 3 years ago

I had this error today, while also noticing the blue light was very low when trying to upload:

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

I moved it to a better USB port and it worked, so it was most probably not having enough power in my case.

oabravo commented 3 years ago

I had the same problem on my Windows 10 PC. In my case installing CP210x USB to UART Bridge VCP Drivers solved the issue. Works perfectly, even at the highest baud rate of 921600.

Thanks :D it worked!

zatuliveter commented 3 years ago

Thanks to @mikkieg

Had the same problem which seems to be fixed now with a 10uF cap between RST and GND

Here is how I fixed firmware upload on ESP32-DevKitC V4 with ESP-WROOM-32 board No need to hold Boot button during upload.

esp32-board-upload-fix-no-boot-button-2