From d4eb64ca7e036da0bc9beda08fbbd3ced6c596d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Tue, 13 Mar 2018 08:52:08 +0100 Subject: [PATCH] Update NtpClientLib and use NTP_TIMEOUT (#452) --- code/espurna/config/general.h | 1 + code/espurna/ntp.ino | 1 + code/platformio.ini | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 2f90bed4..a88dc42d 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -834,6 +834,7 @@ PROGMEM const char* const custom_reset_string[] = { #endif #define NTP_SERVER "pool.ntp.org" // Default NTP server +#define NTP_TIMEOUT 2000 // Set NTP request timeout to 2 seconds (issue #452) #define NTP_TIME_OFFSET 1 // Default timezone offset (GMT+1) #define NTP_DAY_LIGHT true // Enable daylight time saving by default #define NTP_SYNC_INTERVAL 60 // NTP initial check every minute diff --git a/code/espurna/ntp.ino b/code/espurna/ntp.ino index 37ea59fd..268c6294 100644 --- a/code/espurna/ntp.ino +++ b/code/espurna/ntp.ino @@ -36,6 +36,7 @@ void _ntpStart() { NTP.begin(getSetting("ntpServer", NTP_SERVER)); NTP.setInterval(NTP_SYNC_INTERVAL, NTP_UPDATE_INTERVAL); + NTP.setNTPTimeout(NTP_TIMEOUT); _ntpConfigure(); } diff --git a/code/platformio.ini b/code/platformio.ini index 33f79b95..daef112c 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -27,7 +27,7 @@ lib_deps = https://github.com/madpilot/mDNSResolver#4cfcda1 https://github.com/xoseperez/my92xx#3.0.1 https://bitbucket.org/xoseperez/nofuss.git#0.2.5 - https://github.com/xoseperez/NtpClient.git#b35e249 + https://github.com/gmag11/NtpClient.git#10ece38 OneWire PMS Library PZEM004T