mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2025-12-06 07:42:00 +01:00
wifi task fixed
This commit is contained in:
parent
fd1034a3a0
commit
11b392b309
|
|
@ -31,8 +31,7 @@ bool WifiTask::setup(System &system) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Configuration::Wifi::AP ap : system.getUserConfig()->wifi.APs) {
|
for (Configuration::Wifi::AP ap : system.getUserConfig()->wifi.APs) {
|
||||||
logPrintD("Looking for AP: ");
|
system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, getName(), "Looking for AP: %s", ap.SSID);
|
||||||
logPrintlnD(ap.SSID);
|
|
||||||
_wiFiMulti.addAP(ap.SSID.c_str(), ap.password.c_str());
|
_wiFiMulti.addAP(ap.SSID.c_str(), ap.password.c_str());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -42,14 +41,13 @@ bool WifiTask::loop(System &system) {
|
||||||
const uint8_t wifi_status = _wiFiMulti.run();
|
const uint8_t wifi_status = _wiFiMulti.run();
|
||||||
if (wifi_status != WL_CONNECTED) {
|
if (wifi_status != WL_CONNECTED) {
|
||||||
system.connectedViaWifiEth(false);
|
system.connectedViaWifiEth(false);
|
||||||
logPrintlnE("WiFi not connected!");
|
system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_ERROR, getName(), "WiFi not connected!");
|
||||||
_oldWifiStatus = wifi_status;
|
_oldWifiStatus = wifi_status;
|
||||||
_stateInfo = "WiFi not connected";
|
_stateInfo = "WiFi not connected";
|
||||||
_state = Error;
|
_state = Error;
|
||||||
return false;
|
return false;
|
||||||
} else if (wifi_status != _oldWifiStatus) {
|
} else if (wifi_status != _oldWifiStatus) {
|
||||||
logPrintD("IP address: ");
|
system.getLogger().log(logging::LoggerLevel::LOGGER_LEVEL_DEBUG, getName(), "IP address: %s", WiFi.localIP().toString());
|
||||||
logPrintlnD(WiFi.localIP().toString());
|
|
||||||
_oldWifiStatus = wifi_status;
|
_oldWifiStatus = wifi_status;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue