So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By PatrykW
#78051
Code: Select allvoid setup() {
  Serial.begin(115200);
  delay(10);
  pinMode(0, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(0, OUTPUT);
  pinMode(13, OUTPUT);
  digitalWrite(0, LOW);
  digitalWrite(2, LOW);
  digitalWrite(0, LOW);
  digitalWrite(13, LOW);

  // Connect to WiFi network
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  IPAddress ip(192,168,1,200); /*adress. make sure it's unique and not already taken*/
  IPAddress gateway(192,168,1,1);    ///////////////////////////////////ruter
  IPAddress subnet(255,255,255,0);
  WiFi.mode(WIFI_STA);
  WiFi.config(ip, gateway, subnet);
  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.print("Use this URL to connect: ");
  Serial.print("http://");
  Serial.print(WiFi.localIP());
  Serial.println("/");
}

Just flashed your code with this setup function on two wemos boards and it does work. Change the address and gateway to match your subnet. If it still won't work, you probably have some IP conflict. make sure every IP is unique and not taken by another device already. ping is your friend