Skip to content

Commit 9bd6e13

Browse files
committed
reboot after wifi connect to fix unavailable web interface
1 parent c697ef7 commit 9bd6e13

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ void setup() {
2727
dbgln("[wifi] start");
2828
WiFi.mode(WIFI_STA);
2929
wm.setClass("invert");
30+
auto reboot = false;
31+
wm.setAPCallback([&reboot](WiFiManager *wifiManager){reboot = true;});
3032
wm.autoConnect();
33+
if (reboot){
34+
ESP.restart();
35+
}
3136
dbgln("[wifi] finished");
3237
dbgln("[modbus] start");
3338

0 commit comments

Comments
 (0)