Reboot when wifi is not connected when provision failed

Only applied for network option is wifi
This commit is contained in:
samuelbles07
2025-11-29 21:49:32 +07:00
parent ae247ead48
commit da694edcab

View File

@@ -250,12 +250,6 @@ void setup() {
wifiConnector.stopBLE(); wifiConnector.stopBLE();
} }
/** Set offline mode without saving, cause wifi is not configured */
if (wifiConnector.hasConfigurated() == false && networkOption == UseWifi) {
Serial.println("Set offline mode cause wifi is not configurated");
configuration.setOfflineModeWithoutSave(true);
}
/** Show display Warning up */ /** Show display Warning up */
if (ag->isOne()) { if (ag->isOne()) {
oledDisplay.setText("Warming Up", "Serial Number:", ag->deviceId().c_str()); oledDisplay.setText("Warming Up", "Serial Number:", ag->deviceId().c_str());
@@ -1006,15 +1000,10 @@ void initializeNetwork() {
if (!wifiConnector.isConnected()) { if (!wifiConnector.isConnected()) {
Serial.println("Failed connect to WiFi"); Serial.println("Failed connect to WiFi");
if (wifiConnector.isConfigurePorttalTimeout()) { oledDisplay.showRebooting();
oledDisplay.showRebooting(); delay(2500);
delay(2500); oledDisplay.setText("", "", "");
oledDisplay.setText("", "", ""); ESP.restart();
ESP.restart();
}
// Directly return because the rest of the function applied if wifi is connect only
return;
} }
// Initiate local network configuration // Initiate local network configuration