Board: WEMOS lolin32
Core Installation/update date: Jan/2018
IDE name: Arduino IDE
IPAddress ip(192,168,1,129);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255, 255, 255, 0);
IPAddress primaryDNS(8, 8, 8, 8); //optional
IPAddress secondaryDNS(8, 8, 4, 4); //optional
if (!WiFi.config(ip, gateway, subnet, primaryDNS, secondaryDNS)) {
Serial.println("STA Failed to configure");
}
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
WiFi.status() won't connect.
If I get rid of WiFi.config(), going with the localIP, Wifi can connect.
the esp fire in this mode not the event SYSTEM_EVENT_STA_CONNECTED but only SYSTEM_EVENT_STA_GOT_IP.
In WiFiGeneric.cpp Line 318:
WiFiSTAClass::_setStatus(WL_IDLE_STATUS);
} else if(event->event_id == SYSTEM_EVENT_STA_GOT_IP) {
// JL
// if(WiFiSTAClass::status() == WL_IDLE_STATUS)
{
WiFiSTAClass::_setStatus(WL_CONNECTED);
}
}
i comment out the line that check of WL_IDLE_STATUS. This help.
I can confirm the issue and the solution too
please fix
(Same as #1086 )
created the PR #1129 to fix this
Closed due it's fixed here: https://github.com/espressif/arduino-esp32/pull/1129
Thanks @baggior !
Most helpful comment
I can confirm the issue and the solution too
please fix
(Same as #1086 )