kopia lustrzana https://github.com/SQ9MDD/TTGO-T-Beam-LoRa-APRS
if wifi is not available then after 30 seconds start AP
rodzic
bd6a99373c
commit
778996e0e2
|
@ -274,12 +274,17 @@ void handle_saveDeviceCfg(){
|
|||
if (!wifi_ssid.length()){
|
||||
WiFi.softAP(apSSID.c_str(), apPassword.c_str());
|
||||
} else {
|
||||
int retryWifi = 0;
|
||||
WiFi.begin(wifi_ssid.c_str(), wifi_password.length() ? wifi_password.c_str() : nullptr);
|
||||
Serial.println("Connecting to " + wifi_ssid);
|
||||
while (WiFi.status() != WL_CONNECTED) {
|
||||
Serial.print("Not connected: ");
|
||||
Serial.println((int)WiFi.status());
|
||||
vTaskDelay(500/portTICK_PERIOD_MS);
|
||||
retryWifi += 1;
|
||||
if (retryWifi > 60) {
|
||||
WiFi.softAP(apSSID.c_str(), apPassword.c_str());
|
||||
}
|
||||
}
|
||||
Serial.println("Connected. IP: " + WiFi.localIP().toString());
|
||||
#ifdef ENABLE_SYSLOG
|
||||
|
|
Ładowanie…
Reference in New Issue