mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-12-21 14:32:52 +01:00
Reboot when wifi is not connected when provision failed
Only applied for network option is wifi
This commit is contained in:
@@ -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,17 +1000,12 @@ 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
|
||||||
mdnsInit();
|
mdnsInit();
|
||||||
localServer.begin();
|
localServer.begin();
|
||||||
|
|||||||
Reference in New Issue
Block a user