OC
OceanRemote
Low-code IoT platform
Home > FAQ > ESP32 Common Problems

ESP32 Common Problems & Solutions: Complete Troubleshooting FAQ

๐Ÿ“… Updated: April 2026 โฑ๏ธ 20 min read ๐Ÿ”ง 30+ Problems Solved

The ESP32 is powerful, but it can be frustrating when things don't work. This guide covers the most common ESP32 problems and their solutions โ€“ from connection issues to upload failures, GPIO problems, and WiFi disconnections.

Bookmark this page โ€“ you'll come back to it again and again!

๐Ÿ”Œ Connection & USB Issues

โ“ ESP32 not detected by computer / no COM port

Solution:

  1. Check the USB cable โ€“ Many cables are charge-only! Use a data cable.
  2. Install drivers โ€“ CP210x or CH340 drivers depending on your board:
  3. Try a different USB port โ€“ Avoid USB hubs.
  4. Restart your computer โ€“ After driver installation.
  5. Check Device Manager (Windows) โ€“ Look for "Unknown Device" or under "Ports (COM & LPT)".
  6. Try another ESP32 board โ€“ Your board might be faulty.
๐Ÿ’ก Pro tip: The ESP32-C3 and S3 boards often require different drivers and USB cables.

โ“ ESP32 resets or disconnects when uploading code

Solution:

  1. Hold the BOOT button while uploading (then release after upload starts)
  2. Check your USB cable โ€“ Use a high-quality shielded cable
  3. Reduce upload speed โ€“ In Arduino IDE: Tools โ†’ Upload Speed โ†’ 115200 instead of 921600
  4. Try a different USB port โ€“ Direct to computer, not through hub
  5. Check power supply โ€“ ESP32 needs stable 5V with 500mA minimum

โ“ "Failed to connect to ESP32: Timed out waiting for packet header"

Solution:

  1. Press and hold the BOOT button on your ESP32
  2. While holding BOOT, click Upload in Arduino IDE
  3. When you see "Connecting..." in the console, release the BOOT button
  4. If that doesn't work, try: Hold BOOT โ†’ Press EN/RESET โ†’ Release EN โ†’ Release BOOT
๐Ÿ’ก This is the most common ESP32 upload error โ€“ the BOOT button sequence always works!

โ“ Serial monitor shows garbage characters

Solution:

  1. Check baud rate โ€“ Make sure Serial Monitor matches your code's Serial.begin(115200)
  2. Try different baud rates โ€“ 9600, 115200, 230400, 460800
  3. Check power supply โ€“ Low power can cause serial corruption
  4. Check grounding โ€“ ESP32 and computer must share common ground

๐Ÿ“ค Upload & Programming Errors

โ“ "A fatal error occurred: Failed to connect to ESP32"

Solution:

  1. Select the correct board: Tools โ†’ Board โ†’ ESP32 Dev Module
  2. Select correct COM port
  3. Try different USB cable
  4. Press BOOT button during upload (see above)
  5. Lower upload speed to 115200

โ“ "Sketch too big" or "Text section exceeds available space"

Solution:

  1. Optimize your code โ€“ Remove unused libraries, combine variables
  2. Use PROGMEM โ€“ Store large strings in flash instead of RAM
  3. Choose a board with more flash โ€“ Some ESP32 boards have 16MB flash
  4. Enable optimization โ€“ Tools โ†’ Optimization โ†’ "Smallest Code"
  5. Use Partition Scheme โ€“ Tools โ†’ Partition Scheme โ†’ "Huge App (3MB No OTA)"
๐Ÿ’ก OceanRemote's generated firmware is already optimized for minimal size!

โ“ "Board not detected" or "Unknown board"

Solution:

  1. Install ESP32 board support: File โ†’ Preferences โ†’ Additional Boards Manager URLs
  2. Add URL: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  3. Tools โ†’ Board โ†’ Boards Manager โ†’ Search "ESP32" โ†’ Install
  4. Select Tools โ†’ Board โ†’ ESP32 Arduino โ†’ ESP32 Dev Module
  5. Restart Arduino IDE

โ“ "Multiple libraries found" warning

Solution:

  1. Check which library is being used in the console output
  2. Delete duplicate libraries from your Arduino/libraries folder
  3. Keep only the most recent or most compatible version
  4. For OceanRemote, ensure you have the correct library version

๐Ÿ“ก WiFi & Network Problems

โ“ ESP32 won't connect to WiFi

Solution:

  1. Check SSID and password โ€“ Case-sensitive!
  2. Check WiFi frequency โ€“ ESP32 only supports 2.4GHz, not 5GHz
  3. Move ESP32 closer to router โ€“ Weak signal causes connection failures
  4. Check special characters โ€“ Avoid spaces or symbols in SSID/password
  5. Restart router โ€“ Sometimes the router's DHCP table is full
  6. Try static IP โ€“ Some routers have DHCP issues
  7. Check antenna connection โ€“ If using external antenna, ensure it's connected
๐Ÿ’ก Use this code to debug WiFi: Serial.println(WiFi.status());

โ“ ESP32 keeps disconnecting from WiFi

Solution:

  1. Check power supply โ€“ WiFi draws bursts of 300-400mA!
  2. Add delay between reconnection attempts โ€“ Don't hammer the router
  3. Enable WiFi auto-reconnect: WiFi.setAutoReconnect(true);
  4. Check for interference โ€“ Microwaves, baby monitors, neighbors' WiFi
  5. Update ESP32 board package โ€“ Newer versions have better WiFi stability
  6. Try a different WiFi channel โ€“ In router settings (channels 1, 6, 11 are best)

โ“ ESP32 cannot obtain IP address (DHCP)

Solution:

  1. Restart your router โ€“ DHCP table might be full
  2. Assign a static IP โ€“ Bypasses DHCP entirely
  3. Check MAC address filtering โ€“ Your router might be blocking the ESP32
  4. Reduce number of connected devices โ€“ Some routers limit to 10-15 devices
// Static IP example
IPAddress local_IP(192, 168, 1, 200);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
WiFi.config(local_IP, gateway, subnet);

โšก GPIO & Pin Issues

โ“ GPIO pin not working / not responding

Solution:

  1. Avoid input-only pins โ€“ GPIO 34-39 are input-only (no output)
  2. Avoid strapping pins at boot โ€“ GPIO 0, 2, 5, 12, 15 affect boot mode
  3. Check if pin is used internally โ€“ Some boards use GPIO 16/17 for PSRAM
  4. Test with simple blink code โ€“ Isolate the problem
  5. Check voltage levels โ€“ ESP32 is 3.3V, not 5V tolerant on most pins
๐Ÿ’ก Safe GPIO pins for output: 4, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33

โ“ ESP32 boots into download mode instead of running code

Solution:

  1. Avoid pulling GPIO 0 LOW at boot โ€“ GPIO 0 LOW = download mode
  2. Avoid pulling GPIO 2 LOW at boot โ€“ Affects boot behavior
  3. Avoid pulling GPIO 15 HIGH at boot โ€“ Affects boot output
  4. Add pull-up/down resistors correctly โ€“ 10kฮฉ recommended
  5. Remove any components on GPIO 0, 2, 5, 12, 15 during boot
โš ๏ธ Critical: GPIO 0 must be HIGH at boot (3.3V). If you have a button on GPIO 0, it should be connected to GND with a pull-up resistor.

โ“ ADC readings are inaccurate or noisy

Solution:

  1. Use ADC attenuation โ€“ analogReadResolution(11); analogSetAttenuation(ADC_11db);
  2. Add a capacitor โ€“ 0.1ยตF between ADC pin and GND reduces noise
  3. Average multiple readings โ€“ Take 10-50 samples and average them
  4. Use ADC2 pins carefully โ€“ ADC2 is shared with WiFi (use ADC1 for WiFi projects)
  5. Calibrate your ADC โ€“ Measure known voltages to create a calibration curve
๐Ÿ’ก ADC1 (good with WiFi): GPIO 32-39. ADC2 (problematic with WiFi): GPIO 0, 2, 4, 12-15, 25-27

๐Ÿ”‹ Power & Brownout Problems

โ“ "Brownout detector was triggered" error

Solution:

  1. Use a better power supply โ€“ ESP32 needs 5V with 500mA minimum, 1A recommended
  2. Use a USB power bank โ€“ Computer USB ports often provide only 500mA
  3. Add a large capacitor โ€“ 470-1000ยตF between 5V and GND
  4. Check your wiring โ€“ Thin wires cause voltage drop
  5. Power sensors separately โ€“ Don't draw power for sensors from ESP32's 3.3V pin
  6. Disable brownout detector โ€“ (Not recommended, but possible in code)
โš ๏ธ Brownout is serious! It means voltage dropped below 2.9V. This can cause corruption or random resets.

โ“ ESP32 randomly restarts / resets

Solution:

  1. Check power supply โ€“ Most common cause of random resets
  2. Check for watchdog timer โ€“ Add delay() or yield() in long loops
  3. Check for stack overflow โ€“ Reduce recursive functions or large local arrays
  4. Check for NULL pointer dereference โ€“ Always check pointers before using
  5. Add ESP32 exception decoder โ€“ Use esp_exception_decoder library

โ“ ESP32 won't power from battery

Solution:

  1. Check battery voltage โ€“ ESP32 needs 3.0V-3.6V (or 5V via USB)
  2. Use a voltage regulator โ€“ 3.7V Li-ion needs regulator to 3.3V
  3. Check battery capacity โ€“ ESP32 draws 80-240mA, small batteries won't last
  4. Use deep sleep โ€“ Reduce power consumption dramatically
  5. Check for voltage drop โ€“ Thin wires cause voltage drop under load
๐Ÿ’ก For battery projects, use ESP32 with deep sleep: current drops to 5-150ยตA!

๐ŸŒก๏ธ Sensor Issues

โ“ DHT22 not working / reading 0 or NaN

Solution:

  1. Add 10kฮฉ pull-up resistor โ€“ Between DATA and VCC (3.3V)
  2. Check wiring โ€“ VCC to 3.3V, DATA to GPIO, GND to GND
  3. Wait 2 seconds between readings โ€“ DHT22 needs 2 seconds minimum
  4. Check library version โ€“ Use Adafruit DHT sensor library
  5. Test with example code โ€“ Isolate the sensor from your main code
  6. Replace sensor โ€“ DHT22 can be damaged by moisture or voltage spikes
๐Ÿ’ก OceanRemote firmware automatically handles DHT22 timing and includes the pull-up resistor in the wiring diagram!

โ“ DS18B20 not detected / reading -127ยฐC

Solution:

  1. Add 4.7kฮฉ pull-up resistor โ€“ Between VCC and DATA (critical!)
  2. Check wiring โ€“ Red=VCC, Yellow=DATA, Black=GND
  3. Check OneWire address โ€“ Use scanner sketch to find address
  4. Check cable length โ€“ Long cables (>10m) need stronger pull-up
  5. Check if sensor is connected to correct pin โ€“ Verify in code

โ“ Sensor readings are wrong or inconsistent

Solution:

  1. Check power supply โ€“ Sensor needs stable voltage
  2. Add decoupling capacitor โ€“ 0.1ยตF between VCC and GND near sensor
  3. Check for electrical noise โ€“ Keep sensor wires away from high-current lines
  4. Calibrate the sensor โ€“ Compare with known reference
  5. Check for self-heating โ€“ Power sensor only when reading (for some sensors)
  6. Average multiple readings โ€“ Take 5-10 readings, discard outliers, average

๐Ÿ’พ Memory & Performance

โ“ "Sketch uses more than available memory"

Solution:

  1. Remove unused libraries โ€“ Each library adds memory overhead
  2. Use F() macro for strings โ€“ Serial.println(F("Long string")); stores in flash
  3. Use PROGMEM for constants โ€“ Store lookup tables in flash
  4. Reduce global variables โ€“ Move to local scope when possible
  5. Choose larger partition scheme โ€“ Tools โ†’ Partition Scheme โ†’ "Huge App"
  6. Switch to ESP32 with PSRAM โ€“ Some boards have 4-8MB extra RAM

โ“ ESP32 running slow / laggy

Solution:

  1. Check for long delays โ€“ Use millis() instead of delay() for timing
  2. Check CPU frequency โ€“ Tools โ†’ CPU Frequency โ†’ 240MHz (not 80MHz)
  3. Use both cores โ€“ Run WiFi on core 0, sensors on core 1
  4. Reduce Serial.print() statements โ€“ Serial communication is slow
  5. Optimize loops โ€“ Move calculations outside loops

๐Ÿ“ฑ Bluetooth Problems

โ“ Bluetooth not working / not discoverable

Solution:

  1. Check board compatibility โ€“ ESP32-S2 has no Bluetooth! Only original ESP32, S3, C3
  2. Add Bluetooth name โ€“ esp_bt_dev_set_device_name("MyESP32");
  3. Check Bluetooth stack initialization โ€“ Must be before WiFi if using both
  4. Try different Bluetooth library โ€“ ESP32 BLE Arduino vs classic Bluetooth
  5. Check distance โ€“ Bluetooth range is ~10 meters

โ“ WiFi stops working when Bluetooth is enabled

Solution:

  1. Use different antenna โ€“ Both WiFi and Bluetooth share same antenna
  2. Use dual-core properly โ€“ Run WiFi on core 0, Bluetooth on core 1
  3. Reduce WiFi power โ€“ WiFi.setTxPower(WIFI_POWER_8_5dBm);
  4. Use BLE instead of Classic Bluetooth โ€“ BLE interferes less with WiFi
  5. Time-slice between WiFi and Bluetooth โ€“ Alternate operations
๐Ÿ’ก WiFi and Bluetooth on ESP32 share the same 2.4GHz radio. They don't play well together simultaneously!

๐Ÿ”ง General ESP32 Troubleshooting Tips

1๏ธโƒฃ

Start Simple

Test with Blink.ino first. If that works, add complexity gradually.

2๏ธโƒฃ

Check Power First

80% of ESP32 problems are power-related. Use a good USB cable and supply.

3๏ธโƒฃ

Use Serial.print()

Debug your code with serial output. You can't fix what you can't see.

4๏ธโƒฃ

Check Your Pins

Some pins have special functions at boot. Avoid GPIO 0, 2, 5, 12, 15.

5๏ธโƒฃ

Update Everything

Update Arduino IDE, board package, libraries, and drivers.

6๏ธโƒฃ

Read the Error Message

Error messages tell you exactly what's wrong. Google the exact error text.

๐Ÿ†˜ Still Having Problems?