Skip to content

NTP library does not follow policy #1

Description

@Xrnah

Policy:

  • Use a non-blocking approach (e.g., sends a request and checks for a reply later without waiting).
  • Has short, well-defined timeout on network calls.

Issue
NTP.cpp

while (now < 8 * 3600 * 2) {
  delay(500);
  ...
}
  • Blocks indefinitely if NTP fails (violates policy).
  • delay(500) blocks the main loop.
  • No timeout → can hang forever.

This currently works as a blocking function to sync time before MQTT kicks in

To do:

  • use SNTP API as real-time guarantee

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions