diff --git a/code/espurna/button.ino b/code/espurna/button.ino index a44e667c..07045fdc 100644 --- a/code/espurna/button.ino +++ b/code/espurna/button.ino @@ -136,7 +136,11 @@ void buttonEvent(unsigned int id, unsigned char event) { } if (BUTTON_MODE_AP == action) { - wifiStartAP(); + if (wifiState() & WIFI_STATE_AP) { + wifiStartSTA(); + } else { + wifiStartAP(); + } } if (BUTTON_MODE_RESET == action) { diff --git a/code/espurna/wifi.ino b/code/espurna/wifi.ino index 49ac7f75..8341141c 100644 --- a/code/espurna/wifi.ino +++ b/code/espurna/wifi.ino @@ -700,6 +700,7 @@ void wifiReconnectCheck() { #if TELNET_SUPPORT if (telnetConnected()) connected = true; #endif + jw.enableSTA(true); jw.setReconnectTimeout(connected ? 0 : WIFI_RECONNECT_INTERVAL); }