Announcement

Collapse
No announcement yet.

P1AM-100 RTC NTP Sync Example

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • P1AM-100 RTC NTP Sync Example

    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.
    RTCZero - https://github.com/arduino-libraries/RTCZero also available in the Library Manager

    Check out the code here:
    https://github.com/AutomationDirect/...C_NTP_SYNC.ino

  • #2
    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?

    Comment


    • #3
      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!

      Comment

      Working...
      X