mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 10:50:40 +00:00
Merge pull request #582 from mc-hamster/master
#407 - Fix for wifi does not come back up after power down
This commit is contained in:
commit
575b69c541
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user