Skip to main content
deleted 135 characters in body
Source Link

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");
  if(WiFi.config(IPAddress(192,168,1,129), IPAddress(192,168,1,1), IPAddress(225,225,225,0))){
    Serial.println("Config success");
  }
  else{
    Serial.println("Config failure");
  }
  Serial.println(WiFi.localIP());
  

}

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

}

and this is the output on the Serial monitor:

1113:3428:5946.826715 -> Connecting.........Connected
11:35:05.071 -> Config failure
1113:3528:0550.071937 -> 192.168.1.100

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

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.begin("Bam", "123456789");
  Serial.print("\nConnecting");
  while(WiFi.status()!=3){
    Serial.print(".");
    delay(500);
  }
  Serial.println("Connected");
  if(WiFi.config(IPAddress(192,168,1,129), IPAddress(192,168,1,1), IPAddress(225,225,225,0))){
    Serial.println("Config success");
  }
  else{
    Serial.println("Config failure");
  }
  Serial.println(WiFi.localIP());
  

}

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

}

and this is the output on the Serial monitor:

11:34:59.826 -> Connecting.........Connected
11:35:05.071 -> Config failure
11:35:05.071 -> 192.168.1.100

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

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.

Source Link

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.begin("Bam", "123456789");
  Serial.print("\nConnecting");
  while(WiFi.status()!=3){
    Serial.print(".");
    delay(500);
  }
  Serial.println("Connected");
  if(WiFi.config(IPAddress(192,168,1,129), IPAddress(192,168,1,1), IPAddress(225,225,225,0))){
    Serial.println("Config success");
  }
  else{
    Serial.println("Config failure");
  }
  Serial.println(WiFi.localIP());
  

}

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

}

and this is the output on the Serial monitor:

11:34:59.826 -> Connecting.........Connected
11:35:05.071 -> Config failure
11:35:05.071 -> 192.168.1.100

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