Stuck on "Connecting to WiFi…" with dots

  • ESP32
  • ESP8266

You may see

Connecting to WiFi..
........
WL_NO_SSID_AVAIL
WL_CONNECT_FAILED

Stay safe: Never share code or a screenshot with your real Wi-Fi password in it.

Why it happens

  • The name or password has a typing mistake. Capitals and spaces count.
  • The router uses only 5 GHz. These boards use 2.4 GHz.
  • School or hotel Wi-Fi that asks you to sign in on a page.
  • Too far from the router, or weak power.

How to fix it

  1. Copy the Wi-Fi name exactly as the phone shows it.
  2. Make a 2.4 GHz phone hotspot with a simple name and password and try that. On an iPhone switch on Maximise Compatibility.
  3. Print WiFi.status(): 1 means the name wasn't found, 4 or 6 usually means the password is wrong.
  4. Move closer and use a good cable.

It worked if: The Serial Monitor prints an IP address like 192.168.1.20.

From the official documentation. Status numbers from the ESP32 core source; 2.4 GHz from the chip datasheets. Sources: ESP32 core: WiFiType.h.

Didn't help? Search another error or ask us.