ESP32 unable to connect to home Wifi network

I recently acquired an ESP32 Arduino-Style board, and intend on using it with my home wifi. However, after doing a very simple initial test with some tutorial code I found online, I found that the board will simply loop forever, unable to connect to my home wifi. I have rigorously checked that I am using the correct SSID and password. In addition, I have found that the ESP32 connects just fine to a mobile hotspot. The simple example code is below:

#include <WiFi.h>

const char* ssid = "REDACTED";
const char* password =  "REDACTED";

void setup() {


  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    Serial.println("Connecting to WiFi..");

  Serial.println("Connected to the WiFi network");


void loop() {


My home wifi supports both 5.0GHz and 2.4GHz bands, and I even tried making each of these a separate network and only attempting to connect to the 2.4GHz one. This did not work either.

Really starting to get frustrated here, I have asked on an number of other places but to avail. Hopefully we can figure this out.

Edit: Some additional information. WiFi.status() goes straight to 6 or WL_DISCONNECTED

Did you scan network with that board? Does board even see any network? There is a scan sketch in examples.

Yes I did, and it IS able to consistently detect the home wifi network.

Seems like the status() reverting to WL_DISCONNECTED is just the default, just tried connecting it to a network that doesnt exist, as well as my home network with wrong password. So I guess theres no info there.

Really at a loss. Does ESP32 allow for connection to a network with WEP?

Don't you need to include a key (3rd parameter) in .begin for WEP (in addition to the ssid and pswd)?

I originally was not trying to do WEP. I was asking if it would be an option. I'll try wep tonight and report back.

Uhhh... woops. Meant WPS. All these W acronyms have me confused.

Sorry to like triple post... I am now extremely frustrated as I have no idea what is going on. I tried connecting to my router trying both pin mode WPS and push button based WPS.. to no avail. It doesn't even say it has failed, it just hangs. What in the world is happening??

Sorry to like triple post... I am now extremely frustrated as I have no idea what is going on.

Whilst the ESP32 can be frustrating, do appreciate that its not an Arduino, its a product that someone has written an interface for the Arduino IDE.

I see you have also raised the same question in the appropriate ESP32 forum, perhaps they can shed more light on thier product.

Yes I am aware, apologies if it appears that i am frustrated with arduino. I have posted here as a last resort... esp32 forum has been very much fruitless and even worse i can't reply to anything in a timely fashion as every reply i make must be reviewed. I believe its worth a try to post here as there is a lot of overlap in the communities.