AT Command

Description

AT+CARECV  command is used to receive the TCP/UDP data from remote server in the Simcom SIM70XX modules.


Support

Simcom Module Tutorial

Examples

KeywordsAT+CARECV syntax, examples, parameters, error, input, response.

Try the below script in the AT Command Tester tool

//Script: at+carecv
//AT+CARECV command is used to receive the tcp/udp data in Simcom SIM70XX modules
//Check SIMCOM Module AT Command documentaiton

//Get the support for the commands
AT+CARECV=?

//Wait
WAIT=1

//Open TCP connection
//CID, PDP Index, connection type, server address, port
AT+CAOPEN=0,0,"TCP","postman-echo.com",80

//Wait
WAIT=5

//Send
AT+CASEND=0,46

//Send HTTP get as the TCP data
GET https://postman-echo.com/ip HTTP/1.0

//Wait for response
WAIT=5

//Receive the TCP response
//Wait for the +CADATAIND indication before reading the TCP response
AT+CARECV=0,500

//Wait for response
WAIT=3

//Close the connection
AT+CACLOSE=0


Output of the above script in the AT Command Tester tool

AT+CARECV=?

+CARECV: (0-12),(1-1459)

OK
AT+CAOPEN=0,0,"TCP","postman-echo.com",80

+CAOPEN: 0,0

OK
AT+CASEND=0,46

> 
OK

+CASEND: 0,0,46

+CADATAIND: 0

+CASTATE: 0,0
AT+CARECV=0,500

+CARECV: 354,HTTP/1.1 200 OK

Date: Sun, 21 Jun 2020 15:30:24 GMT

Content-Type: application/json; charset=utf-8

Content-Length: 23

Connection: close

ETag: W/"17-vObpD0NlqE3iYPjucfZxK26eEkk"

Vary: Accept-Encoding

set-cookie: sails.sid=s%3A_iCBuQ-OJbIljn2OUhBvm3O7zug0y2Ne.32j9xE9KEQMVDSmL4VbsGwBY%2Bl2xpflRwDDLpkNE3Po; Path=/; HttpOnly



{"ip":"34.219.166.193"}

OK
AT+CACLOSE=0

TCP connection is closed by remote server

OK