-->
Page 1 of 2

NodeMCU suddenly cannot connect to internet

PostPosted: Mon Jun 25, 2018 6:28 am
by panoss
My NodeMCU was, till yesterday, very easilly connecting to the internet.
Untill I installed a library, Thermistor_library-master.
From that moment the NodeMCU can no way connect to the internet!!!

I removed the library (deleted the library 's folder from C:\Users\Pan\Documents\Arduino), I tried previous sketches that worked 100% in the past, but NOTHING!
It cannot connect.
I even tried another (unused) NodeMCU and the same thing happens!
I 'm desperate, I don't know what to do!
Any help is welcome.

(I have made no changes to the router 's credentials or any of it 's settings)

Re: NodeMCU suddenly cannot connect to internet

PostPosted: Wed Jun 27, 2018 9:25 am
by panoss
I got it working again with this code:

Code: Select allint connectWiFi(){
   
    WiFi.disconnect(true);
    WiFi.setAutoConnect(false);
    WiFi.setPhyMode(WIFI_PHY_MODE_11G);
    WiFi.begin(ssid, password);
    WiFi.printDiag(Serial);
    Serial.println(WiFi.getPhyMode());
 
    Serial.print("Connecting");
    while (WiFi.status() != WL_CONNECTED)
    {
      delay(500);
      Serial.print(".");
    }
    Serial.println();
    Serial.print("Connected, IP address: ");
    Serial.println(WiFi.localIP());
 
    delay(2000);
   
    Serial.println( "Connected" );
}


Which has three commands that my code did not have:
Code: Select all    WiFi.disconnect(true);
    WiFi.setAutoConnect(false);
    WiFi.setPhyMode(WIFI_PHY_MODE_11G);

Re: NodeMCU suddenly cannot connect to internet

PostPosted: Wed Jun 27, 2018 8:48 pm
by theenggprojects
I think you should reboot your NodeMCU, something like factory restore. Try to connect it with some other wifi, may be that will solve issue.

Re: NodeMCU suddenly cannot connect to internet

PostPosted: Wed Jun 27, 2018 10:53 pm
by McChubby007
theenggprojects wrote:I think you should reboot your device, something like factory restore. Try to connect it with some other wifi, may be that will solve issue.

What on earth are you talking about? Do you know anything about esp8266?

Actually, don't bother to reply; I just saw your other post and now realise you just post nonsense everywhere.