Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

raspberry pi - Cannot use TCP trough SIM800 modem

I tried to use send a GET request using TCP over a SIM868 modem , but I always received "ERROR" after the AT command: AT+CIPSEND. Using minicom on my raspberry 3 , these are the command I sent:

AT+CSTT="APN NAME"
OK
AT+CIICR
OK
AT+CIFSR
100.73.110.9

AT+CIPSTART="TCP","exploreembedded.com",80
OK
CONNECT OK

AT+CIPSEND
> 
GET exploreembedded.com/wiki/images/1/15/Hello.txt HTTP/1.0
SEND OK

After the I received the SEND OK , I never receive the the page content. Also according the AT Commands manual after you type the GET you must type CTRL+Z, what I did it.
I tried the url in the browser and it works OK. Help will be vey appreciated!

question from:https://stackoverflow.com/questions/65873582/cannot-use-tcp-trough-sim800-modem

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try to use HTTP commands instead. That works for me and SIM800L:

AT

OK
AT+CPIN?

+CPIN: READY

OK
AT+CREG?

+CREG: 0,1

OK
AT+CFUN?

+CFUN: 1

OK
AT+CGATT?

CGATT=1

OK
AT+SAPBR=3,1,"CONTYPE","GPRS"

OK
AT+SAPBR=3,1,"APN","inet.es"

OK
.AT+SAPBR=2,1
.+SAPBR: 1,3,"0.0.0.0"

.OK

AT+SAPBR=1,1

OK
AT+SAPBR=2,1

+SAPBR: 1,1,"172.28.50.25"

OK
AT+HTTPINIT

OK
W
AT+HTTPPARA="URL","http://yourweb.com/prova3.php?ky=5FD9&in=461"

OK
AT+HTTPACTION=0

OK
AT+HTTPREAD

OK
AT+HTTPTERM

OK

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...