diff --git a/sonoff/support.ino b/sonoff/support.ino
index f9269de89..6b770a6c7 100644
--- a/sonoff/support.ino
+++ b/sonoff/support.ino
@@ -17,6 +17,9 @@
along with this program. If not, see .
*/
+IPAddress syslog_host_addr; // Syslog host IP address
+unsigned long syslog_host_refresh = 0;
+
/*********************************************************************************************\
* Watchdog extension (https://github.com/esp8266/Arduino/issues/1532)
\*********************************************************************************************/
@@ -1153,8 +1156,12 @@ void syslog()
// Destroys log_data
char syslog_preamble[64]; // Hostname + Id
- yield(); // Fix possible UDP syslog blocking
+ if ((static_cast(syslog_host_addr) == 0) || ((millis() - syslog_host_refresh) > 60000)) {
+ WiFi.hostByName(sysCfg.syslog_host, syslog_host_addr);
+ syslog_host_refresh = millis();
+ }
if (portUDP.beginPacket(sysCfg.syslog_host, sysCfg.syslog_port)) {
+// if (portUDP.beginPacket(sysCfg.syslog_host, sysCfg.syslog_port)) {
snprintf_P(syslog_preamble, sizeof(syslog_preamble), PSTR("%s ESP-"), Hostname);
memmove(log_data + strlen(syslog_preamble), log_data, sizeof(log_data) - strlen(syslog_preamble));
log_data[sizeof(log_data) -1] = '\0';