Configuration Parameter |
Selectable Option/Value |
Description |
SNTP Server name |
|
Enter the SNTP server name |
Time Zone |
|
Enter the time zone |
Get data from inputs |
|
Get data from a input ports |
Enable sync interval |
Check-Uncheck |
Time refresh period by connecting to the NTP |
Sync interval |
|
Enter the time interval (seconds, minutes, hours and days) |
Enable sync interval event through ISR port |
Check-Uncheck |
After time syncing by connecting to the NTP if there is any more things to do using this you can achieve this |
Output status |
|
Output status of the configured parameters |
Port Name |
Port Type |
Date Type |
Description |
Trigger |
Scalar |
Any data type |
Expected values True or False(1 or 0), This block only active when this pin becomes True(1) |
Simple Network Time Protocol (SNTP) block can be used to get the time from any SNTP server.
This block need to have a WIFI_block to communicate with the server.
Demo file : esp32_system_time_demo.slx
Inside of the if action subsystem.
This demo use SNTP_block to update the ESP32 local time with the server. There it need to be connect to the WIFI first from the WIFI_block. Once it connect SNTP will synchronize the time with the server. Then System_time_block will get the internal time from the esp and give the output to a String_processing_block. It will process the string and print it for the user.
Firstly it will connect to the server by using the WIFI block. When the WIFI connection is established it will update the local time. Please check the Serial Monitor for the more info (baud rate : 115200). It will log the current time there.