Chat freely about anything...

User avatar
By MikeyMoMo
#70523 ESP8266 Library version 2.3.0
Arduino IDE 1.8.4

The following does not get a DHCP address. It returns 192.168.4.1:

Code: Select all  wifiMulti.addAP("George",         "Pass1");   yield();
  wifiMulti.addAP("makerspace-2.4", "Pass2"); yield();
...
  while (wifiMulti.run() != WL_CONNECTED) {
    delay(1000);
    Serial.print('.');
  }
  Serial.print("Connected to\t"); Serial.println(WiFi.SSID());  // Tell us what network we're connected to
  Serial.print("IP address:\t"); Serial.println(WiFi.localIP());  // Send the IP address of the ESP8266 to the computer
  Serial.println("WiFi connected"); yield();   // HOORAY!!!



The following does get a DHCP address:

Code: Select allconst char* ssid = "George";
const char* password = "Pass1";
...
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");
 
  // Start the server
  server.begin();
  Serial.println("Server started");

  // Print the IP address
  Serial.println(WiFi.localIP());


I really would like to have a DHCP address. Both programs compiled on the same laptop, same network, same ESP hardware. Only change was from WiFi to WiFiMulti.

Mike