In order to make a break in the wired network experiment, we conducted an experiment to acquire the current time described in the article on July 14, 2017, using an experiment board connected to the Internet with WIZ820io (W5200). Similarly, the NTP server to be connected used ntp.nict.jp of the National Institute of Information and Communications Technology.
The Ethernet board was previously reported in my page on Sep. 1, 2017.
<< Sample code of the NTP client with W5200 >>
(Compiled by the C18 under the large code model on the MPLAB X IDE)
In TCPIPConfig.h, the default network configuration must be adjusted to your local network (MAC address, IP address and so on).
In addition, STACK_USE_DNS, STACK_USE_BERKELEY_API and STACK_USE_TCP are defined so that the Ethernet board can work as a NTP client using the Berkeley Socket.
<< Operation of the NTP client >>
Initialization: If the Ethernet board is connected to the Internet for the first time, the current time can be automatically obtained from the NTP server.
Adjustment of the time: Every time the RB3 pin (BUTTON 0) is pulled down, the current time will be gotten from the NTP server.
Usage: Set the local network information in the TCPIPConfig.h file. When you connect to the Internet, the first time setting will automatically connect to the NTP server and start ticking. For the second and subsequent time corrections, press the switch (RB3) while connected to the Internet to connect to the NTP server and update to the current time.
<< Summary in Japanese >>
Finish the experiment using WIZ820io (W5200) instead of ENC28J60. We were able to confirm the actual operation of each service of DHCP and NBNS as LAN, and SMTP and NTP as WAN. I conclude my manuscript with the hope that it will be a truly wonderful time for embedded systems to easily connect to the world of the Internet.
Missiles flew in the autumn sky, and the dissolution wind began to blow