Closed Schawen closed 2 years ago
Hello. This information is not enough to diagnose your issue. Please add more information like: platform you are developing in (ESP32, ESP8266), Arduino core that you are using, version of this library that you have included.
If possible, add a link to your code so that we can try to reproduce this error.
Sorry, here are the missing informations (also added to the top entry) :
PLATFORM: Espressif 8266 (3.2.0) > WeMos D1 mini Pro
HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash
PACKAGES:
Library version: gmag11/ESPNtpClient@^0.2.5
As a workaround - to get the project compiled - I changed line 557 from
tm* local_tm = localtime (&moment.tv_usec);
to
tm* local_tm = localtime (&moment.tv_sec);
in function:
char* getTimeStr (timeval moment) {
//tm* local_tm = localtime (&moment.tv_usec);
tm* local_tm = localtime (&moment.tv_sec);
size_t index = strftime (strBuffer, sizeof (strBuffer), "%H:%M:%S", local_tm);
snprintf (strBuffer + index, sizeof (strBuffer) - index, ".%06ld", moment.tv_usec);
return strBuffer;
}
where tv_usec and tv_sec are defined in
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* and microseconds */
Hello,
I've reformatted your messages and realized that it was a bug. Your solution is correct. I've updated it on dev branch, in https://github.com/gmag11/ESPNtpClient/commit/06a321cead8e2a0cf163b67c7f855fc1e3020be3
Thank you!
I tried to compile an older project and experienced several problems with NTPClientLib. I now replaced with the recommended ESPNtpClient library but get the following errors:
Where is the Problem?
PLATFORM: Espressif 8266 (3.2.0) > WeMos D1 mini Pro HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash
PACKAGES:
Library version: gmag11/ESPNtpClient@^0.2.5