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

Feature request: NTP Client #33

Open
riban-bw opened this issue Feb 21, 2017 · 2 comments
Open

Feature request: NTP Client #33

riban-bw opened this issue Feb 21, 2017 · 2 comments

Comments

@riban-bw
Copy link

I can not see a way to implement a NTP client. NTP client is not a documented feature and the UDP implementation only supports string handling. The NTP message consists of a 384 bit or 48 byte data structure containing 17 fields which require raw data, not string. There is a nice (simple) guide to implementing a NTP client here: https://lettier.github.io/posts/2016-04-26-lets-make-a-ntp-client-in-c.html.

@riban-bw
Copy link
Author

Or an implementation on the Arduino playground: http://playground.arduino.cc/Code/NTPclient which is fairly simple. Neither of these calculate the loop delay (the Arduino version assumes 50ms) but for most purposes, getting one second accuracy is fine. Even the rounding done in the Arduino code may be excessively accurate for most purposes.

@riban-bw
Copy link
Author

I have now found that SNTP is already implemented and an enhancement planned http://www.esp8266.com/viewtopic.php?f=43&t=11510&p=54024&hilit=ntp#p54024. It would be advantageous for this to be documented. I was perplexed when the device magically knew the time. It may also be advantageous to be able to set the time manually in case Internet is not available. Also, able to get the unix timestamp rather than just human readable format, so that program can easily compare values, etc.

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

1 participant