user47210: All welcome. 
I'm trying to connect nodemcu to the phone's wifi.
And nodemcu can't do it. But sometimes after several reboots she does it. Also if i use my old phone - nodemcu connects perfectly! Why?
My "new" phone: Fly FS504 Cirrus 2
My old phone: Fly IQ4504 Quad.
My code:
#include <ESP8266WiFi.h>

const char *ssid =  "Just my SSID";     

const char *pass =  "Some password";

WiFiClient client;

void setup() 
{
       Serial.begin(9600);
       delay(10);

       Serial.println("Connecting to ");
       Serial.println(ssid); 

       WiFi.begin(ssid, pass); 
       while (WiFi.status() != WL_CONNECTED) 
          {
            // stack here (only with new phone)
            delay(500);
            Serial.print(".");
          }
      Serial.println("");
      Serial.println("WiFi connected"); 
}

void loop() 
{      

}


user38721: From my experience the esp8266's wifi is a little bit buggy sometimes. I'm not sure if it has something to do with the esp auto-connecting to known networks, but I managed to work-around this issue by explicitly WiFi.disconnect()ing from any potential network right before calling WiFi.begin().
Another thing that I noticed several times is that the esp can be easily disturbed when connected to a breadboard, in special when wifi is in use (in this case the esp might even crash). There must be some bad interferences, I guess.

47210: <p>All welcome. </p>

<p>I'm trying to connect nodemcu to the phone's wifi.</p>

<p>And nodemcu can't do it. But sometimes after several reboots she does it. Also if i use my old phone - nodemcu connects perfectly! Why?</p>

<p>My "new" phone: Fly FS504 Cirrus 2</p>

<p>My old phone: Fly IQ4504 Quad.</p>

<p>My code:</p>

<pre><code>#include &lt;ESP8266WiFi.h&gt;

const char *ssid =  "Just my SSID";     

const char *pass =  "Some password";

WiFiClient client;

void setup() 
{
       Serial.begin(9600);
       delay(10);

       Serial.println("Connecting to ");
       Serial.println(ssid); 

       WiFi.begin(ssid, pass); 
       while (WiFi.status() != WL_CONNECTED) 
          {
            // stack here (only with new phone)
            delay(500);
            Serial.print(".");
          }
      Serial.println("");
      Serial.println("WiFi connected"); 
}

void loop() 
{      

}
</code></pre>
 38721: <p>From my experience the esp8266's wifi is a little bit buggy sometimes. I'm not sure if it has something to do with the esp auto-connecting to known networks, but I managed to work-around this issue by explicitly <code>WiFi.disconnect()</code>ing from any potential network right before calling <code>WiFi.begin()</code>.</p>

<p>Another thing that I noticed several times is that the esp can be easily disturbed when connected to a breadboard, in special when wifi is in use (in this case the esp might even crash). There must be some bad interferences, I guess.</p>
