NTPClient icon indicating copy to clipboard operation
NTPClient copied to clipboard

NTPClient::sendNTPPacket() does not check whether this->_udp->beginPacket actually began.

Open JonathanJamesStewart opened this issue 3 years ago • 2 comments

https://github.com/arduino-libraries/NTPClient/blob/master/NTPClient.cpp#L200

When this->_udp->beginPacket(...) fails because of DNS lookup failure or some other reason this causes the device to panic when it tries to read the result.

JonathanJamesStewart avatar Dec 31 '21 16:12 JonathanJamesStewart

Pull request #177 would fix this.

MHotchin avatar Oct 01 '22 06:10 MHotchin

Got the same issue on a Teensy 4.1. First call to update() or forceUpdate() is OK but next always fail if the NTP pool server is provided as a name. If the pool server is provided as a IP number, it always works. Seems that DNS does not resolve IP after the first access.

JXAS avatar Jul 21 '24 09:07 JXAS