Open arihantdaga opened 4 years ago
removing this isn't wise, because it'll lead to behaviors like - even if we removed a wifi from the settings, it'll still connect to the same network.
Another things that seems to be working is this -
WiFi.mode(WIFI_OFF);
delay(200);
// See https://github.com/esp8266/Arduino/issues/2186
if (strncmp_P(ESP.getSdkVersion(), PSTR("1.5.3"), 5) == 0) {
WiFi.mode(WIFI_OFF);
}
WiFi.enableSTA(true);
WiFi.hostname(_hostname);
Note that we have to call wifi.mode(WIFI_OFF)
because otherwise it'll start in AP+STA Mode.
We can also disable the wifi.persistent(false); But then in our main function setup() we'll have to call wifi.disconnect() before starting.
There is a weird Issue causing MDNS Fail and hardware watchdog reset in wifi connection. This issue seems to be resolved after removing
wifi.persistent(false);
I don't know how it is related, but somehow, this seems to solve the problem. We'll investigate later.