Hi everyone ,
I have NodeMcu Esp8266 , I try to connect it to My network and it isn't done
I did it before and it connected but it unable to connect again
I tried to scan WIFI networks and it done ( the result is : it works correctly and it find all wifi networks around )
but the main problem it doesn't connect to any WIFI Network
The Following is my code ( Note : I tried this code on another one NODEMCU ESP8266 and it works correctly )
#include <ESP8266WiFi.h>
WiFiServer server(80);
WiFiClient client;
String myresultat;
String ClientRequest;
String ReadIncomingRequest(){
while(client.available()) {
ClientRequest = (client.readStringUntil('\r'));
if ((ClientRequest.indexOf("HTTP/1.1")>0)&&(ClientRequest.indexOf("/favicon.ico")<0)){
myresultat = ClientRequest;
}
}
return myresultat;
}
void setup()
{
Serial.begin(9600);
WiFi.disconnect();
delay(3000);
Serial.println("START");
WiFi.begin("MYNetwork","MY123456");
while ((!(WiFi.status() == WL_CONNECTED))){
delay(300);
Serial.print("..");
}
Serial.println("Connected , My IP Address Is :");
Serial.println((WiFi.localIP()));
server.begin();
}
void loop()
{
client = server.available();
if (!client) { return; }
while(!client.available()){ delay(1); }
Serial.println((ReadIncomingRequest()));
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("");
client.println("<!DOCTYPE HTML>");
client.println("<html>");
client.println("Welcome");
client.println("</html>");
client.stop();
delay(1);
}