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()
{
}
WiFi.disconnect()
before attempting to connect, the esp8266's wifi is a bit buggy sometimes. – Sim Son Jun 11 '19 at 15:32