WiFi Disconnects Frequently
Espressif ESP32
Severity: ModerateWhat Does This Error Mean?
Frequent WiFi disconnections on ESP32 are usually caused by power issues, antenna problems, or router incompatibility. Add a capacitor for power stability, reduce transmit power, and check your router's 2.4GHz settings.
Affected Models
- ESP32-DevKitC
- ESP32-WROOM-32
- ESP32-S3
- ESP32-C3
- All ESP32 variants
Common Causes
- Brownout during WiFi transmission spikes
- Poor antenna design on cheap boards
- Router dropping 2.4GHz connections due to settings
- Too many devices on the same WiFi channel
- ESP32 power management putting WiFi to sleep
How to Fix It
-
Add a 100-1000uF capacitor between 3.3V and GND.
WiFi transmissions cause current spikes that dip the voltage. A capacitor smooths these dips and prevents brownout-related disconnects.
-
Reduce WiFi transmit power.
WiFi.setTxPower(WIFI_POWER_8_5dBm); Lower power = less current draw = fewer brownouts. Range decreases but stability improves.
-
Disable WiFi power saving.
esp_wifi_set_ps(WIFI_PS_NONE); Power saving mode can cause periodic disconnections as the radio sleeps.
-
Add auto-reconnect logic in your code.
Check WiFi.status() periodically and call WiFi.reconnect() if disconnected. This handles transient drops gracefully.
Frequently Asked Questions
Does the ESP32's antenna matter?
Yes, significantly. Boards with PCB antennas (printed on the board) have shorter range. Boards with external antenna connectors (U.FL) allow you to add a better antenna.
Can I use 5GHz WiFi with ESP32?
No. The ESP32 only supports 2.4GHz WiFi. Make sure your router's 2.4GHz band is enabled and not hidden.