From e172f66ec46e77c5cd9ff093c1bf6b322f07af15 Mon Sep 17 00:00:00 2001 From: Adrian Scillato <35405447+ascillato@users.noreply.github.com> Date: Thu, 10 May 2018 05:13:31 -0300 Subject: [PATCH] Fix KNX Reconnection Bug --- sonoff/support.ino | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sonoff/support.ino b/sonoff/support.ino index 020494d7b..7b5b2e472 100644 --- a/sonoff/support.ino +++ b/sonoff/support.ino @@ -35,6 +35,10 @@ byte oswatch_blocked_loop = 0; //void OsWatchTicker() ICACHE_RAM_ATTR; #endif // USE_WS2812_DMA +#ifdef USE_KNX +bool KNX_Started = false; +#endif // USE_KNX + void OsWatchTicker() { unsigned long t = millis(); @@ -822,13 +826,19 @@ void WifiCheck(uint8_t param) #endif // USE_EMULATION #endif // USE_WEBSERVER #ifdef USE_KNX - KNXStart(); -#endif // USE_KNX + if (!KNX_Started && Settings.flag.knx_enabled) { + KNXStart(); + KNX_Started = true; + } +#endif // USE_KNX } else { #if defined(USE_WEBSERVER) && defined(USE_EMULATION) UdpDisconnect(); #endif // USE_EMULATION mdns_begun = false; +#ifdef USE_KNX + KNX_Started = false; +#endif // USE_KNX } } }