Skip to content

Commit

Permalink
wifi manual reconnect fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroKorniienko committed Nov 26, 2020
1 parent b75e271 commit 768bb7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion EmbUI/wi-fi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ void EmbUI::wifi_connect(const char *ssid, const char *pwd)
if (ssid){
String _ssid(ssid); String _pwd(pwd); // I need objects to pass it to the lambda
embuischedw.once(WIFI_BEGIN_DELAY, [_ssid, _pwd, this](){
WiFi.disconnect();
LOG(printf_P, PSTR("UI WiFi: client connecting to SSID:%s, pwd:%s\n"), _ssid.c_str(), _pwd.c_str());
#ifdef ESP32
WiFi.disconnect();
Expand All @@ -183,7 +184,7 @@ void EmbUI::wifi_connect(const char *ssid, const char *pwd)
embuischedw.detach();
});
} else {
embuischedw.once(WIFI_BEGIN_DELAY, [this](){ WiFi.begin(); embuischedw.detach();} );
embuischedw.once(WIFI_BEGIN_DELAY, [this](){ WiFi.disconnect(); sysData.wifi_sta = false; WiFi.begin(); embuischedw.detach();} );
}
}

Expand Down

0 comments on commit 768bb7a

Please sign in to comment.