diff --git a/cores/esp32/esp32-hal-time.c b/cores/esp32/esp32-hal-time.c index e64c764b..5647f1f5 100644 --- a/cores/esp32/esp32-hal-time.c +++ b/cores/esp32/esp32-hal-time.c @@ -14,6 +14,7 @@ #include "esp32-hal.h" #include "lwip/apps/sntp.h" +#include "tcpip_adapter.h" static void setTimeZone(long offset, int daylight) { @@ -45,6 +46,7 @@ static void setTimeZone(long offset, int daylight) * */ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char* server1, const char* server2, const char* server3) { + tcpip_adapter_init(); // Should not hurt anything if already inited if(sntp_enabled()){ sntp_stop(); } @@ -62,6 +64,7 @@ void configTime(long gmtOffset_sec, int daylightOffset_sec, const char* server1, * */ void configTzTime(const char* tz, const char* server1, const char* server2, const char* server3) { + tcpip_adapter_init(); // Should not hurt anything if already inited if(sntp_enabled()){ sntp_stop(); }