AT Command

Description

AT+CACLOSE command is used to close the TCP or UDP connection  in the Simcom SIM70XX modules.


Support

Simcom Module Tutorial

Examples

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

Try the below script in the AT Command Tester tool

//Script: at+caclose
//AT+CACLOSE command is used to close tcp/udp connection in Simcom SIM70XX modules
//Check SIMCOM Module AT Command documentaiton

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

//Wait
WAIT=1

//Get the current TCP configuration
AT+CACLOSE?

//Wait
WAIT=2

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

//Wait
WAIT=5

//Close the connection
AT+CACLOSE=0


Output of the above script in the AT Command Tester tool

AT+CACLOSE=?

TCP connection is closed by remote server

+CACLOSE: (0-12)
TCP connection is closed by remote server


OK
AT+CACLOSE?

TCP connection is closed by remote server

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

+CAOPEN: 0,0

OK
AT+CACLOSE=0

TCP connection is closed by remote server

OK