diff --git a/src/network/AhoyEthernet.h b/src/network/AhoyEthernet.h index 5d59eb3c..e8069f02 100644 --- a/src/network/AhoyEthernet.h +++ b/src/network/AhoyEthernet.h @@ -37,6 +37,8 @@ class AhoyEthernet : public AhoyWifi { void OnEvent(WiFiEvent_t event) { switch(event) { case SYSTEM_EVENT_STA_CONNECTED: + mWifiConnecting = false; + [[fallthrough]]; case ARDUINO_EVENT_ETH_CONNECTED: if(NetworkState::CONNECTED != mStatus) { mStatus = NetworkState::CONNECTED; diff --git a/src/network/AhoyWifiAp.h b/src/network/AhoyWifiAp.h index 669e8ec8..ed1ad3a3 100644 --- a/src/network/AhoyWifiAp.h +++ b/src/network/AhoyWifiAp.h @@ -36,11 +36,7 @@ class AhoyWifiAp { ah::welcome(mIp.toString(), String(F("Password: ") + String(mCfg->apPwd))); - #if defined(ETHERNET) - WiFi.mode(WIFI_AP); - #else WiFi.mode(WIFI_AP_STA); - #endif WiFi.softAPConfig(mIp, mIp, IPAddress(255, 255, 255, 0)); WiFi.softAP(WIFI_AP_SSID, mCfg->apPwd); @@ -60,12 +56,7 @@ class AhoyWifiAp { mDns.stop(); WiFi.softAPdisconnect(); - #if defined(ETHERNET) - WiFi.mode(WIFI_OFF); - #else - WiFi.scanDelete(); WiFi.mode(WIFI_STA); - #endif mEnabled = false; }