03. NTP Client example - ArmDeveloperEcosystem/Corstone-for-Arduino GitHub Wiki
About
This example uses the Arduino Ethernet library's UdpNtpClient example to query a Network Time Protocol (NTP) server using UDP.
More details can be found on the Arduino "Ethernet Shield Network Time Protocol (NTP) Client" page.
Prerequisites
- AVH EC2 instance that is setup via the Getting Started with Corstone for Arduino guide.
Guide
- SSH into the AVH EC2 instance.
- Change to example directory:
cd ~/Arduino/libraries/Ethernet/examples/UdpNtpClient/ - Compile example:
~/bin/arduino-cli compile -b arm:corstone:corstone_300 -v - Run example:
~/bin/arduino-cli upload -b arm:corstone:corstone_300 -v - The FVP will connect to the virtual ethernet network.
- The example's main loop will send an NTP request to an NTP server and print the current epoch and NTP time.
- CTRL-C can be used to stop running.
Example Output
