Weather info from OPenweathermap.org with TCPClient on WIZwiki-W7500
Dependencies: WIZnetInterface mbed
Fork of TCPClient_HelloWorld_WIZwiki-W7500 by
Prerequisite
This example is for obtainning and printting data from server(OpenWeatherMap). WIZwiki-W7500 is TCP client mode.
To implement this function, you need a Platform board, network Interface board.
- WIZwiki-W7500 from WIZnet (Platform board and Ethernet I/F board)
Hardware Configuration
WIZwiki-W7500 Pin map
Software
Select the city
char http_cmd0[] = "GET /data/2.5/weather?q=Seoul,kr&appid="; char http_cmd1[] = API_key; char http_cmd2[] = " HTTP/1.0\n\n"; sock.send_all(http_cmd0, sizeof(http_cmd0)-1); sock.send_all(http_cmd1, sizeof(http_cmd1)-1); sock.send_all(http_cmd2, sizeof(http_cmd2)-1);
Caution
This example requires an API key that can be obtained by signning up to the openweathmap site. //
Diff: WIZnetInterface.lib
- Revision:
- 1:2f7108c02fc9
- Child:
- 2:c4fef61e151d
diff -r d7c890f9ee69 -r 2f7108c02fc9 WIZnetInterface.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WIZnetInterface.lib Mon Jun 29 00:43:27 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/WIZnet/code/WIZnetInterface/#7d7553e0578e