Try to (re)connect to WiFi every 5 minutes. (Only when not playing at the moment.)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
#include "controller.h"
|
||||
#include "main.h"
|
||||
#include "spi_master.h"
|
||||
#include "config.h"
|
||||
#include "playlist.h"
|
||||
@ -53,12 +54,18 @@ void Controller::loop() {
|
||||
}
|
||||
|
||||
#ifdef OTA_UPDATE_URL
|
||||
if (!player->is_playing() && _last_update_check_at<millis() && _last_update_check_at + OTA_CHECK_INTERVAL < millis()) {
|
||||
if (!player->is_playing() && _last_update_check_at < now && _last_update_check_at + OTA_CHECK_INTERVAL < now) {
|
||||
Updater::run();
|
||||
} else {
|
||||
_last_update_check_at = millis();
|
||||
_last_update_check_at = now;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!player->is_playing() && !WiFi.isConnected() && _last_wifi_try_at < now && _last_wifi_try_at + 5*60*1000 < now) {
|
||||
wifi_connect();
|
||||
} else {
|
||||
_last_wifi_try_at = now;
|
||||
}
|
||||
TRACE("Controller::loop() done.\n");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user