adccommunitymod (AutomationDirect) asked a question.

P1AM-100 RTC NTP Sync Example

Created Date: March 27,2020

Created By: FACTS_ENG_TEAM1

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

Purpose: This example shows how to re-synchronize your P1AM-100 internal RTC with Google's NTP server at a regular interval. Time is printed every second on the serial monitor and the NTP is checked every day by default in the example. Both of these can easily be changed for your application. All you need for this example is a P1AM-100 and a P1AM-ETH. Dependencies: Required Library which needs to be installed. R TCZero - https://github.com/arduino-libraries/RTCZero also available in the Library Manager Check out the code here: https://github.com/AutomationDirect/P1AM-Examples/blob/master/P1AM-100_RTC_NTP_SYNC/P1AM-100_RTC_NTP_SYNC.ino


  • adccommunitymod (AutomationDirect)

    Created Date: March 27,2020

    Created by: FACTS_ENG_TEAM1

    Purpose: This example shows how to re-synchronize your P1AM-100 internal RTC with Google's NTP server at a regular interval. Time is printed every second on the serial monitor and the NTP is checked every day by default in the example. Both of these can easily be changed for your application.

    All you need for this example is a P1AM-100 and a P1AM-ETH.

    Dependencies: Required Library which needs to be installed.

    R TCZero - https://github.com/arduino-libraries/RTCZero also available in the Library Manager

    Check out the code here:

    https://github.com/AutomationDirect/P1AM-Examples/blob/master/P1AM-100_RTC_NTP_SYNC/P1AM-100_RTC_NTP_SYNC.ino

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: March 28,2020

    Created by: SeaDragon

    I noticed that there were some delay() statements in there, presumably to wait until polling a response from the NIC - do you think Automation Direct can release versions of these libraries that would use asynchronous callbacks so that we 're not blocking task execution?

  • adccommunitymod (AutomationDirect)

    Created Date: March 30,2020

    Created by: FACTS_ENG_TEAM1

    The delays from this example were inherited from the programs they were adapted from. The default resync period is once per day, so the delays didn't seem like too much for an example program. Changing this to non-blocking behavior wouldn't be too difficult, you can look into something like the "blink without delay " example to try and get that logic going.

    SeaDragon Actually looking at your other post now with the scheduler, it look like you found a different solution!

    Expand Post