nodemcu esp8226 with arduino

hi,, i am using nodemcu esp8226,, my problem is that, nodemcu disconnect when connection lost but not connect when connection (WiFi available). please help me in my project. i am using arduino studio.

Comments

  • Hello Ijaz,
    Welecome to the AskSensors Community!
    ijaz wrote: »
    hi,, i am using nodemcu esp8226,, my problem is that, nodemcu disconnect when connection lost but not connect when connection (WiFi available). please help me in my project. i am using arduino studio.
    You have many options to fix the issue. but it will depend on the specifications of your project. here some suggestions:

    SOLUTION 1:

    Put the WiFi.begin(ssid,pws) and the test of if (WiFi.status() != WL_CONNECTED) in the loop();
    WiFi.begin(SSID,PASSWORD);
    if (WiFi.status() != WL_CONNECTED){
    //...
    }
    

    SOLUTION 2:

    One possible solution is to check if the connection is still alive in your loop(), if it is not, then do a reboot.
    When the ESP8266 reboots, it will go through setup() and connect again.

    Does this answer your question ?
Sign In or Register to comment.