#### AT Commands for a TCP Connection on SIM5360

The SIM5360 series is a Dual-Band HSPA+/WCDMA and Quad-Band GSM/GPRS/EDGE module solution in a SMT type which supports HSPA+ up to 14.4Mbps for downlink data transfer. SIM5360 related documentation can be downloaded from SIMCom site.

This short note explains the AT commands needed to open the network and establish a TCP connection on the SIM5360A.

## Prerequisites

Ensure that a SIM is inserted correctly, and verify that it is "active" in the operator console. This is possible only in an scenario where the carrier has provided access to its management console. If not, just make sure that the carrier has activated the SIM card.

The other piece of information necessary from the carrier is whether the SIM connects in local (home) profile or roaming profile. Some SIMs that provide global connectivity are always on roaming profile even in the home country. This information is required if you wish to verify if the network registration.

## Establish Connection

The following AT command sequence should be sufficient to get an IP address from the carrier and establish a TCP/UDP connection to a server.

Command Comment
AT Initialization
ATE0 Set command echo off
AT+CPSI? Verify if service online
AT+CREG? On Home network, the response is +CREG: 0,1, on roaming response is +CREG: 0,5
AT+CGREG? On Home network, the response is +CGREG: 0,1, on roaming response is +CGREG: 0,5
AT+CGSOCKCONT=1,"IP","<APN name>" Set APN
AT+CSOCKAUTH=1,1[,"<password>"][,"<username>]" Set Authentication Type. If network needs it, provide username and password
AT+CSOCKSETPN=1 Set profile number
AT+CIPMODE=0 Set non-transparent (command) mode
AT+NETOPEN Open network connection
AT+IPADDR Get IP address if required. Response format is +IPADDR:<IP address>
AT+CIPOPEN=0,"UDP","<server IP>",<server port>[,<local port>] Open UDP socket connection to server
AT+CIPOPEN=0,"TCP","<server IP>",<server port>[,<local port>] Open TCP socket connection to server

## Terminate Connection

Command Comment
AT+CIPCLOSE Close the socket
AT+NETCLOSE Close the network