ESP8266 wifi connection issues with my router - router issue solved

Hi all,

I have an issue connecting to my home wifi and node MCU keep reporting ssid unavailable. By running a simple connect test command, it reports the status as disconnected (integer 6) in the beggining, but a few seconds later it report ssid unabailable (integer 1) and I pull a ssid report and my router ssid is on top of the list. Not sure why. It has no issue with my cellphone hotspot. So I don't know if it is my setting on the router. Please help...

#include <ESP8266WiFi.h>

void setup()
{
Serial.begin(115200);
Serial.println();

WiFi.begin("XXXX", "XXXX");

Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);

Serial.print(WiFi.status());
if (WiFi.status() == 1){
byte available_networks = WiFi.scanNetworks();
Serial.println();
for (int network = 0; network < available_networks; network++) {
Serial.println(WiFi.SSID(network));
}
WiFi.begin("XXXX", "XXXX");
Serial.println();
}
}
Serial.println();

Serial.print("Connected, IP address: ");
Serial.println(WiFi.localIP());
}

void loop() {}

looks like it is caused by my router setting. Changed the setting then it was able to connect.

I am also facing that kind of issue with my home wifi I don't know why I am not an expert guy while I am searching that problem one thing I know when did I configure my uk vpn setting configure my wifi I am in trouble. I am unbaling to find the main problem while I am unable to find the main problem but I know I will catch but anyone knows this so kindly your help will highly be appreciated!