Back to Troubleshooting

ESP32 Hidden SSID Problem

Learn how to properly connect your ESP32 to hidden Wi-Fi networks. Understand the need for accurate credentials, use of the correct `WiFi.begin()` overload, and how to troubleshoot issues specific to non-broadcast SSIDs.

Common Causes

  • 🙈

    Hidden SSID Not Broadcast

    Hidden networks do not advertise their SSID, which means the ESP32 cannot passively discover them and must be manually configured to connect.

  • 🔐

    Incorrect or Case-Sensitive Credentials

    Hidden SSIDs require explicitly correct SSID and password strings. Any typo, including case mismatches, will prevent connection.

  • ⚙️

    Improper Configuration in Code

    Failing to use the

    WiFi.begin(ssid, password, channel, bssid, true)
    

    overload or omitting hidden network support in your code can block connections.

Symptoms

ESP32 Fails to Connect to Hidden Network

The ESP32 repeatedly attempts to connect but fails, even though credentials are correct and it connects to visible networks.

Serial Monitor Stuck on "Connecting..."

Output remains stuck in a loop of failed connection attempts with no IP assigned or successful connection status.

Works on Visible Networks but Not Hidden Ones

The ESP32 connects without issue when the SSID is broadcast, but fails if the same network is hidden.

Solutions

Use the Correct `WiFi.begin()` Overload

For hidden SSIDs, use the overload that includes hidden=true:

WiFi.begin("YourSSID", "YourPassword", 0, NULL, true);

Ensure Case-Sensitive Accuracy

Hidden networks require precise SSID and password matching. Double-check for typos, extra spaces, or casing mismatches.

Temporarily Broadcast SSID for Debugging

Enable SSID broadcasting on your router temporarily to confirm ESP32 credentials and debug connection behavior.

More Details

ESP32 Hidden SSID Problem #

If your ESP32 won’t connect to a hidden Wi-Fi network, you’re not alone — this is a common issue, especially when using the basic WiFi.begin() function without enabling support for hidden SSIDs.

Hidden networks do not broadcast their name (SSID), so the ESP32 must be explicitly told what to connect to and how.

What You’ll See #

  • Serial monitor stays on Connecting... forever
  • Your ESP32 connects fine to visible networks, but fails silently with hidden ones
  • No IP address is assigned, and WiFi.status() remains stuck on WL_DISCONNECTED or WL_NO_SSID_AVAIL

Why Hidden SSIDs Are Tricky #

Hidden networks don't show up in normal scans. This means:

  • The ESP32 can’t automatically detect them
  • You must provide the exact SSID, password, and optionally even the channel and BSSID
  • Any typo — especially with case sensitivity — will block the connection

How to Properly Connect to a Hidden SSID #

Use the full overload of WiFi.begin():

WiFi.begin("YourSSID", "YourPassword", 0, NULL, true);

Explanation:

  • "YourSSID" — must match the hidden network exactly
  • "YourPassword" — case-sensitive
  • 0 — channel (0 lets the ESP32 scan all)
  • NULL — BSSID (MAC address of router; optional)
  • true — tells the ESP32 to connect to a hidden network

If you’re using PlatformIO or ESP-IDF, look for equivalent APIs with hidden SSID support.

Debug Tip: Broadcast Temporarily #

You can enable SSID broadcast on your router just to test:

  • Set your SSID to visible
  • Connect the ESP32 and verify credentials
  • Switch back to hidden after confirming the connection works

Additional Considerations #

  • Some routers block new clients or use MAC filtering — check your router's security settings
  • Ensure the ESP32 is within signal range, as hidden networks are more sensitive to signal loss during connection attempts

Summary #

Hidden Wi-Fi networks require more precise handling in code. If your ESP32 isn’t connecting, make sure you’re using the right WiFi.begin() variant and double-check every character in your credentials.

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.

No registration required. Start solving issues right away!