OC
OceanRemote
Low-code IoT platform
Back to Troubleshooting Hub

ESP32 Not Connecting to WiFi

Complete guide to diagnose and fix ESP32 WiFi connection problems. Covers power issues, signal strength, router configuration, and code fixes.

Last updated: April 22, 2026 | 10 min read

Symptoms

  • ESP32 keeps trying to connect but never succeeds
  • Serial Monitor shows WiFi status 201 (wrong password) or 202
  • Device reboots when attempting WiFi connection
  • Brownout detector triggered during WiFi initialization
  • Weak or no signal

Common Causes

  1. 5GHz network ESP32 only supports 2.4GHz WiFi
  2. Wrong credentials SSID and password are case-sensitive
  3. Weak power supply WiFi draws ~200mA, needs stable 3.3V
  4. Poor signal Move device closer to router
  5. Boot pin conflict GPIO0, GPIO2, GPIO12, GPIO15 affect boot
  6. Router channel interference Overlapping channels cause drops

Step-by-Step Fixes

1. Check Your Network Band

The ESP32 does NOT support 5GHz WiFi. Make sure your router broadcasts a 2.4GHz network.

  • Log into your router admin panel
  • Check if 2.4GHz is enabled
  • If both bands share the same name, create a separate 2.4GHz SSID

2. Verify WiFi Credentials

SSID and password are case-sensitive. Use this code to test:

#include <WiFi.h>

const char* ssid = "Your_SSID";      // Check case and spaces
const char* password = "Your_PASSWORD";

void setup() {
  Serial.begin;
  WiFi.begin(ssid, password);
  
  int attempts = 0;
  while  != WL_CONNECTED && attempts < 40) {
    delay;
    Serial.print(".");
    attempts++;
  }
  
  if  == WL_CONNECTED) {
    Serial.println;
    Serial.printf.toString().c_str());
  } else {
    Serial.printf);
  }
}

3. Check Power Supply

WiFi connection draws high current . A weak power supply causes resets.

  • Use a 5V 2A power supply
  • Use a quality USB cable
  • Add a 470-1000F capacitor between 5V and GND for stability
  • Measure voltage at ESP32 3.3V pin should be stable above 3.0V

4. Check Signal Strength

Open Serial Monitor at 115200 baud. Add this to your code:

Serial.printf);
RSSI Range Quality Action
-30 to -60 dBm Excellent Good connection
-60 to -70 dBm Good Works fine
-70 to -80 dBm Poor Move closer to router
Below -80 dBm Unusable Relocate device or router

5. Avoid Boot Pin Conflicts

ESP32 has specific pins that affect boot behavior. Avoid pulling these LOW during boot:

  • GPIO0 Must be HIGH at boot
  • GPIO2 Must be HIGH at boot
  • GPIO12 Affects flash voltage
  • GPIO15 Must be LOW at boot

6. Change Router WiFi Channel

Interference from neighboring networks can cause connection issues. Use channels 1, 6, or 11 .

  • Log into router admin panel
  • Change 2.4GHz channel from "Auto" to 1, 6, or 11
  • Save and reboot router

WiFi Error Codes

Code Meaning Solution
201 Wrong password Re-enter credentials, check case sensitivity
202 Network not found Check SSID, ensure 2.4GHz band
203 Connection timeout Move closer to router, check signal
WL_DISCONNECTED Disconnected Check power and signal stability

Prevention Tips

  • Keep ESP32 firmware updated via Arduino IDE Boards Manager
  • Use a dedicated 2.4GHz SSID for IoT devices
  • Add auto-reconnect logic to your code
  • Use a high-quality 5V 2A power supply with capacitor
  • Set router to a fixed channel instead of "Auto"

Related Issues

Frequently Asked Questions

Q: Can the ESP32 connect to 5GHz WiFi?

A: No. The ESP32 only supports 2.4GHz networks .

Q: What is the ideal RSSI for stable connection?

A: RSSI should be above -70 dBm. Below -80 dBm will cause frequent disconnections.

Q: How do I reset WiFi settings on ESP32?

A: Use WiFi.disconnect to clear saved credentials, then ESP.restart().

Q: Why does my ESP32 connect then immediately disconnect?

A: Usually a power issue. Add a 470-1000F capacitor between 5V and GND. Also check for DHCP pool exhaustion.

Still having issues? Contact Support or return to the Troubleshooting Hub.