Skip to main content
2 of 2
deleted 135 characters in body

Static IP configuration failed in NODEMCU

I'm trying to connect NODEMCU to my home network and set static IP address, but the static IP didn't set properly this is the code:

#include <ESP8266WiFi.h>
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  WiFi.config(IPAddress(192,168,1,129), IPAddress(192,168,1,1), IPAddress(225,225,225,0));
  WiFi.begin("Bam", "123456789");
  Serial.print("\nConnecting");
  while(WiFi.status()!=3){
    Serial.print(".");
    delay(500);
  }
  Serial.println("Connected");
  Serial.println(WiFi.localIP());
  

}

void loop() {
  // put your main code here, to run repeatedly:

}

and this is the output on the Serial monitor:

13:28:46.715 -> Connecting.......Connected
13:28:50.937 -> 192.168.1.100

when I set the same static IP address to my phone it sets with no problem.