Ads 468x60px

Senin, 07 April 2014

Cara koneksi ke Google (HTTP/HTTPS) dengan menggunakan WIZFI250

Berikut ini panduan untuk melakukan koneksi ke Google dengan menggunakan WIZFI250.


How to Connect to Google(HTTP/HTTPS) Using WizFi250

We will demonstrate the connection to Google web server via HTTP(port 80) and HTTPS(port 443) with WizFi250.

<HTTP Client Example>
(AP Association)
AT+WLEAVE
[OK] AT+WSET=0,Wiznet_Kaizen
[OK] AT+WSEC=0,OPEN
[OK] AT+WNET=1
[OK] AT+WJOIN
Joining : Wiznet_Kaizen
Successfully joined : Wiznet_Kaizen

[Link-Up Event] IP Addr    : 192.168.15.10
Gateway    : 192.168.15.1
[OK]
(This is for easy parsing the data. If you want to parse the header manually, you can omit this step.)
AT+SFORM=000000000
[OK]
(Find IP address of google.com)
AT+FDNS=google.com,3000
74.125.128.102
[OK]
(Connect to the google web server via HTTP(80))
AT+SCON=O,TCN,74.125.128.102,80,0,0

[CONNECT 0] [OK]
(Send Web Request)
AT+SSEND=0,,,18
[0,,,18] GET / HTTP/1.1\r\n\r\n
[OK]
(Now, you can receive the data from google web server via HTTP like below.)
HTTP/1.1 302 Found
Location: http://www.google.co.kr/?gws_rd=cr&ei=pIz0UvbYBqmZiQf2zIDgCA
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=55cbe1a26a10a4a4:FF=0:TM=1391758500:LM=1391758500:S=V39C5p8-28xe7gVT; expires=Sun, 07-Feb-2016 07:35:00 GMT; path=/; domain=.google.com
Set-Cookie: NID=67=eAwBBej-W68bRryLLG7O86lG5BkNJzD5GpFZxbUnkHmHs6DyaeocsgLh4yd8mYc5pzyQJxTdC4f7GfqSrbC6orrtgErxRRSC0hxloj6B53eKbRYzWeIv5PGF9UT97v2c; expires=Sat, 09-Aug-2014 07:35:00 GMT; path=/; domain=.google.com; HttpOnly
………………………………

(Disconnect the connection with google web server)
AT+SMGMT=ALL

[DISCONNECT 0] [OK]
And, below picture is the Wireshark capture of above HTTP example.
222


<Get HTTPS Example>

(By this step, you can refer to the <Get HTTP Example>.)
(Connect to the google web server via HTTPS(443))
AT+SCON=O,TCS,74.125.128.102,443,0,0

[CONNECT 0] [OK]
(Send Web Request)
AT+SSEND=0,,,18
[0,,,18] GET / HTTP/1.1\r\n\r\n
[OK]
(Now, you can receive the data from google web server via HTTPS like below.)
HTTP/1.1 302 Found
Location: http://www.google.co.kr/?gws_rd=cr&ei=pIz0UvbYBqmZiQf2zIDgCA
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=55cbe1a26a10a4a4:FF=0:TM=1391758500:LM=1391758500:S=V39C5p8-28xe7gVT;
………………………………

(Disconnect the connection with google web server)
AT+SMGMT=ALL

[DISCONNECT 0] [OK]
And, below picture is the Wireshark capture of above HTTPS example.
333

Posted by: Steve Kim
Sumber : http://wizwiki.net/how-to-connect-to-googlehttphttps-using-wizfi250/

Tidak ada komentar:

Posting Komentar