1The upload speed is too high for the cable
A long or cheap cable corrupts fast transfers.
- In Tools, set Upload Speed to 115200.
- Upload again. If it works, a better cable lets you raise the speed later.
The upload tool sent its request and the chip said nothing back. The line of dots and underscores in the output is it trying again and again.
Connecting.....__.....__
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Failed uploading: uploading error: exit status 2Unlike the wrong boot mode error, nothing answered at all: the port, the speed or the wiring is the usual reason.
A long or cheap cable corrupts fast transfers.
A serial monitor or a second IDE window can hold the port.
The EN and BOOT lines may not be reaching the chip.
Boards with a CP210x or CH340 chip need a driver on Windows. A weak port resets the chip.
Mokxi's Upload to board writes to a classic ESP32 from Chrome or Edge, through the same ROM bootloader esptool talks to, so the same causes stop it and the same fixes apply.
Run the sketch in Mokxi before you blame the board. If it builds and runs there, the code is fine and the problem is the connection to the real board.
Run the sketch here before you blame the board. If it builds and runs in Mokxi, the code is fine and the fault is the connection to the real board. Mokxi never uploads in a simulation, so it cannot raise this error itself.
void setup() {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
Serial.println("blink ready");
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(500);
}The first bytes of every message from the chip. The tool waited for them and none came.
Each one is an attempt to sync with the chip. A long line means the chip never answered.
Upload Speed. Dropping it to 115200 is the quickest change and fixes many cases.