In this example, we connect Ameba to WiFi. Then send NTP (Network Time Protocol, RFC 1305) request to NTP server using UDP. After receiving the NTP request, the NTP server replies current UTC (Coordinated Universal Time) packet. We will parse the UTC packet to show current UTC time.
For more information:
If you need more technical documents and example code that work right out of box, check out the links below,
Open the example. “File” -> “Examples” -> “AmebaWiFi” -> “WiFiUdpNtpClient”
Modify the highlighted code section (ssid, password, keyindex) to connect to your WiFi network.
Upload and Execution
Compile the code and upload it to Ameba. After pressing the Reset button, Ameba connects to WiFi and sends NTP request packet to NTP server “126.96.36.199”. We parse the replied packet and show UTC time in serial monitor: