fix wifi disable
This commit is contained in:
parent
db9cd46ab5
commit
af85295bb2
@ -47,9 +47,7 @@ void onWifiConnected() {
|
|||||||
Serial.println("Wifi connected event");
|
Serial.println("Wifi connected event");
|
||||||
Wifi::printStatus();
|
Wifi::printStatus();
|
||||||
Ota::tLoop.enable();
|
Ota::tLoop.enable();
|
||||||
#if !WIFI_ALWAYS_ON
|
|
||||||
if (!Ir::avrOn) tCheckWifi.restartDelayed();
|
if (!Ir::avrOn) tCheckWifi.restartDelayed();
|
||||||
#endif
|
|
||||||
Mqtt::client.connect();
|
Mqtt::client.connect();
|
||||||
if (time_t newTime = Ntp::updateTime()) {
|
if (time_t newTime = Ntp::updateTime()) {
|
||||||
Serial.println(asctime(localtime(&newTime)));
|
Serial.println(asctime(localtime(&newTime)));
|
||||||
@ -57,10 +55,12 @@ void onWifiConnected() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void checkWifiCallback() {
|
void checkWifiCallback() {
|
||||||
|
#if !WIFI_ALWAYS_ON
|
||||||
Serial.println("Wifi connection timed out");
|
Serial.println("Wifi connection timed out");
|
||||||
Mqtt::client.disconnect();
|
Mqtt::client.disconnect();
|
||||||
Ota::tLoop.disable();
|
Ota::tLoop.disable();
|
||||||
Wifi::disconnect();
|
Wifi::disconnect();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ICACHE_RAM_ATTR void onButtonPressed() {
|
ICACHE_RAM_ATTR void onButtonPressed() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user