fix issues wifi fallback

This commit is contained in:
2023-04-16 13:36:56 +02:00
parent 0e02abd9c9
commit 1fde3347c8
8 changed files with 36 additions and 109 deletions

View File

@@ -36,6 +36,10 @@ bool OtaProcess_class::initialize(void)
m_ssid = WiFi.SSID(i);
m_psk = tmppsk;
}
else{
m_ssid = SECRET_SSID;
m_psk = SECRET_PASS;
}
log_i("[%d] %s %s (%d) [%s]", i, WiFi.SSID(i), (WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : "*", WiFi.RSSI(i), (tmppsk != "")? "OK": "Not congigured");
}
}
@@ -112,7 +116,7 @@ bool OtaProcess_class::initialize(void)
.onEnd([]()
{ log_i("End"); ota.m_otaState = otaDone; })
.onProgress([](unsigned int progress, unsigned int total)
{ log_i("Progress: %u%%\r", (progress / (total / 100))); ota.m_otaState = otaBusy; })
{ log_i("Progress: %u%%\r", (progress / (total / 100))); ota.m_otaState = otaBusy; PowerKeepAlive();})
.onError([](ota_error_t error)
{
log_e("Error[%u]: ", error);
@@ -130,7 +134,7 @@ bool OtaProcess_class::initialize(void)
{
log_i("Otastate = initialize(start)");
ArduinoOTA.begin();
log_i("Ota ready, IPaddress:%s", WiFi.localIP());
log_i("Ota ready, IPaddress:%s", WiFi.localIP().toString());
m_otaState = otaInitDone;
setLedBlink(true);
}