arduino-libraries / NTPClient

Connect to a NTP server
542 stars 372 forks source link

Increase time accuracy #102

Open WhymustIhaveaname opened 4 years ago

WhymustIhaveaname commented 4 years ago

I also add a demo program. I set an NTP Server in my LAN. In this network condition, the time error can be reduced to no more than plus-minus 10ms.

fededim commented 4 years ago

Any plan to fix and merge this PR soon ?

fededim commented 4 years ago

The build fails for these 2 errors:

/home/travis/build/arduino-libraries/NTPClient/examples/ntp_demo.ino: In function 'void connect_wifi(char*, char*)':
ntp_demo:28:25: error: 'class WiFiClass' has no member named 'channel'
     Serial.println(WiFi.channel());
                         ^
ntp_demo:30:25: error: 'class WiFiClass' has no member named 'getAutoReconnect'
     Serial.println(WiFi.getAutoReconnect());

Unluckily the functions channel and getAutoReconnect exist in WiFi, so it's strange that gives such errors. @Testato can you do a check and let us know ?

WhymustIhaveaname commented 4 years ago

I have tested these codes on my esp32. It works very well. It has run for half a month without a bug or crash.

These prints are not important. They are just showing what information one can get from WiFi.

fededim commented 4 years ago

According to log the build is done with platform esp8266, which is a little bit different from esp32. I hope that all Arduino library functions are present in every supported platform.

wujiang commented 3 years ago

Any plans to get this merged?

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.