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.

  1. Use a good 5 V ≥ 1 A supply and a short, thick USB cable; avoid laptop front ports and unpowered hubs.
  2. Add a 470–1000 µF electrolytic plus 100 nF ceramic capacitor close to the 3V3/5V pins.
  3. Power relays, motors and servos from a separate supply with a common GND.
  4. 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.

  1. Try another USB data cable and port; the board must show up as a serial port.
  2. Hold BOOT, tap EN/RST, release BOOT as soon as “Connecting…” appears.
  3. Disconnect anything wired to GPIO0, GPIO2, TX0 and RX0 while flashing.
  4. Lower the upload speed to 115200 (Tools → Upload Speed) and close the Serial Monitor.
  5. Select the correct board and port; reinstall the CH340/CP210x driver if needed.
Guru Meditation Error: Core 1 panic’ed (LoadProhibited / StoreProhibited / IllegalInstruction)

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.

  1. Copy the “Backtrace:” line and decode it (ESP Exception Decoder or addr2line) to find the exact source line.
  2. Check pointers and sensor objects: call begin() before use and test for nullptr.
  3. Do not call Serial, WiFi, String or delay inside interrupt handlers; keep them tiny and use IRAM_ATTR.
  4. 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.

  1. Move large arrays to static/global memory or the heap.
  2. Increase the task stack size (xTaskCreate stack parameter) or loop stack with SET_LOOP_TASK_STACK_SIZE(16*1024).
  3. 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.

  1. Choose a larger partition scheme (Tools → Partition Scheme, e.g. Huge APP).
  2. Keep HTML in PROGMEM raw strings instead of concatenating String objects.
  3. Reuse a single WiFiClientSecure and free buffers; check ESP.getFreeHeap() while running.
  4. 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.

  1. Install the CH340 or CP210x driver for your OS and re-plug the board.
  2. Use a data USB cable and try a different port; the board should appear in Device Manager as COMx.
  3. Linux: add yourself to the dialout group (sudo usermod -a -G dialout $USER) and log in again.
  4. 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.

  1. Move the analog sensor to an ADC1 pin (GPIO32–39 on ESP32 DevKit).
  2. Use analogReadMilliVolts() for calibrated values and keep inputs within 0–3.3 V.
  3. Add a 100 nF capacitor on the ADC pin and average several samples.
Boot loop / rst:0x10 / invalid header: 0xffffffff / flash read err

The bootloader cannot read a valid application: a corrupted flash, a wrong partition table, wrong flash size/mode or unstable power during start.

  1. Erase and re-flash: use the Web Flasher with “Erase all flash” or esptool erase_flash.
  2. Select the right board and Flash Size, and the default partition scheme.
  3. Check that GPIO12/GPIO15 (ESP32) are not pulled the wrong way by wiring.
  4. 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.

  1. Replace long delay() with millis() timers; call yield()/delay(1) in loops.
  2. Add timeouts to every network and sensor call; never wait forever for Wi-Fi or a pin.
  3. 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.

  1. Make sure the router broadcasts a 2.4 GHz network with WPA2 (WPA2/WPA3 mixed is fine).
  2. Check the SSID/password (case sensitive) and avoid special characters while testing.
  3. Call WiFi.mode(WIFI_STA), set a connection timeout and retry with WiFi.disconnect(true) first.
  4. 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.

  1. Run an I2C scanner sketch to list addresses (typically 0x3C OLED, 0x76/0x77 BME280, 0x40 INA219).
  2. Check SDA/SCL pins and call Wire.begin(SDA, SCL) with the pins you wired.
  3. Add 4.7 kΩ pull-ups to 3.3 V; keep wires short (< 30 cm).
  4. 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 voltage monitor

Measures 220 V mains through an isolated ZMPT101B module and warns about sags, surges and blackouts in Telegram or Home Assistant.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●○ Intermediate
  • Build time 2–3 h
Pick parts / kit
⛔ High risk

High-current battery: a short circuit can start a fire. Put a fuse next to the battery plus, use thick enough wires and respect the BMS limits.

LiFePO4 / battery monitor

Shows voltage, current and power of a battery bank (INA219) so you know the real charge and load during outages.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●○ Intermediate
  • Build time 1–2 h
Pick parts / kit
⛔ 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.

Power outage notifier

A battery-backed ESP32-C3 that detects when mains disappears and sends a message with the time of the blackout.

  • Board ESP32-C3 SuperMini
  • Level ●●○ Intermediate
  • Build time 2–3 h
Pick parts / kit
⛔ High risk

Never replace the boiler's own safety thermostat or overheat protection. The ESP32 is only an extra controller; use a certified relay and a fuse.

Boiler thermostat

Holds the temperature of a boiler or heating loop with DS18B20 probes and a relay on the boiler's thermostat input.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●○ Intermediate
  • Build time 2–3 h
Pick parts / kit

All module ideas →

Comments

No comments yet. Share your experience or ask a question.

Comments are moderated.