ezTime: error connecting to pool.ntp.org

hi, trying to get this to work but everthing i have tried leaves me with this.

ezTime debug level set to INFO
Waiting for WiFi ... Querying pool.ntp.org ... ERROR: No network
connected
Waiting for time sync
Querying pool.ntp.org ... ERROR: Timeout
Querying pool.ntp.org ... ERROR: Timeout

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 22 (5 by maintainers)

Most upvoted comments

Hi. I’m using ESP8266WiFi and ezTime. With DHCP everything works fine ! When I use static IP, also with same IP address I’ve got from DHCP, I get timeout from pool.ntp.org and other NTP servers with error code : [hostByName] request IP for: time.cloudflare.com [hostByName] Host: time.cloudflare.com lookup error: -6! In both cases network itself works without problems. Any idea ? Erik

What code are you using to set the static IP address? It seems the DNS is not being set correctly so it can’t resolve an IP for that hostname.

Thx, Monarchit. That was my idea too, but I don’t find right procedure for DNS setting… I tested meanwhile “WiFi.hostByName(ntpServerName, timeServer)” but without success Erik

Try to follow the instructions on this link to set a fixed IP address and the rest of the options. The example shows:

IPAddress local_IP(192, 168, 1, 184);
IPAddress gateway(192, 168, 1, 1);

IPAddress subnet(255, 255, 0, 0);
IPAddress primaryDNS(8, 8, 8, 8);
IPAddress secondaryDNS(8, 8, 4, 4);

Based on this you can either use your router’s IP address as a primary DNS or Google’s public DNS listed in the example. I believe you are missing the rest of the configuration.

WOW ! I forgot to extend the config call …

WiFi.config(ip, gateway, subnet, primaryDNS, secondaryDNS);

Not seen in any example… Because the eztime needs a secondaryDNS I was running into another problem.

Now it works : 18:21:40.976 -> [hostByName] request IP for: pool.ntp.org 18:21:40.976 -> [hostByName] Host: pool.ntp.org IP: 66.228.58.20 18:21:41.120 -> [hostByName] request IP for: timezoned.rop.nl 18:21:41.163 -> [hostByName] Host: timezoned.rop.nl IP: 84.200.21.154

Thx a lot !

Erik

Hi!

This solved my problem too. ezTime needs primary and secondary DNS the works fine in case when useing WiFi.Config() function. In my sketch it looks: WiFi.config(IPAddress(192, 168, 1, 130), IPAddress(192, 168, 1, 1), IPAddress(255, 255, 255, 0), IPAddress(8, 8, 8, 8), IPAddress(8, 8, 4, 4));

And after this for me started working the NTC library (NTPClient.h) as well.

G.