diff --git a/README.md b/README.md index 4845199a5..587a67d18 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ People helping to keep the show on the road: - Gerhard Mutz for his SGP30 and Sunrise/Sunset driver - Nuno Ferreira for his HC-SR04 driver - Adrian Scillato for his (security)fixes and implementing and maintaining KNX +- Gennaro Tortone for his Eastron SDM120 driver - Raymond Mouthaan for managing Wemos Wiki information - Norbert Richter, Frogmore42 and Jason2866 for providing many issue answers - Many more providing Tips, Pocs or PRs diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 5e74de8e6..bfb2b08c2 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -6,6 +6,7 @@ * Fix several timer data input and output errors (#2597, #2620) * Fix KNX config error (#2628) * Fix sensor MHZ-19 vanishing data over time (#2659) + * Fix KNX reconnection issue (#2679) * Add Portuguese in Brazil language file * Add rule state test for On/Off in addition to 0/1 (#2613) * Add hardware serial option to MHZ-19 sensor (#2659) diff --git a/sonoff/support.ino b/sonoff/support.ino index d17776325..e56d7e540 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,11 +826,20 @@ void WifiCheck(uint8_t param) } #endif // USE_EMULATION #endif // USE_WEBSERVER +#ifdef 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 } } } diff --git a/sonoff/webserver.ino b/sonoff/webserver.ino index 7fe81701c..3c74d346a 100644 --- a/sonoff/webserver.ino +++ b/sonoff/webserver.ino @@ -392,9 +392,6 @@ void StartWebserver(int type, IPAddress ipweb) } #endif // USE_EMULATION WebServer->onNotFound(HandleNotFound); -#ifdef USE_KNX - KNXStart(); -#endif // USE_KNX } reset_web_log_flag = 0; WebServer->begin(); // Web server start