SIM900A TCP/UDP 数据收发 , 串口调试

时间:2021-12-03 10:17:49




串口命令

AT+CIPSTART="TCP","101.132.43.66","80" AT+CIPSTART="UDP","101.132.43.66","80" 
AT+CIPSEND 发送的内容1  十六进制1a表示发送
AT+CIPSEND 发送的内容2  十六进制1a表示发送
Linux CentOS 6.8 X64     (服务器响应的报文)
Linux CentOS 6.8 X64 2   (服务器响应的报文)
AT+CIPSHUT


交互流程

交互流程AT+CIPSTART="UDP","101.132.43.66","80"OKCONNECT OKAT+CIPSEND> Hello Sim900A UDPSEND OKAT+CIPSEND> Hello Sim900A UDP2SEND OKLinux CentOS 6.8 X64Linux CentOS 6.8 X64 2AT+CIPSHUTSHUT OK




SIM900A TCP模式模拟HTTP请求

如下AT+CIPSTART="TCP","www.taobao.com","80"OKCONNECT OKAT+CIPSEND> GET / HTTP/1.1User-Agent: curl/7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2Host: wwww.taobao.comAccept: */*SEND OKHTTP/1.1 302 FoundServer: TengineDate: Sun, 03 Sep 2017 03:26:32 GMTContent-Type: text/htmlContent-Length: 258Connection: closeLocation: http://err.taobao.com/error1.html?c=400&u=http:///&r=<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>302 Found</title></head><body bgcolor="white"><h1>302 Found</h1><p>The requested resource resides temporarily under a different URI.</p><hr/>Powered by Tengine</body></html>CLOSEDAT+CIPSHUTSHUT OK-----------------------------------------------------










本文出自 “李春利” 博客,请务必保留此出处http://990487026.blog.51cto.com/10133282/1959732