-->
Page 1 of 1

Sending request to NTP server

PostPosted: Sun Aug 28, 2016 7:52 am
by Markymarc35
Hi all,

I was wondering if any of you would have an example of sending the 48 bytes command to a ntp server to get the time back.
I get that a can send a string to an udp port but for the ntp i need to send 48 bytes with the first one set to 35.

any help would be appreciated.

Re: Sending request to NTP server

PostPosted: Sun Aug 28, 2016 12:50 pm
by Orcanbull
There is an Arduino example for this,

Re: Sending request to NTP server

PostPosted: Sun Aug 28, 2016 2:42 pm
by russm
Look at the projects I've posted. The panel display clock uses NTP and breaks down the time from 24 hour format. Also, the Aquarium light timer is similar.

Re: Sending request to NTP server

PostPosted: Sun Aug 28, 2016 5:30 pm
by Markymarc35
Thanks for the suggestion russm but i would like to connect to the ntp server that i use internally and right now it is not possible to set the server in the timesetup() so i would need to do it manually.

Although i have figured out how to modify the code of the timesetup() function to add the server but it is very preliminary and untested.