Hi Robert,
I am trying to synchronize BBB clock to NTP time server. The connection to internet is through PPP cellular modem. I can ping any host, such as www.google.com. The c program works some time and fails other time when I run on BBBw, but it works all the time on Debian VirtualBox. When it fails, it fails at gethostbyname () call:
#ifdef GET_HOST_BY_NAME
m_iTries = 0;
server = gethostbyname(host_name);
while ((server == NULL) && m_iTries ++ < 5 ) { //5 seconds
//at_debug(“ERROR no such host=%d,%d\r\n”, NTP_ERR_GET_HOST_BY_NAME, h_errno);
usleep(1000000); //1000 ms
}
if (server == NULL) {
at_debug(“ERROR no such host=%d,%d\r\n”, NTP_ERR_GET_HOST_BY_NAME, h_errno);
return NTP_ERR_GET_HOST_BY_NAME;
}
#endif //GET_HOST_BY_NAME
I added 5 tries as suggested by the following link:
But it still fails, some times.
Any suggestions and hints that may resolve this problem?
Thank You,
David