mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-12 00:16:42 +02:00
* improved stability (in comparison to 0.3.7)
* reset wifi AP timout once a client is detected * fix #26 wrong variable reset
This commit is contained in:
parent
37206847c5
commit
b485cb8151
7 changed files with 47 additions and 89 deletions
|
@ -57,13 +57,13 @@ void Main::setup(uint32_t timeout) {
|
|||
#endif
|
||||
|
||||
if(!startAp) {
|
||||
delay(5000);
|
||||
mTimestamp = getNtpTime();
|
||||
DPRINTLN("[NTP]: " + getDateTimeStr(getNtpTime()));
|
||||
}
|
||||
|
||||
mUpdater->setup(mWeb);
|
||||
mApActive = startAp;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,6 +83,11 @@ void Main::loop(void) {
|
|||
}
|
||||
else {
|
||||
if(millis() - mApLastTick > 10000) {
|
||||
uint8_t cnt = WiFi.softAPgetStationNum();
|
||||
if(cnt > 0) {
|
||||
DPRINTLN(String(cnt) + " clients connected, resetting AP timeout");
|
||||
mNextTryTs = (millis() + (WIFI_AP_ACTIVE_TIME * 1000));
|
||||
}
|
||||
mApLastTick = millis();
|
||||
DPRINTLN("AP will be closed in " + String((mNextTryTs - mApLastTick) / 1000) + " seconds");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue