Skip to content

Add handling for NTP server returning 0 #193

Closed as not planned
Closed as not planned
@frankB415

Description

@frankB415

I had some issues with wrong date as i used that lib on an ESP32. After debugging i found, that the NTP server sends from time to time "0" as response.

So I added 3 lines to handle that issue.

NTPClient.cpp:113:

  unsigned long secsSince1900 = highWord << 16 | lowWord;

  if (secsSince1900 == 0 ) { // failure value!!
    return false; 
  }

  this->_currentEpoc = secsSince1900 - SEVENZYYEARS;

Metadata

Metadata

Assignees

Labels

conclusion: duplicateHas already been submittedtopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions