[GH-ISSUE #19] How to get current local IP address? #17

Closed
opened 2026-02-28 01:22:53 +03:00 by kerem · 1 comment
Owner

Originally created by @roccomuso on GitHub (Dec 9, 2015).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/19

This is what i tried:

  WiFiManager wifi;

  wifi.setTimeout(120); // retry after 2 minutes to connect to a wifi.

  if(!wifi.autoConnect(apName)) { // timeut reached
    Serial.println("failed to connect and hit timeout");
    delay(3000);
    //reset and try again
    ESP.reset();
    delay(5000);
  } 

  // if you get here you have connected to the WiFi
  Serial.println("connected!");
  currentIp = wifi.localIP();

But I've got the following error:

'class WiFiManager' has no member named 'localIP'
Originally created by @roccomuso on GitHub (Dec 9, 2015). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/19 This is what i tried: ``` WiFiManager wifi; wifi.setTimeout(120); // retry after 2 minutes to connect to a wifi. if(!wifi.autoConnect(apName)) { // timeut reached Serial.println("failed to connect and hit timeout"); delay(3000); //reset and try again ESP.reset(); delay(5000); } // if you get here you have connected to the WiFi Serial.println("connected!"); currentIp = wifi.localIP(); ``` But I've got the following error: ``` 'class WiFiManager' has no member named 'localIP' ```
kerem closed this issue 2026-02-28 01:22:54 +03:00
Author
Owner

@tzapu commented on GitHub (Dec 9, 2015):

hi,
just do WiFi.localIP() . it's a function of the core WiFI, not my lib.
maybe the examples could do with another naming scheme to make things clearer
cheers

<!-- gh-comment-id:163110211 --> @tzapu commented on GitHub (Dec 9, 2015): hi, just do `WiFi.localIP()` . it's a function of the core WiFI, not my lib. maybe the examples could do with another naming scheme to make things clearer cheers
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#17
No description provided.