mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-24 06:16:11 +02:00
implemented fixes of #483
This commit is contained in:
parent
67b9170fcf
commit
03080b1d7d
2 changed files with 6 additions and 4 deletions
|
@ -191,10 +191,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function tick() {
|
function tick() {
|
||||||
++tickCnt;
|
|
||||||
if(0 != ts)
|
if(0 != ts)
|
||||||
document.getElementById("date").innerHTML = (new Date((ts+tickCnt) * 1000)).toLocaleString('de-DE');
|
document.getElementById("date").innerHTML = (new Date((++ts) * 1000)).toLocaleString('de-DE');
|
||||||
if(tickCnt >= 10) {
|
if(++tickCnt >= 10) {
|
||||||
tickCnt = 0;
|
tickCnt = 0;
|
||||||
getAjax('/api/index', parse);
|
getAjax('/api/index', parse);
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,6 +221,7 @@ void ahoywifi::sendNTPpacket(IPAddress& address) {
|
||||||
if(mConnected) {
|
if(mConnected) {
|
||||||
mConnected = false;
|
mConnected = false;
|
||||||
mReconnect = true;
|
mReconnect = true;
|
||||||
|
mCnt = 0;
|
||||||
DPRINTLN(DBG_INFO, "[WiFi] Connection Lost");
|
DPRINTLN(DBG_INFO, "[WiFi] Connection Lost");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -239,13 +240,15 @@ void ahoywifi::sendNTPpacket(IPAddress& address) {
|
||||||
WiFi.begin();
|
WiFi.begin();
|
||||||
DBGPRINTLN(F("[WiFi] AP disabled"));
|
DBGPRINTLN(F("[WiFi] AP disabled"));
|
||||||
mDns.stop();
|
mDns.stop();
|
||||||
|
mReconnect = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SYSTEM_EVENT_STA_DISCONNECTED:
|
case SYSTEM_EVENT_STA_DISCONNECTED:
|
||||||
if(mConnected) {
|
if(mConnected) {
|
||||||
mConnected = false;
|
mConnected = false;
|
||||||
|
mReconnect = true;
|
||||||
|
mCnt = 0;
|
||||||
DPRINTLN(DBG_INFO, "[WiFi] Connection Lost");
|
DPRINTLN(DBG_INFO, "[WiFi] Connection Lost");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue