Howto change default portal 192.168.4.1

My ISP uses 192.168.4.1 as the router gateway, and I can't change it. These are eero routers with an app to control, no browser interface to my knowledge.
I am including the ESP32 sketch for WiFiAccessPoint, including the output. I then asked ChatGPT for advice and got some code that looks reasonable to someone not trained in networks. I modified the original sketch to use the ChatGPT code, but there was no change. I am not network trained, so I might be missing something simple. Any ideas?

/*
  WiFiAccessPoint.ino creates a WiFi access point and provides a web server on it.

  Steps:
  1. Connect to the access point "yourAp"
  2. Point your web browser to http://192.168.4.1/H to turn the LED on or http://192.168.4.1/L to turn it off
     OR
     Run raw TCP "GET /H" and "GET /L" on PuTTY terminal with 192.168.4.1 as IP address and 80 as port

  Created for arduino-esp32 on 04 July, 2018
  by Elochukwu Ifediora (fedy0)
*/

#include <WiFi.h>
#include <NetworkClient.h>
#include <WiFiAP.h>

#ifndef LED_BUILTIN
#define LED_BUILTIN 2  // Set the GPIO pin where you connected your test LED or comment this line out if your dev board has a built-in LED
#endif

// Set these to your desired credentials.
const char *ssid = "yourAP";
const char *password = "yourPassword";

NetworkServer server(80);

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);

  Serial.begin(115200);
  Serial.println();
  Serial.println("Configuring access point...");

  // You can remove the password parameter if you want the AP to be open.
  // a valid password must have more than 7 characters
  if (!WiFi.softAP(ssid)) {
    log_e("Soft AP creation failed.");
    while (1);
  }
  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);
  server.begin();

  Serial.println("Server started");
}

void loop() {
  NetworkClient client = server.accept();  // listen for incoming clients

  if (client) {                     // if you get a client,
    Serial.println("New Client.");  // print a message out the serial port
    String currentLine = "";        // make a String to hold incoming data from the client
    while (client.connected()) {    // loop while the client's connected
      if (client.available()) {     // if there's bytes to read from the client,
        char c = client.read();     // read a byte, then
        Serial.write(c);            // print it out the serial monitor
        if (c == '\n') {            // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            client.print("Click <a href=\"/H\">here</a> to turn ON the LED.<br>");
            client.print("Click <a href=\"/L\">here</a> to turn OFF the LED.<br>");

            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;
          } else {  // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }

        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(LED_BUILTIN, HIGH);  // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(LED_BUILTIN, LOW);  // GET /L turns the LED off
        }
      }
    }
    // close the connection:
    client.stop();
    Serial.println("Client Disconnected.");
  }
}

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4744
load:0x40078000,len:15672
load:0x40080400,len:3152
entry 0x4008059c

Configuring access point...
AP IP address: 192.168.4.1
Server started

Here is response to typing 192.168.4.1 in a browser

Here is ChatGPT code

#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
}

And here is merged code

/*
  WiFiAccessPoint.ino creates a WiFi access point and provides a web server on it.

  Steps:
  1. Connect to the access point "yourAp"
  2. Point your web browser to http://192.168.4.1/H to turn the LED on or http://192.168.4.1/L to turn it off
     OR
     Run raw TCP "GET /H" and "GET /L" on PuTTY terminal with 192.168.4.1 as IP address and 80 as port

  Created for arduino-esp32 on 04 July, 2018
  by Elochukwu Ifediora (fedy0)
*/

#include <WiFi.h>
#include <NetworkClient.h>
#include <WiFiAP.h>

#ifndef LED_BUILTIN
#define LED_BUILTIN 2  // Set the GPIO pin where you connected your test LED or comment this line out if your dev board has a built-in LED
#endif

// Set these to your desired credentials.
const char *ssid = "yourAP";
const char *password = "yourPassword";

// ChatGPT code start
// 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);
// ChatGPT code end

NetworkServer server(80);

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);

  Serial.begin(115200);
  Serial.println();
  Serial.println("Configuring access point...");

  // ChatGPT code start
  // 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!");
  }
  // ChatGPT code end

  server.begin();

  Serial.println("Server started");
}

void loop() {
  NetworkClient client = server.accept();  // listen for incoming clients

  if (client) {                     // if you get a client,
    Serial.println("New Client.");  // print a message out the serial port
    String currentLine = "";        // make a String to hold incoming data from the client
    while (client.connected()) {    // loop while the client's connected
      if (client.available()) {     // if there's bytes to read from the client,
        char c = client.read();     // read a byte, then
        Serial.write(c);            // print it out the serial monitor
        if (c == '\n') {            // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            client.print("Click <a href=\"/H\">here</a> to turn ON the LED.<br>");
            client.print("Click <a href=\"/L\">here</a> to turn OFF the LED.<br>");

            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;
          } else {  // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }

        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(LED_BUILTIN, HIGH);  // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(LED_BUILTIN, LOW);  // GET /L turns the LED off
        }
      }
    }
    // close the connection:
    client.stop();
    Serial.println("Client Disconnected.");
  }
}

Here is serial.log

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4744
load:0x40078000,len:15672
load:0x40080400,len:3152
entry 0x4008059c

Configuring access point...
AP Started
IP address: 192.168.4.253
Server started

And the browser after entering the new AP 192.168.4.253
Nothing happens, the tab is spinning?

Try making the esp ip 192.168.0.1 or 192.168.1.1, leave subnet alone..

kind of remember your isp is also using a 255.255.252.0 subnet..

If yes, then that network is from 192.168.4.1-192.168.7.254 and you shouldn’t use anything in this range for a new second network..

assuming you want to also be connected to isp..

you’re confusing your system..

a subnet mask of 255.255.255.0 will give you a range of 192.168.0.1-192.168.0.254..

so try either 0.1 or 1.1, it should work..

good luck.. ~q

I am not sure you are understanding. I have dozens of boards, and if I grab a sample sketch that establishes an AP, it is automatically, according to the rules of the internet, set to 192.168.4.1 I have never looked to hard but that address is hard coded somewhere in the library code.
What I want to know is how to change that address without modifying library code.
Before I was given the eero routers I had no problem.
Is not the WiFi.softAPConfig the correct class member to modify the captive portal?

guess I am confused as it looks like you have already accomplished using a different IP without changing lib code..

but looks like you used 192.168.4.253, which is also in the same network as your isp, which is why it would not work..

change 192.168.4.253 to 192.168.0.1

~q

Like this ?
IPAddress local_IP(192, 168, 1, 0); // The AP's own IP (default was 192.168.4.1)
IPAddress gateway(192, 168, 1, 0); // Gateway is usually same as AP

Configuring access point...

AP Config Failed!

no

IPAddress local_IP(192, 168, 1, 1);

can’t use .0

~q

As I said I am not network trained, but I am pretty sure that when I enter 192.168.0.1 in a browser on my Mac that is connected to 182.168.4.167 on my eero Router there is no way it can connect to the WiFi on my esp32 at 192.168.0.1
At the very least the esp32 has to be ion the same segement ie 192.168.4.x
My second eero router has a gateway of 192.168.4.20.
Since nothing is assigned from 4.1 to 4.20 maybe I will try 4.10

you can’t setup a second network in the same range as the other..

you can’t use 192.168.1.0, the first usable address for that would be 192.168.1.1 and that would also be the gateway..

or you could do 192.168.0.1

but the second network can not be in the same range as the first..

the esp is the second network..

~q

I am not knowingly trying to set up a second network. Before the eero routers, every single sketch to do with netwoirking had hidden somewhere the address 192.168.4.1 it's even in wiki as a standard address and my ISP should not be using it. Every board I have used to be accessible at 192.168.4.1.
Since the isp foisted these eero's on us I need to change the 192.168.4.1 universal portal address to another address.
According to my limited research the WiFi.softAPConfig(local_IP, gateway, subnet) does that but for some weird reason it is not working.

Well, if you want to be connected to the isp..

and also connect to an esp hosted access point..

then yes, that’s 2 networks and quite possible..

did you try 192.168.1.1??

it should configure..

when your system get’s an ip from the esp something like 192.168.1.2 and then your system will know that anything in 192.168.1.xxx range send out this interface..

now you could have the esp connect to you isp router then using the 192.168.4.xxx range is valid..

~q

I can't even ping 192.168.1.1. But I will try

Like this

IPAddress local_IP(192, 168, 1, 1);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);

yes, try that..

~q

No response

can you post the serial monitor output??

~q

I just noticed my phone is showing the ssid I used so I tried that in a browser. Not sure what that means. I will try with 192.168.1.1 etc and show you the serial

Here it is

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4744
load:0x40078000,len:15672
load:0x40080400,len:3152
entry 0x4008059c

Configuring access point...
AP Started
IP address: 192.168.1.1
Server started

now you should be able to connect to it’s ssid..

how are you connected to your isp, using wireless or wired??

if wired then you should be able to connect wireless to the esp at the same time..

if it’s a wireless connection then you would have to disconnect and connect to the esp or you would need 2 wireless adapters..

~q

Connects to a site on the web
wireless
It used to work!