Learning Access Point: is a local IP, gateway & subnet mask manual entry needed?

/*
https://lastminuteengineers.com/creating-esp32-web-server-arduino-ide
*/
/* Put IP Address details, manually */
IPAddress local_ip(192,168,1,1);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);

void setup()
{
  WiFi.softAP(ssid, password);
  WiFi.softAPConfig(local_ip, gateway, subnet);
}

Is it possible to change this example:

So that the IP address, gateway and subnet mask don't need to be manually entered as they have it?
I'm a bit thrown because the one above is not automatically used for an IP address--unlike other examples:

/*
https://microcontrollerslab.com/esp32-soft-access-point-web-server-in-arduino-ide/
*/
void setup()
{
  Serial.print("Setting soft access point mode");
  WiFi.softAP(ssid, password);
  IPAddress IP = WiFi.softAPIP();
}

Yet, both of these examples use the same WiFi library. Is the bottom code all that's needed?

Yet, both of these examples use the same Wire library. Is the bottom code all that's needed?

They don't use the Wire library. I hope that should read "WiFi".

Yes, the bottom code is all that's needed, in that case the defaults are used (and read out in the example).

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.