Merge pull request #582 from mc-hamster/master

#407 - Fix for wifi does not come back up after power down
1.2-legacy
Jm Casler 2020-12-22 22:36:09 -08:00 zatwierdzone przez GitHub
commit 575b69c541
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 16 dodań i 7 usunięć

Wyświetl plik

@ -103,7 +103,7 @@ lib_deps =
# board_build.ldscript = linker/esp32.extram.bss.ld
lib_ignore = segger_rtt
platform_packages =
framework-arduinoespressif32@https://github.com/meshtastic/arduino-esp32.git#2814f110aa618429bdd9a0a2d6a93c55f29f87a6
framework-arduinoespressif32@https://github.com/meshtastic/arduino-esp32.git#c29e0bcde1b1b4a939dd7339dea0302d2d589ae7
; customize the partition table
; http://docs.platformio.org/en/latest/platforms/espressif32.html#partition-tables

Wyświetl plik

@ -40,12 +40,14 @@ bool isWifiAvailable()
const char *wifiName = radioConfig.preferences.wifi_ssid;
const char *wifiPsw = radioConfig.preferences.wifi_password;
// strcpy(radioConfig.preferences.wifi_ssid, "");
// strcpy(radioConfig.preferences.wifi_password, "");
// strcpy(radioConfig.preferences.wifi_ssid, "meshtastic");
// strcpy(radioConfig.preferences.wifi_password, "meshtastic!");
// strcpy(radioConfig.preferences.wifi_ssid, "meshtasticAdmin");
// strcpy(radioConfig.preferences.wifi_password, "12345678");
// radioConfig.preferences.wifi_ap_mode = true;
// radioConfig.preferences.wifi_ap_mode = false;
if (*wifiName && *wifiPsw) {
return 1;
@ -221,9 +223,16 @@ static void WiFiEvent(WiFiEvent_t event)
DEBUG_MSG("Obtained IP address: \n");
Serial.println(WiFi.localIP());
// Start web server
initWebServer();
initApiServer();
if (!APStartupComplete) {
// Start web server
DEBUG_MSG("... Starting network services\n");
initWebServer();
initApiServer();
APStartupComplete = true;
} else {
DEBUG_MSG("... Not starting network services (They're already running)\n");
}
break;
case SYSTEM_EVENT_STA_LOST_IP:
@ -253,7 +262,7 @@ static void WiFiEvent(WiFiEvent_t event)
APStartupComplete = true;
} else {
DEBUG_MSG("... Not starting network services\n");
DEBUG_MSG("... Not starting network services (They're already running)\n");
}
break;