How do I get the localIP with ESP8266 standalone?

Most probably a dumb question.

I want to print the local IP of my ESP8266

How do I get the LocalIP?

   #include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "33e25...";

IPAddress ip;

WidgetTerminal terminal(2);

void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);


  Blynk.begin(auth, "Me", "Pass");
  while (!Blynk.connect()) {
    // Wait until connected
 ip = WiFi.localIP();
 terminal.println();terminal.println();terminal.println();terminal.println();terminal.println();
 terminal.println(F("Blynk v" BLYNK_VERSION ": Device started"));
  terminal.println();terminal.println();terminal.println();terminal.println();terminal.println();
 terminal.flush();

    
  digitalWrite(13, HIGH);
  delay(5000);
  //digitalWrite(13, LOW);

  }
}

// the loop function runs over and over again forever
void loop() {
 
  Blynk.run();

  terminal.println(millis());

 

  // Ensure everything is sent
 terminal.flush();

}

The code above has he following behaviour:

If the line ip = WiFi.localIP(); is “live”, it seems as if the rest
of the code in the setup section is not executed, but control goes
straight to loop()

When that line is commented, all seems to work as expected.

ip = Blynk.localIP gives an error ‘class BlynkWifi’ has no member named ‘localIP’

Thanks for moving this here.

  1. terminal.println(millis());
    this wil flood our server! you shouldn’t call such operations in the fast loop
    (please use SimpleTimer or something similar).
  2. inside of the while (!Blynk.connect()) { you’re sending to the Blynk terminal.
    But Blynk is not connected yet, according to the sketch logic!

Try printing local IP AFTER Blynk is connected.
Try printing it to the Serial - does it work?