Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESPPerfectTime.cpp:7:10: fatal error: sntp-lwip2.h: No such file or directory #8979

Closed
tutoduino opened this issue Aug 23, 2023 · 2 comments
Closed

Comments

@tutoduino
Copy link

I face a compilation issue using ESPPerfectTime on Generic ESP8266 Module on Arduino IDE

#include <ESPPerfectTime.h>

/home/tutoduino/Arduino/libraries/ESPPerfectTime/src/ESPPerfectTime.cpp:7:10: fatal error: sntp-lwip2.h: No such file or directory
7 | #include <sntp-lwip2.h>
| ^~~~~~~~~~~~~~

@enjoyneering
Copy link

Arduino esp8266 can do this right out of the box, without any additional libraries - NTP-TZ-DST.ino

@mcspr
Copy link
Collaborator

mcspr commented Sep 14, 2023

Right, see above

#7595 (40eb574) removed the file in question.

hunamizawa/ESPPerfectTime#4 is the upstream issue

Patch should solve the build issue (but idk whether it works :), lib can skip some of the platform-specific code

diff --git a/src/ESPPerfectTime.cpp b/src/ESPPerfectTime.cpp
index edd65da..cc2dfee 100644
--- a/src/ESPPerfectTime.cpp
+++ b/src/ESPPerfectTime.cpp
@@ -3,9 +3,6 @@
 #include <stdlib.h>
 #include <sys/time.h>
 #include <time.h>
-#ifdef ESP8266
-#include <sntp-lwip2.h>
-#endif // ESP8266
 #ifdef ESP32
 #include <esp32-hal.h>
 #endif // ESP32
diff --git a/src/sntp_pt.cpp b/src/sntp_pt.cpp
index ffc1c02..acb5198 100644
--- a/src/sntp_pt.cpp
+++ b/src/sntp_pt.cpp
@@ -43,9 +43,6 @@
 #include <lwip/ip_addr.h>
 #include <lwip/timeouts.h>
 #include <lwip/udp.h>
-#ifdef ESP8266
-#include <sntp-lwip2.h>
-#endif // ESP8266
 #include "ESPPerfectTime.h"
 #include <sntp_pt.h>

@@ -851,4 +848,4 @@ set_update_delay(uint32 ms) {

 } // namespace pftime_sntp

-#undef PFTIME_DEBUG_LOG
\ No newline at end of file
+#undef PFTIME_DEBUG_LOG

@mcspr mcspr closed this as completed Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants