DNS resolution for UDP?
Posted:
Wed Jul 15, 2015 5:29 pm
by smily77
I like to display the time with my ESP8266 using the NTP-Time. There are some examples in the forum so this isn't a problem with the Arduino IDE. But all examples uses a fixed IP while I would like to use the ntp server pool but this require to resolve the DNS (0.ch.pool.ntp.org in my case).
How can I do that?
Re: DNS resolution for UDP?
Posted:
Thu Jul 16, 2015 10:23 am
by martinayotte
If you look at the example esp8266/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino, you will see that it is using WiFi.hostByName(ntpServerName, timeServerIP) function to get the IP of the NTP server and then calling sendNTPpacket(timeServerIP) provided in the sketch followed by a udp.parsePacket()
Re: DNS resolution for UDP?
Posted:
Fri Jul 17, 2015 3:08 am
by smily77
Thanks a lot
I was looking in an old version