Re: NTP Client Example (not working!)
Posted: Fri Apr 10, 2015 3:11 am
OK. I have some findings... i'll post everything in the UDP bug thread where others will stand a better chance of seeing it.
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
dnts wrote:Hey.. sorry for the distasteful comment I've made in my previous reply.. duh..
dnts wrote:I then checked the referenced bug report and spent the evening crashing my ESP8266 by sending UDP packets. I suspect the root cause is too many instances of UDP opening with differnt port numbers that increment from 4097 (dunno why it starts there) until the heap is exhausted and the watchdog kicks in. Anyway, seems like Udp.begin(port number) does not control which port the UDP packet transmits from hence preventing the NTP reply from reaching the correct port on it's way back to the ESP8266. It MUST be the same port number. Now - I wonder if I can force Udp to listen to that arbitrary egress port (4097) with the Udp.begin.. guess not.
BUG.
igrr wrote:Thanks for bringing this up again, Gerard, and thanks @dnts for your findings. One-line fix, actually, so stupid of me
I've added NTP Client sample to the package.