Fixed connection check rules

This commit is contained in:
Kai Lauterbach 2022-09-12 23:07:05 +02:00
parent 6f7cb3352f
commit 0cb4212fc8
1 changed files with 7 additions and 1 deletions

View File

@ -174,7 +174,7 @@ void initSensors()
void wifiConnectionCheck()
{
if ((wifi_check_interval_counter + WIFI_CHECK_INTERVAL_MS) > millis() or WiFi.status() == WL_CONNECTED)
if ((wifi_check_interval_counter + WIFI_CHECK_INTERVAL_MS) > millis())
{
// if check interval is not exceeded abort check
return;
@ -182,6 +182,12 @@ void wifiConnectionCheck()
wifi_check_interval_counter = millis();
if (WiFi.status() == WL_CONNECTED)
{
// if we are connected
return;
}
debug("no connection or time to check " + String(WiFi.status() == WL_CONNECTED));
wifiConnect();