I am currently working on a project where i make my ESP8266 create an access point which users can connect to using their phone.
Theres one problem however, when trying to connect to the Access Point it will take up to 60 seconds or more to fully connect. And sometimes (on iOS at least) it will not connect at all and give an error about being unable to connect.
WiFi.disconnect();
WiFi.mode(WIFI_AP);
Serial.print("Autoconnect status: ");
Serial.println(WiFi.getAutoConnect());
WiFi.setAutoReconnect(false);
WiFi.setAutoConnect(false);
WiFi.softAPConfig(ip, gateway, subnet);
if(WiFi.softAP(accessPointSSID, accessPointPassword, 6)) {
Serial.print("Succesfully setup Access Point with:");
Serial.print(accessPointSSID);
Serial.print(", ");
Serial.println(accessPointPassword);
} else {
Serial.print("Failed to setup Acces Point with:");
Serial.print(accessPointSSID);
Serial.print(", ");
Serial.println(accessPointPassword);
}
My loop function only has a call to handle the webserver (for api calls and such)
void loop(void) {
server.handleClient();
}
This is how i setup the access point in setup function
Does anybody know how to resolve this issue?
Thanks for reading!