Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiFi: toggle STA mode back to avoid softlock #1942

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion code/espurna/button.ino
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,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) {
Expand Down
1 change: 1 addition & 0 deletions code/espurna/wifi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ void wifiReconnectCheck() {
#if TELNET_SUPPORT
if (telnetConnected()) connected = true;
#endif
jw.enableSTA(true);
jw.setReconnectTimeout(connected ? 0 : WIFI_RECONNECT_INTERVAL);
}

Expand Down