I'm facing a strange issue with NTPClient library, for some months it worked without problems.
I built a small solar powered weather station equipped with some sensors and an ESP8266 that after having read data from sensors transmits them to another ESP8266 (on my desk) that shows those data on a LCD screen.
After having transmitted all the data, the "weather station" goes into deep sleep for 10 minutes.
The ESP8266 that shows data from the weather station also shows date and time of the last update and the current room temperature/humidity (read every 30 secs).
To read date and time I'm using the NTPClient library, the issue appears when the "display unit" boots.
At the "first" call of the "loop" into the sketch, it reads the current date and time and shows it.
So the first time only the "date" part is wrong, the "time" part is always correct.
Specifically the "date" part has always the year=5378599 (day and month are wrong too) but when the "display unit" receives data from the "weather unit", a refresh of date and time is done and this time the date is correct.
The code used is the same of the various examples that can be found googling.
I tried also to put an "if (year>2100)" to call "timeClient.update()" again but the result is the same.
Any idea why only the first time it calls "timeClient.update" the date part is wrong?
Thank you, regards.
Roberto