Hi folks, so I have set up an AP using <WebSocketsServer.h> and <esp_wifi.h> on an ESP32C3.
Now here's a weird thing, everything worked on my Pixel 9 at first. I was able to log into the AP, enter password and see my webpage.
Then, for some reason, I was unable to access the webpage on my GP9. I thought to try a couple of other smartphones, an old samsung, and newish Iphone and an Honor (latest model, android 15 i think) and all are able to find the webpage with no problems whatsoever.
so despite connecting to wifi no probs, I just seem unable to actually even ping my esp with the GP9!
When I connect via wifi I get the following
15:10:33.305 -> Sleep State: AWAKE, Inactive: 0s, Clients: 1
15:10:33.604 -> IP assigned: 192.168.4.2 to MAC: C0:1C:6A:76:EF:20
15:10:43.311 -> Sleep State: AWAKE, Inactive: 0s, Clients: 1
The only thing I cannot get to work on any phone is websocket so I am not getting automatic page updates...
Tried changing all parameters that I can think of to no effect...
All in Ard IDE...
Serial.print("Setting up WiFi AP... ");
IPAddress customDNS(8, 8, 8, 8); // Google DNS
if (!WiFi.softAPConfig(customAPIP, customGateway, customSubnet)) {
Serial.println("Failed to configure AP!");
} else {
Serial.println("AP configured successfully");
}
if (!WiFi.softAP(ssid, password, 1, 0, 4)) {
Serial.println("Failed to start AP!");
} else {
Serial.println("AP started successfully");
}
IPAddress IP = WiFi.softAPIP();
WiFi.enableIPv6(false);
// Set up HTTP server routes
Serial.print("Setting up HTTP server... ");
server pages here......
server.on("/settimezone", handleSetTimezone); etc etc...
server.onNotFound(handleNotFound);
server.begin();
Serial.println("OK");
// Initialize WebSocket server
Serial.print("Starting WebSocket server... ");
webSocket.begin();
webSocket.onEvent(webSocketEvent);
Serial.println("OK");
But this is a side issue... Why would my GP9 not want to talk to the ESP and how can I take things further?