ESP32 + googlephone 9

Hi folks, so I have a small project with an esp32 acting as an AP. It initially worked on my google phone but now for some reason I cannot connecting to the AP via webpage. This does work with an Iphone, an Honor mobile (android 15 I think) and an ancient samsung.

I can connect the wifi no problem, but the following page…

I just cannot find an explanation!

Using #include <WebServer.h>

Is there software for android that can analyse requests etc and determine what is going on??

And btw I have tried restart, clearing cache and settings etc…. arrrggh!

Any ideas will be appreciated!

Do you have a correct IP address? Can you connect with your computer and ping the server?

I can't use any software that expects 192.168.4.1 as my modern router doesn't honor that address. Maybe the phone is doing something similar.

What is wrong with 192.168.4.1 ?

On my ISP-supplied WiFi 6 and 6e router, I have no access to 192.168.4.1. That is supposed to be the universal AP, but that address does not exist on my router. When I try it, I get an ISP error page.
I also have no web access like we used to, the router is managed with the eero app. It shows 192.168.4.1 is the Gateway eero IP Address.
I was wondering if the phone has done something similar.

Mil24 wants to set up an AP on his ESP32. It is the ESP32 that is supposed to have the address 192.168.4.1, acting as a router in this case.

This has nothing to do with home WiFi. Your home WiFi probably uses some other address space.

That is correct, the ESP is in AP mode not STA mode!

And I just cannot figure why it worked originally and not now. Obs something with my phone, simply because it works with others!

If it works with other phones I guess it must be your phone.

NOPE, I did a test the other day to see if I could change the 192.168.4.1 but was not successful. Here is a screenshot of some of the info. As you can see 192.168.4.1 is already assigned. This is the main router attached to the modem.

This is a second router in a diferent room but same network.

NOTE the IP, and although you can't see it, I think the Netmask ends in 240.

Here is the network data

And here is what I see when I enter 192.168.4.1 as the address in the browser. His phone may be doing something similar. I don't know when the routes were changed, if they were changed, regarding the special address 192.168.4.1, but that is what is happening.

@mil24 Try this code to change the captive portal address of 192.168.4.1 to something else. I chose 192.168.4.253 (254 and 255 are special I think)

#include <WiFi.h>   // For ESP32
// #include <ESP8266WiFi.h> // For ESP8266 instead

const char* ssid     = "MyESP_AP";
const char* password = "12345678";

// Set custom IP info
IPAddress local_IP(192, 168, 4, 253);     // The AP's own IP (default was 192.168.4.1)
IPAddress gateway(192, 168, 4, 253);      // Gateway is usually same as AP
IPAddress subnet(255, 255, 255, 0);

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

  // Configure AP with custom IP
  if (!WiFi.softAPConfig(local_IP, gateway, subnet)) {
    Serial.println("AP Config Failed!");
  }

  // Start AP
  if (WiFi.softAP(ssid, password)) {
    Serial.println("AP Started");
    Serial.print("IP address: ");
    Serial.println(WiFi.softAPIP());
  } else {
    Serial.println("AP Start Failed!");
  }
}

void loop() {
  // Your code here
}

I'm not familiar with Apple but I guess that you're getting a HTTP reply from http://192.168.4.1, it is just that it is a "forbidden" reply, not what you expected.

Is there a particular reason you're using 255.255.252.0 subnet mask? Although it is valid, most likely your home network is just misconfigured. You probably wanted to assign 255.255.255.0, which is still good for 254 different IP addresses.

Folks, this is setup as an AP so I am not using a router. Besides, other android phones are connecting ok.

I can’t even ping with my Pixel despite it showing as connected to the network!

Turned off randomised MAC and trying some feedback via serial to see what is happening…