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

details

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

 

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

 

2
COMMENTS

Please Login to comment
1 Comment authors
Monique Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Monique
Guest
Monique

Hello i am a studend in Germany and i try to connect to Google. Since yesterday i tried it but no Solutions. Can you help me ?
look ak my Code:

AT+WLEAVE

[DISCONNECT 0]

[Link-Down Event]
[OK]
AT+WSET=0,WIKHON-Internaute
[OK]
AT+WSEC=0,,++++++
[OK]
AT+WNET=1
[OK]
AT+WJOIN
Joining : WIKHON-Internaute
Successfully joined : WIKHON-Internaute

[Link-Up Event]
IP Addr : 172.28.211.20
Gateway : 172.28.101.3
[OK]
AT+FDNS=WWW.google.com,3000
173.194.116.178
[OK]
AT+SCON=O,TCN,173.194.116.178,80,0,0

[CONNECT 0]
[OK]
at+SSEND=0,,,18
[0,,,18]
[ERROR] ************ here i become error and i dont no why, can you explain please ? *******************************

Monique
Guest
Monique

thank you