获取错误的请求响应使用SIM900向服务器发送数据时

时间:2016-04-12 11:42:29

标签: http gsm sim900

AT+CSTT="live.vodafone.com"$0D$0A                       OK

AT+CIPSHUT$0D$0A                                        SHUT OK

AT+CIPMUX=0$0D$0A                                       OK

AT+CLPORT="TCP",80$0D$0A                                OK

AT+CIICR$0D$0A                                          OK

AT+CIPSTART="TCP","http://ph.mydomain.in",80$0D$0A      OK   CONNECT OK

AT+CIPSEND$0D$0A                                        

GET /phreading.aspx?value=092016040804550815 HTTP/1.1$0D$0A
Host: http://www.ph.mydomain.in$0D$0A$0D$0A
$1A

比我得到以下错误。

enter image description here 请帮我解决这个问题。并告诉我在服务器上正确发送数据的正确顺序。

1 个答案:

答案 0 :(得分:1)

尝试使用AT+HTTPPARA命令发送您的get请求。它比使用CIPSEND方法容易得多。

连接到GPRS

AT+CGATT?
AT+SAPBR=3,1,"CONTYPE","GPRS"
AT+SAPBR=3,1,"APN","live.vodafone.com"
AT+SAPBR=3,1,"USER","APN_USERNAME"  // adapt it to yours
AT+SAPBR=3,1,"PWD","APN_PASSWORD" // adapt it to yours
AT+SAPBR=1,1

使用HTTP GET发送数据

AT+HTTPINIT
AT+HTTPPARA="CID",1
AT+HTTPPARA="URL","www.ph.mydomain.in//phreading.aspx?value=092016040804550815"
AT+HTTPACTION=0 // sends HTTP GET  
AT+HTTPTERM  // terminate HTTP request
AT+SAPBR=0,1 // disconnect gprs if required

希望这会有所帮助..