fixed WiFi-Client Feature
This commit is contained in:
parent
aeab80d5a8
commit
e344977b8f
@ -27,7 +27,7 @@ upload_speed = 921600
|
|||||||
build_flags=
|
build_flags=
|
||||||
!python git_rev_macro.py
|
!python git_rev_macro.py
|
||||||
-DATOMIC_FS_UPDATE
|
-DATOMIC_FS_UPDATE
|
||||||
;-DFEATURE_ENABLE_WIFI_CLIENT
|
-DFEATURE_ENABLE_WIFI_CLIENT
|
||||||
;-DFEATURE_ENABLE_LORA
|
;-DFEATURE_ENABLE_LORA
|
||||||
;-DCAPTIVE
|
;-DCAPTIVE
|
||||||
-DWIFI_AP_IP_GW=10,0,1,1
|
-DWIFI_AP_IP_GW=10,0,1,1
|
||||||
|
@ -134,7 +134,7 @@ void setup()
|
|||||||
WiFi.mode(WIFI_STA);
|
WiFi.mode(WIFI_STA);
|
||||||
WiFi.setHostname(globals.DeviceName);
|
WiFi.setHostname(globals.DeviceName);
|
||||||
wifiMulti.addAP(QUOTE(WIFI_SSID_CLIENT), QUOTE(WIFI_PASSWORD_CLIENT));
|
wifiMulti.addAP(QUOTE(WIFI_SSID_CLIENT), QUOTE(WIFI_PASSWORD_CLIENT));
|
||||||
WiFiMaintainConnectionTicker.start();
|
tmrWiFiMaintainConnection.start();
|
||||||
#else
|
#else
|
||||||
WiFi.mode(WIFI_OFF);
|
WiFi.mode(WIFI_OFF);
|
||||||
#endif
|
#endif
|
||||||
@ -231,7 +231,7 @@ void loop()
|
|||||||
#ifdef CAPTIVE
|
#ifdef CAPTIVE
|
||||||
dnsServer.processNextRequest();
|
dnsServer.processNextRequest();
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIFI_CLIENT
|
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
||||||
tmrWiFiMaintainConnection.update();
|
tmrWiFiMaintainConnection.update();
|
||||||
#endif
|
#endif
|
||||||
if (globals.systemStatus == sysStat_Shutdown)
|
if (globals.systemStatus == sysStat_Shutdown)
|
||||||
@ -446,7 +446,7 @@ void tmrCallback_WiFiMaintainConnection()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debugV("WiFi not connected! - Start AP");
|
Debug_pushMessage("WiFi not connected! - Start AP");
|
||||||
toggleWiFiAP();
|
toggleWiFiAP();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -460,7 +460,7 @@ void toggleWiFiAP(boolean shutdown)
|
|||||||
WiFi.mode(WIFI_OFF);
|
WiFi.mode(WIFI_OFF);
|
||||||
Serial.println("WiFi turned off");
|
Serial.println("WiFi turned off");
|
||||||
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
||||||
WiFiMaintainConnectionTicker.stop();
|
tmrWiFiMaintainConnection.stop();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -469,7 +469,7 @@ void toggleWiFiAP(boolean shutdown)
|
|||||||
WiFi.softAPConfig(IPAddress(WIFI_AP_IP_GW), IPAddress(WIFI_AP_IP_GW), IPAddress(255, 255, 255, 0));
|
WiFi.softAPConfig(IPAddress(WIFI_AP_IP_GW), IPAddress(WIFI_AP_IP_GW), IPAddress(255, 255, 255, 0));
|
||||||
WiFi.softAP(QUOTE(WIFI_AP_SSID), QUOTE(WIFI_AP_PASSWORD));
|
WiFi.softAP(QUOTE(WIFI_AP_SSID), QUOTE(WIFI_AP_PASSWORD));
|
||||||
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
||||||
WiFiMaintainConnectionTicker.stop();
|
tmrWiFiMaintainConnection.stop();
|
||||||
Serial.println("WiFi AP started, stopped Maintain-Timer");
|
Serial.println("WiFi AP started, stopped Maintain-Timer");
|
||||||
#else
|
#else
|
||||||
Serial.println("WiFi AP started");
|
Serial.println("WiFi AP started");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user