Geolocation and NTP Example for WizFi250 on WIZwiki-W7500

Dependencies:   Adafruit_GFX HTTPClient NTPClient WizFi250Interface mbed

System Diagram

I want to make a watch, that can check my location and time. So I decide to make this watch using Wi-Fi module(WizFi250) and Cortex-M0 MCU(WIZwiki-W7500). For getting geolocation of this watch, I used ip-api.com which geolocation server and I used NTP server for getting current time. This picture is system diagram of my project.

https://c1.staticflickr.com/1/535/18550462294_5055005f04_c.jpg

Materials

WIZwiki-W7500 ( MCU )

https://c4.staticflickr.com/4/3925/19135560186_bd20acc860_z.jpg

WizFi250-EVB ( Wi-Fi Module )

https://c1.staticflickr.com/1/331/18975741359_366b5494b7_n.jpg

Sensor Shield

https://c4.staticflickr.com/4/3692/18974815038_9fda4569f1_n.jpg

SSD1306 OLED

Refer to this URL.

https://developer.mbed.org/components/Adafruit-OLED-128x32/

Hardware Configuration

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.

https://c4.staticflickr.com/4/3913/19010999888_3b30c685dd_c.jpg

/media/uploads/kaizen/20150731_084716.png

Demo Video

For more detailed information, refer to this URL.

http://www.life4iot.com/2015/07/08/wizfi250-geolocation-and-ntp-example-on-wizwiki-w7500-of-mbed-platform/?lang=en

Revision:
4:6d1627cfb314
Parent:
3:1f2938317c31
--- a/main.cpp	Wed Aug 26 00:44:40 2015 +0000
+++ b/main.cpp	Wed Oct 21 05:54:18 2015 +0000
@@ -6,8 +6,8 @@
  
 
 #define SECURE WizFi250::SEC_AUTO
-#define SSID "wizms1"
-#define PASS "maker0701"
+#define SSID "DIR-815_Wiznet"
+#define PASS "12345678"
 
 
 #if defined(TARGET_WIZwiki_W7500)
@@ -90,8 +90,8 @@
         parse(httpGetData,&j,latitude);
         parse(httpGetData,&j,longitude);
         parse(httpGetData,&j,timeZone);
-        //gOled.printf("HTTP Data Received\r\n");
-        //gOled.display();
+//        gOled.printf("HTTP Data Received\r\n");
+//        gOled.display();
         printf("HTTP Data Received\r\n");
     } 
     else { //HTTP GET REQUEST ERRORED
@@ -116,9 +116,6 @@
 //    gOled.printf("%s, %s %s, %s\r\n",city,stateAbrv,zip,countryAbrv); //PRINT CITY STATE AND ZIP INFORMATION AND COUNTRY
 //    gOled.printf("LAT:%s\r\nLONG:%s\r\n",latitude,longitude); //PRINT LATITUDE AND LONGITUDE 
 //    gOled.printf("Timezone:%s\r\n",timeZone); //PRINT TIMEZONE
-    printf("%s, %s %s, %s\r\n",city,stateAbrv,zip,countryAbrv); //PRINT CITY STATE AND ZIP INFORMATION AND COUNTRY
-    printf("LAT:%s\r\nLONG:%s\r\n",latitude,longitude); //PRINT LATITUDE AND LONGITUDE 
-    printf("Timezone:%s\r\n",timeZone); //PRINT TIMEZONE
 
 
     wizfi250.disconnect(); //DISCONNECT FROM THE NETWORK 
@@ -130,6 +127,9 @@
 //        gOled.printf("Univ Time Clock\r\n%s\r\n", buffer);
 //        gOled.display();
 //        gOled.setTextCursor(0,40);
+        printf("%s, %s %s, %s\r\n",city,stateAbrv,zip,countryAbrv); //PRINT CITY STATE AND ZIP INFORMATION AND COUNTRY
+        printf("LAT:%s\r\nLONG:%s\r\n",latitude,longitude); //PRINT LATITUDE AND LONGITUDE 
+        printf("Timezone:%s\r\n",timeZone); //PRINT TIMEZONE
         printf("Univ Time Clock\r\n%s\r\n", buffer);
         wait(1);
     }