No announcement yet.

4Duino NTP_Clock Program Issues for Senior Design

  • Filter
  • Time
  • Show
Clear All
new posts

  • 4Duino NTP_Clock Program Issues for Senior Design

    Hello, recently I have made modifications to the NTP_Clock example program provided by 4D Systems and have run into the issue where the program gets the time set by the user (I set the value that goes into NTPTime function to 0) and displays the current GMT time. However, sometimes the time displayed changes to a different offset. I removed the lines within the void setup() and void loop() routines where it draws the clock and all of the clock functions as those are not necessary. Could this be a server issue? I switched to the address from what was originally I have confirmed that both the SSID and Password are working (reverting back to general). Attaching the files as reference.
    Attached Files

  • #2

    It could indeed be a server issue.

    Please also note that some NTP servers have a specification on how often you should poll the information from them.

    This site specifically states that:

    All users should ensure that their software NEVER queries a server more frequently than once every 4 seconds
    In that case, you might also need to change these parts:

    if (millis() > NTPSyncTime)
        NTPSyncTime = millis() + 1000; // change this to 5000 for 5 secs
        epoch = GetTime();
      if (millis() > NTPCalcTime)
        NTPCalcTime = millis() + 1000; // change this as well
    I hope this helps.

    Best regards,