ESP32 Wi-Fi Connects But No IP Assigned
Diagnose and resolve cases where the ESP32 connects to a Wi-Fi network but fails to obtain an IP address, resulting in no usable network connection.
Common Causes
- 📡
DHCP Server Not Responding
If the router’s DHCP server is misconfigured or overloaded, the ESP32 may associate with Wi-Fi but fail to obtain an IP address.
- ⚠️
Wrong Security or Network Settings
Incorrect SSID, password, or mixed WPA2/WPA3 networks can cause partial connections without full IP lease.
- ⏱
Timeout During DHCP Negotiation
Poor signal strength, long distances, or router delay can cause the ESP32 to give up before receiving an IP.
- 🧯
Static IP Misconfiguration
If your code sets a static IP without configuring gateway or DNS, the ESP32 may appear connected but remain unreachable.
Symptoms
Wi-Fi Event: Connected, But No IP
Serial log shows: WiFi connected Waiting for IP...
but no IP address is printed.
IP Address is 0.0.0.0
WiFi.localIP()
or WiFiSTA.getLocalIP()
returns 0.0.0.0
, indicating no DHCP lease was granted.
Router Shows Device Connected Without IP
The ESP32 appears in router’s device list but lacks a valid assigned IP address.
Works on One Network, Fails on Another
ESP32 connects and gets IP at home, but fails on enterprise, mesh, or mobile hotspot networks.
Solutions
Reboot Router and Check DHCP Settings
Ensure DHCP server is enabled and has free leases. Restart both router and ESP32 to refresh the lease process.
Set Static IP with Proper Gateway
If using WiFi.config()
, make sure to include IP, gateway, subnet, and DNS parameters explicitly.
Check Wi-Fi Signal and Retry
Move closer to the router or eliminate obstacles to ensure a reliable signal during DHCP negotiation.
Test with Different Network
Try connecting the ESP32 to another known-good Wi-Fi network (like a phone hotspot) to isolate if the issue is router-specific.
More Details
ESP32 Wi-Fi Connects But No IP Assigned #
Your ESP32 boots, connects to your Wi-Fi network, but never gets assigned an IP address. You see messages like:
WiFi connected
Waiting for IP...
…and nothing more. This issue can be particularly frustrating because it looks like everything is working — but the ESP32 can’t actually communicate on the network. Here’s how to troubleshoot this condition where the ESP32 is “connected” but not “networked.”
What’s Happening Behind the Scenes #
When WiFi.begin(ssid, password)
succeeds, the ESP32 successfully authenticates with the access point (AP). However, this is only the first step in establishing a full network connection. The next step is:
- The ESP32 sends a DHCP request (broadcast)
- The router’s DHCP server replies with an IP lease
- The ESP32 accepts and configures itself with that IP
If anything breaks down in that handshake, the ESP32 will appear connected but show an IP of 0.0.0.0
.
Symptoms of No IP Assignment #
🧼 Serial Monitor Stuck on “Waiting for IP” #
You’ll often see output like:
Connecting to MyNetwork
WiFi connected
Waiting for IP...
…and then it just hangs. This indicates DHCP didn’t complete.
⚠️ IP Address is 0.0.0.0
#
If you call:
Serial.println(WiFi.localIP());
and get 0.0.0.0
, the ESP32 has no valid IP.
📶 Router Shows Connection Without IP
Some routers may list the MAC address or hostname of your ESP32 but won’t display an IP address next to it. This confirms association without a lease.
📡 It Works on One Network, Fails on Another
You might find that your code works fine at home but fails at a friend’s house, in a corporate network, or on a hotspot. This suggests an environmental or router-specific issue.
Common Causes #
❌ Router DHCP Disabled or Exhausted #
Many routers allow disabling the DHCP server or limiting the lease pool. If DHCP is turned off, the ESP32 can connect at the link layer (associate with the AP) but won’t receive an IP. Similarly, if the lease table is full — especially on older or low-end routers — new clients won’t be assigned addresses.
Check your router’s DHCP settings and verify that:
- DHCP is enabled
- There are free IP addresses available in the pool
- Lease time is not too short (which can cause churn)
❗ Mixed WPA2/WPA3 or Enterprise Wi-Fi #
ESP32 chips generally support WPA/WPA2 Personal (PSK) but not WPA3 or WPA2-Enterprise (802.1X). If your network is configured to use a mixed mode (WPA2/WPA3), the ESP32 might connect at a low level but never pass full authentication or start DHCP.
Try enabling WPA2-only mode in your router’s security settings and avoid enterprise or certificate-based authentication unless you are using ESP32 with the correct TLS libraries and firmware.
🕓 Wi-Fi Signal Too Weak or Noisy #
If the ESP32 is on the edge of your Wi-Fi coverage, it may be able to associate with the network but not reliably exchange DHCP packets. This is especially problematic with longer DHCP response times or retries.
To check this, print the signal strength:
Serial.println(WiFi.RSSI());
Values below -75 dBm often indicate unstable communication.
⚙️ Static IP Configured Incorrectly #
If you manually configure a static IP using WiFi.config()
, you must provide all required parameters — including the gateway and DNS. An incomplete or incorrect static IP setup can cause the ESP32 to behave like it’s connected (has an IP), but be unable to reach the router or internet.
Example of correct static IP usage:
WiFi.config(IPAddress(192,168,1,184), IPAddress(192,168,1,1), IPAddress(255,255,255,0), IPAddress(8,8,8,8));
Don’t forget: static IPs should fall outside your DHCP range to avoid conflicts.
Solutions #
✅ Reboot Router and ESP32 #
Often the simplest fix. Rebooting clears old DHCP entries and allows new leases to be granted.
✅ Use Static IP (Properly) #
If DHCP fails or is unreliable, consider assigning a static IP:
IPAddress local_IP(192,168,1,184);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);
IPAddress dns(8,8,8,8);
WiFi.config(local_IP, gateway, subnet, dns);
WiFi.begin(ssid, password);
Make sure your static IP is outside the DHCP range of your router to avoid conflicts.
✅ Test on Another Network #
Try a phone hotspot or a different access point to isolate whether the issue is with your router.
✅ Move Closer to the Router #
If the RSSI (signal strength) is low, DHCP packets may be dropped. Try reducing distance or interference.
Additional Debugging #
Enable Wi-Fi event callbacks to see more info:
WiFi.onEvent([](WiFiEvent_t event){
Serial.printf("[WiFi-event] event: %d\n", event);
});
This will print low-level status changes that can help identify where the connection stalls.
Conclusion #
When the ESP32 connects to Wi-Fi but fails to get an IP, it’s usually a sign of a DHCP negotiation issue, weak signal, or router-specific configuration. These issues are not always code-related, but how the ESP32 interacts with the surrounding network.
Start with the basics: reboot, move closer, try another network. Then dive into static IPs or firmware debugging if needed.

Quick Navigation
Additional Resources
Still Stuck with an ESP32 Issue? Let's solve it together.
Our interactive troubleshooting wizard will guide you through common ESP32 problems and their solutions, step by step.