Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
---|
The application creates an NTP Server using UDP socket with the specified port number (default = 123) and waits for the data to be received. For now the ESP32 development board syncs up with an external NTP Server - WWVB support will be integrated.
In order to interact with the NTP Server, you can choose one of many existing host-side tools. One command line tool on MacOS is sntp which can give you the status health of the NTP Server.
Note: please replace 192.168.8.194
with desired IPV4/IPV6 address (displayed in monitor console) in the following commands.
sntp -d 192.168.8.194
ntpdate -q 192.168.8.194
w32tm /stripchart /computer:192.168.8.194
The NTP Server can be run on any commonly available ESP32 development board.
idf.py menuconfig
Set following parameters under NTP Server Configuration Options:
-
Set
IP version
of the NTP Server to be IPV4 or IPV6. -
Set
Port
number for the NTP Server for any specific use case, otherwise keep the default port (= 123).
Configure Wi-Fi or Ethernet under "Example Connection Configuration" menu. See "Establishing Wi-Fi or Ethernet Connection" section in examples/protocols/README.md for more details.
Build the project and flash it to the board, then run monitor tool to view serial output:
idf.py -p PORT flash monitor
(To exit the serial monitor, type Ctrl-]
.)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
Start server first, to receive data sent from the client (application).