Announcement

Collapse
No announcement yet.

4Duino NTP_Clock Program Issues for Senior Design

Collapse
X
 
  • 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 128.138.140.44 from what was originally 130.102.128.23. I have confirmed that both the SSID and Password are working (reverting back to general). Attaching the files as reference.
    Attached Files

  • #2
    Hello,

    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:

    Code:
    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,
    Michael

    Comment

    Working...
    X