This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello Everyone,
I am trying to implement sntp for RTC read from ntp server (time.windows.com) using lwip 2. But it is not giving me callback (i.e. sntp_recv()) when time read from ntp server.
Though I am getting callback for dns server in which i am initialising sntp.
Check my piece of code for the same.
//get ip of ntp server
dns_gethostbyname((const char *)"time.windows.com",&SNTP_ipaddr,NTP_DNSServerFound, 0);
//DNS server callback function
static void NTP_DNSServerFound(const char *pcName, struct ip_addr *psIPAddr, void *vpArg)
{
if(psIPAddr != NULL)
{
sntp_setoperatingmode(SNTP_OPMODE_POLL);
sntp_setserver(0, psIPAddr);
sntp_init();
}
}
Hi,
We don't have any SNTP example in our TivaWare library using LwIP stack. However, I found these two links that may be helpful with examples including sntp.
http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git/tree/examples
https://techoverflow.net/2014/11/01/using-the-lwip-sntp-client-with-chibios/