使用 Telit GL 865 GSM/GPRS 调制解调器通过 GPRS 连接互联网
我正在研究用于研究目的的 Telit GL-865 GSM/GPRS 调制解调器套件。我已使用串行端口将其连接到我的电脑,并使用 Putty 进行终端访问。
我可以成功执行所有 AT 命令来发送/接收短信、拨打语音电话等。
我还可以使用 AT+CGDCONT 设置 GPRS 上下文,并使用 AT#SKTD 打开与服务器的连接,并且可以发送 GET 和 POST 请求。我还正确获得了包含所有标头的 HTTP 响应。
然而,对于某些网站,我没有得到适当的回应。例如。 - www.google.com 如果我发送:
AT#SKTD=0,80,"www.google.com"
CONNECT
GET /<cr><lf>
<cr><lf>
我会收到以下响应:
HTTP/1.0 302 Found
Location: http://www.google.co.in/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=80125e212d950ff8:FF=0:TM=1310555250:LM=1310555250:S=lwD7-OUKPeiBwCri; expires=Fri, 12-Jul-2013 11:07:30 GMT; path=/; domain=.google.com
Date: Wed, 13 Jul 2011 11:07:30 GMT
Server: gws
Content-Length: 221
X-XSS-Protection: 1; mode=block
<HTML>
<HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE>
</HEAD>
<BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.in/">here</A>.
</BODY>
</HTML>
此外,我无法访问 www.wiley.com 来测试 CGI 脚本。我收到 CONNECT 作为对 AT#STKD 的响应,但在我完成输入请求标头之前,我收到一条 NO CARRIER 消息。
I'm working on the Telit GL-865 GSM/GPRS Modem kit for research purposes. I have connected it to my pc using a serial port and got the terminal access using Putty.
I can successfully execute all AT commands to send/receive sms, make voice calls, etc.
I can also set a GPRS context using AT+CGDCONT and open a connection to server using AT#SKTD and can send GET and POST requests. I also get the HTTP response with all headers properly.
However for some websites, I do not get proper response. For eg. - www.google.com
If I send :
AT#SKTD=0,80,"www.google.com"
CONNECT
GET /<cr><lf>
<cr><lf>
I get the following response :
HTTP/1.0 302 Found
Location: http://www.google.co.in/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=80125e212d950ff8:FF=0:TM=1310555250:LM=1310555250:S=lwD7-OUKPeiBwCri; expires=Fri, 12-Jul-2013 11:07:30 GMT; path=/; domain=.google.com
Date: Wed, 13 Jul 2011 11:07:30 GMT
Server: gws
Content-Length: 221
X-XSS-Protection: 1; mode=block
<HTML>
<HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE>
</HEAD>
<BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.in/">here</A>.
</BODY>
</HTML>
Also I cannot access www.wiley.com to test CGI scripts. I get CONNECT as a response to AT#STKD but before I can complete typing the request header I get a NO CARRIER message.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否正确建立了 PDP 上下文?
以下是我在 Telit GM862 上使用的命令和响应,效果很好:
Have you established the PDP context correctly?
Below are the commands and responses I used working with Telit GM862 and it worked well:
我几乎已经解决了这个问题。
HTTP 302 的第一个问题只是一个 HTTP 重定向请求,因此我必须在 while 循环中编写代码,以再次向“”发送新的 GET 请求响应中指定的位置'。
关于访问 www.wiley.com 的第二个问题是通过在连接后立即粘贴请求标头并按 Enter 键解决的,而不是手动输入。所以我猜问题是由于打字延迟而发生的超时。当我在程序中执行此操作时,这将是瞬时的,因此我不必担心。
I have almost solved the problem.
The first problem of HTTP 302 is just a HTTP Redirection Request so I have to write my code in a while loop to again send a new GET request to the 'location' specified in the Response.
And the second problem regarding access of www.wiley.com is solved by immediately pasting the request header and hitting enter after I get CONNECT, instead of typing manually. So I guess the problem is due to timeout which occurs because of typing delay. When I'm doing this in a program it would be instantaneous, so I don't have to worry about it.