cancel
Showing results for 
Search instead for 
Did you mean: 

NTP/SNTP client on LAN

arge
Associate III
Posted on August 06, 2013 at 16:45

I dont know about NTP i couldnt find anything in LWIP stack in 107/207 libraries. Should i write my own NTP protocol or where can i find it from? is it related to rtc timestamp? 

#ntp-in-stm32
2 REPLIES 2
Posted on August 06, 2013 at 16:57

Getting a time packet from an NTP server is a matter of sending an empty NTP packet (ntp_message.flags = 0x0B) to the server, and getting the current time in the response. This should be quite adequate for sub-second accuracy, and you ability to program the RTC to maintain it.

So if you understand how to send and receive a UDP packet to port 123, in your chosen stack implementation, you should be golden.

Pretty sure everything you need to know about the NTP protocol is in an RFC, or a search away.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
arge
Associate III
Posted on August 07, 2013 at 08:21

Thank you for information. So i have to look protocol and maybe i need to find sample C codes. Is there anything we may fail in LWIP or RTC implementation?