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

Files at this revision

API Documentation at this revision

Comitter:
kaizen
Date:
Wed Oct 21 05:54:18 2015 +0000
Parent:
3:1f2938317c31
Commit message:
Delete OLED Code

Changed in this revision

WizFi250Interface.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-src.lib Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 1f2938317c31 -r 6d1627cfb314 WizFi250Interface.lib
--- a/WizFi250Interface.lib	Wed Aug 26 00:44:40 2015 +0000
+++ b/WizFi250Interface.lib	Wed Oct 21 05:54:18 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/kaizen/code/WizFi250Interface/#3a2282277ad0
+http://mbed.org/users/kaizen/code/WizFi250Interface/#4fd47f387930
diff -r 1f2938317c31 -r 6d1627cfb314 main.cpp
--- 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);
     }      
diff -r 1f2938317c31 -r 6d1627cfb314 mbed-src.lib
--- a/mbed-src.lib	Wed Aug 26 00:44:40 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed-src/#bc40b8d2aec4
diff -r 1f2938317c31 -r 6d1627cfb314 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Oct 21 05:54:18 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/34e6b704fe68
\ No newline at end of file