This post introduces an application example about how to identify my current location by connecting (Geolocation) Server using WizFi250 and WIZwiki-W7500, and getting time through NTP(Network Time Protocol) Server.
- SSD1306 OLED : 128 x 64 dot matrix panel
UART0 RX/TX/CTS/RTS pins of WIZwiki-W7500 board are used to control WizFi250 which Wi-Fi module and It use I2C SDA/SCL pins for using SSD1306 OLED.
Compilation of WizFi250 Geolocation and NTP Example
You can use this WizFi250 Geolocation and NTP example in following link.
Libraries for this example
SSD 1306 Library
To make use of SSD1307 OLED, you need Adrifruit GFX Library. I found some minor bugs using Display() function, so I asked Pull Request to library’s owner.
As you easily can know by name, HTTP Client Library is used for sending request to and/or receiving response from external web server. In this example, it is used to get Geolocation(Geological code) by connecting to ip-api.com server. If you connect to ip-api.com/csv, then you can get name of country, address, latitude, longitude, TimeZone and so on, in (*.csv) format.
NTP Client Library is used to get UTC from Network Time Server by using UDP commnucation. This example uses a NTP Server Domain(kr.pool.ntp.org) in South Korea. The information acquired from NTP Server is UTC, so 9 hours should be added to get the local time in South Korea.