Removing option for auto reboot on wifi error

This commit is contained in:
Gunnar Skjold 2023-11-25 10:31:21 +01:00
parent 2b0626b203
commit 0e6abd0f18
6 changed files with 12 additions and 26 deletions

View File

@ -49,7 +49,7 @@ struct WiFiConfig {
uint8_t power;
uint8_t sleep;
uint8_t use11b;
bool autoreboot;
bool unused;
}; // 213
struct MqttConfig {

View File

@ -75,7 +75,6 @@ bool AmsConfiguration::setWiFiConfig(WiFiConfig& config) {
wifiChanged |= config.power != existing.power;
wifiChanged |= config.sleep != existing.sleep;
wifiChanged |= config.use11b != existing.use11b;
wifiChanged |= config.autoreboot != existing.autoreboot;
} else {
wifiChanged = true;
}
@ -1023,7 +1022,7 @@ bool AmsConfiguration::relocateConfig96() {
WiFiConfig wifi;
EEPROM.get(CONFIG_WIFI_START, wifi);
wifi.use11b = 1;
wifi.autoreboot = true;
wifi.unused = true;
EEPROM.put(CONFIG_WIFI_START, wifi);
NtpConfig ntp;

File diff suppressed because one or more lines are too long

View File

@ -445,9 +445,6 @@
</div>
</div>
</div>
<div class="my-3">
<label><input type="checkbox" name="wa" value="true" bind:checked={configuration.w.a} class="rounded mb-1"/> Auto reboot on connection problem</label>
</div>
<div class="my-3">
<label><input type="checkbox" name="wb" value="true" bind:checked={configuration.w.b} class="rounded mb-1"/> Allow 802.11b legacy rates</label>
</div>

View File

@ -886,7 +886,7 @@ void AmsWebServer::configurationJson() {
strlen(wifiConfig.psk) > 0 ? "***" : "",
wifiConfig.power / 10.0,
wifiConfig.sleep,
wifiConfig.autoreboot ? "true" : "false",
"false",
wifiConfig.use11b ? "true" : "false"
);
server.sendContent(buf);
@ -1262,7 +1262,6 @@ void AmsWebServer::handleSave() {
}
wifi.power = server.arg(F("ww")).toFloat() * 10;
wifi.sleep = server.arg(F("wz")).toInt();
wifi.autoreboot = server.hasArg(F("wa")) && server.arg(F("wa")) == F("true");
wifi.use11b = server.hasArg(F("wb")) && server.arg(F("wb")) == F("true");
config->setWiFiConfig(wifi);

View File

@ -151,7 +151,6 @@ EnergyAccountingRealtimeData rtd;
#endif
EnergyAccounting ea(&Debug, &rtd);
uint8_t wifiReconnectCount = 0;
bool wifiDisable11b = false;
HDLCParser *hdlcParser = NULL;
@ -548,7 +547,6 @@ void loop() {
Debug.stop();
WiFi_connect();
} else {
wifiReconnectCount = 0;
if(!wifiConnected) {
WiFi_post_connect();
}
@ -1537,11 +1535,6 @@ void WiFi_connect() {
}
if(WiFi.getMode() != WIFI_OFF) {
if(wifiReconnectCount > 3 && wifi.autoreboot) {
if (Debug.isActive(RemoteDebug::INFO)) debugI_P(PSTR("Unable to connect to WiFi, rebooting because auto reboot is enabled"));
ESP.restart();
return;
}
WiFi_disconnect(5000);
return;
}
@ -1550,8 +1543,6 @@ void WiFi_connect() {
if (Debug.isActive(RemoteDebug::INFO)) debugI_P(PSTR("Connecting to WiFi network: %s"), wifi.ssid);
wifiReconnectCount++;
#if defined(ESP32)
if(strlen(wifi.hostname) > 0) {
WiFi.setHostname(wifi.hostname);