AT Command

Description

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


Support

Simcom Module Tutorial

Examples

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

Try the below script in the AT Command Tester tool

//Script: at+caopen
//AT+CAOPEN command is used to open tcp/udp connection in Simcom SIM70XX modules
//Check SIMCOM Module AT Command documentaiton

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

//Wait
WAIT=1

//Get the current TCP configuration
AT+CAOPEN?

//Wait
WAIT=1

//Activate the network
AT+CNACT=0,1

//Wait
WAIT=10

//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

//Wait
WAIT=5

//Open UDP connection
//CID, PDP Index, connection type, server address, port
AT+CAOPEN=0,0,"UDP","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+CAOPEN=?

+CAOPEN: (0-12),(0-4),("TCP","UDP"),64,(1-65535)

OK
AT+CAOPEN?

OK
AT+CNACT=0,1

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
AT+CAOPEN=0,0,"UDP","postman-echo.com",80

+CAOPEN: 0,0

OK
AT+CACLOSE=0

TCP connection is closed by remote server

OK