ESP32 Reference: common errors, power & logic levels, module comparison
Searchable ESP32 error guide (Brownout, Failed to connect, Guru Meditation), 3.3 V vs 5 V cheat sheet and ESP32 module comparison table.
Common errors
Brownout detector was triggered
The supply voltage dipped below ~2.4 V for a moment, usually when Wi-Fi or a relay draws a current burst through a weak USB port, long cable or thin wires.
Use a good 5 V ≥ 1 A supply and a short, thick USB cable; avoid laptop front ports and unpowered hubs.
Add a 470–1000 µF electrolytic plus 100 nF ceramic capacitor close to the 3V3/5V pins.
Power relays, motors and servos from a separate supply with a common GND.
Replace a weak AMS1117 board regulator or a drained battery; check voltage under load with a multimeter.
Failed to connect to ESP32: Timed out waiting for packet header / Wrong boot mode
The ROM bootloader is not answering: the board is not in flash mode, the USB cable is charge-only, the port is wrong or something is attached to GPIO0/TX/RX.
Try another USB data cable and port; the board must show up as a serial port.
Hold BOOT, tap EN/RST, release BOOT as soon as “Connecting…” appears.
Disconnect anything wired to GPIO0, GPIO2, TX0 and RX0 while flashing.
Lower the upload speed to 115200 (Tools → Upload Speed) and close the Serial Monitor.
Select the correct board and port; reinstall the CH340/CP210x driver if needed.
The program touched invalid memory: a null or uninitialised pointer, an array out of bounds, a deleted object, or code running inside an interrupt that must not.
Copy the “Backtrace:” line and decode it (ESP Exception Decoder or addr2line) to find the exact source line.
Check pointers and sensor objects: call begin() before use and test for nullptr.
Do not call Serial, WiFi, String or delay inside interrupt handlers; keep them tiny and use IRAM_ATTR.
Look for buffers that are too small (strcpy/sprintf) and arrays indexed past their size.
Stack canary watchpoint triggered / Stack overflow in task
A task or loop() used more stack than it has: large local arrays, deep recursion or big String/JSON objects.
Move large arrays to static/global memory or the heap.
Increase the task stack size (xTaskCreate stack parameter) or loop stack with SET_LOOP_TASK_STACK_SIZE(16*1024).
Avoid recursion and big local JsonDocument objects.
Sketch too big / region overflowed / Not enough memory
The program or its data does not fit in flash or RAM. SSL/TLS, JSON and web pages in String objects eat heap quickly.
Choose a larger partition scheme (Tools → Partition Scheme, e.g. Huge APP).
Keep HTML in PROGMEM raw strings instead of concatenating String objects.
Reuse a single WiFiClientSecure and free buffers; check ESP.getFreeHeap() while running.
Use a board with more memory (S3 with PSRAM) if you need cameras, TLS plus big JSON.
Port not found / Could not open COM port / Permission denied /dev/ttyUSB0
The computer has no driver for the USB-serial chip (CH340, CP2102), the cable is charge-only, or your user has no rights to the port.
Install the CH340 or CP210x driver for your OS and re-plug the board.
Use a data USB cable and try a different port; the board should appear in Device Manager as COMx.
Linux: add yourself to the dialout group (sudo usermod -a -G dialout $USER) and log in again.
Close other programs holding the port (Serial Monitor, PuTTY, another IDE).
analogRead returns 0 or 4095 / “ADC2 is in use by Wi-Fi”
On ESP32 the ADC2 unit is shared with the Wi-Fi radio. Readings on ADC2 pins fail while Wi-Fi is active.
Move the analog sensor to an ADC1 pin (GPIO32–39 on ESP32 DevKit).
Use analogReadMilliVolts() for calibrated values and keep inputs within 0–3.3 V.
Add a 100 nF capacitor on the ADC pin and average several samples.
The bootloader cannot read a valid application: a corrupted flash, a wrong partition table, wrong flash size/mode or unstable power during start.
Erase and re-flash: use the Web Flasher with “Erase all flash” or esptool erase_flash.
Select the right board and Flash Size, and the default partition scheme.
Check that GPIO12/GPIO15 (ESP32) are not pulled the wrong way by wiring.
Test with a different supply; a brownout can look like a boot loop.
Task watchdog got triggered / Interrupt wdt timeout on CPU0
Something blocked the CPU for seconds: a long loop, delay() with heavy work, a stuck I2C/Wi-Fi call or a busy-wait without yielding.
Replace long delay() with millis() timers; call yield()/delay(1) in loops.
Add timeouts to every network and sensor call; never wait forever for Wi-Fi or a pin.
Move heavy work to a separate FreeRTOS task.
Wi-Fi will not connect / status 6 / AUTH_EXPIRE / 5 GHz
ESP32 supports 2.4 GHz only. Wrong password, hidden SSID, WPA3-only mode, weak signal or an overloaded router also cause it.
Make sure the router broadcasts a 2.4 GHz network with WPA2 (WPA2/WPA3 mixed is fine).
Check the SSID/password (case sensitive) and avoid special characters while testing.
Call WiFi.mode(WIFI_STA), set a connection timeout and retry with WiFi.disconnect(true) first.
Improve signal: move the board away from the metal, use a board with an external antenna.
I2C device not found / i2cWrite error / NACK / Wire timeout
The module is not answering: wrong address, swapped SDA/SCL, missing pull-ups, 5 V module on a 3.3 V bus or a loose wire.
Run an I2C scanner sketch to list addresses (typically 0x3C OLED, 0x76/0x77 BME280, 0x40 INA219).
Check SDA/SCL pins and call Wire.begin(SDA, SCL) with the pins you wired.
Add 4.7 kΩ pull-ups to 3.3 V; keep wires short (< 30 cm).
Power the module from 3.3 V and share GND.
Popular module ideas
Click an idea to get a base for your build.
⛔ High risk
Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.
Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.
Comments
No comments yet. Share your experience or ask a question.