4.1.1 System Time

It is important to set the WINC system to UTC time to ensure a proper validity check of the X509 certificate expiration date. Since the WINC does not contain a built-in Real-Time Clock (RTC), there are two ways to obtain UTC time:

  • Using the internal SNTP client – this is enabled by default in the WINC firmware at start-up. The SNTP client synchronizes the WINC system clock to the UTC time from the time servers. The NTP server that the SNTP client uses can be configured using the API m2m_wifi_configure_sntp. The default NTP server used by the WINC is time.nist.gov. The SNTP client uses a default update cycle of one day.
  • In case there is no response from the default NTP server time-c.nist.gov, a secondary NTP server pool.ntp.org is used by the WINC.
  • From the host MCU RTC – if the host MCU has an RTC, the application may disable the SNTP client by calling m2m_wifi_enable_sntp(0) (by passing zero as the argument) after the WINC initialization. The application provisions the WINC system time by calling m2m_wifi_get_sytem_time() API which returns the locally stored (internal clock value) time.
  • When the SNTP Client running on the ATWINC15x0 synchronizes the time, the ATWINC15x0 will post the M2M_WIFI_RESP_GET_SYS_TIME event to the host.