NTP client app setting system time and X-NUCLEO-IDW01M1 Wi-Fi board time connecting to internet NTP UTC time server.
Dependencies: NTPClient NetworkSocketAPI X_NUCLEO_IDW01M1v2 mbed
Fork of NTPClient_HelloWorld by
Example of retrieval of current time using an NTP server.
Time is then used to perform a TLS secure connection to https://mbed.org.
The application is meant to be used with mbed OS 2 ("Classic") only (no mbedOS 5 support).
Diff: main.cpp
- Revision:
- 5:88cece84fb6e
- Parent:
- 4:11f2b556765b
- Child:
- 6:96e92bfda33e
--- a/main.cpp Mon Jan 02 15:46:54 2017 +0000 +++ b/main.cpp Tue Jan 03 13:02:14 2017 +0000 @@ -41,7 +41,7 @@ ctTime = time(NULL); printf ("\n\rConnecting to WiFi ...\n\r"); - spwf.connect("crespan","Elfrontal1", NSAPI_SECURITY_WPA2); + spwf.connect("ssid","passw", NSAPI_SECURITY_WPA2); NTPClient ntp(spwf); printf("Initial System Time is: %s\r\n", ctime(&ctTime));