Data Call – AT commands to set up GPRS/EDGE/UMTS/LTE data call

How to set up data call with AT commands?

Need low-cost/experienced embedded programmers/testers for your project?

With Online AT Command Tester tool, it is easy to test data calls. First, the tool provides an interface to read/edit/delete PDP profiles which contain necessary call set up parameters such as APN, data call type (IPV4 or IPv6) etc. Then you can select a PDP profile and connect. The AT Command tester tool will then check whether the device is already registered in the network. If so, it will then send the necessary AT commands to the device to start the data call.

Once the device us powered up, check whether SIM card is present. If the SIM is not inserted properly or if the SIM card is locked, please correct those issues.
AT+CPIN?
+CPIN: READY
OK
The device above returns that the SIM is ready to use.

Then check the registration status of the device.
If the regisration status is “Searching” or “Not Registered”, that means that the device is not able to acquire the signal from the base station. The device should usually find the nearest base station within few minutes (max 15min). If you dont get “Registered” response for the AT+CGREG command,
- Verify that the antenna is properly connected on the device
- Verify that the bands supported by the device match the bands of the network provider

AT+CGREG?
+CGREG: 0,1
OK
In the above case, the device returns that it is registred in the home network.

After verifying the network registration status, you can get the network information. If teh device is registered on the home network, the network info on the SIM card used should match the network info returned by the AT+COPS command,
AT+COPS?
+COPS: 0,0,”T-Mobile”
OK

Now check the signal quality.
AT+CSQ
+CSQ: 10,0
OK
That return corresponds to a RSSI value of -93 dBm. This is only slightly better than marginal coverage. We should still be able to make a data call on this signal condition, but the throughput may not be that good.

Once the registration is sucessful, GPRS Attach is performed.
AT+cgatt=1
OK

Even if the GPRS Attach is sucessful, it doesn’t mean that the data call has been established.In GPRS, a Packet Data Protocol (PDP) defines the data session. The PDP context establishes the data path between the device and the GGSN (Gateway GPRS Support Node). GGSN acts like a gateway between the device and rest of the world. So the should establish a PDP context before it can send/receive data on the internet.

The GGSN is identified through Access Point Name (APN). Each carrier will have their own APNs and are usually available on the internet. The device can define multiple PDP contexts that are uniquely stored in context ids.

For examples,
AT+CGDCONT=1,”IP”,”epc.tmobile.com”
OK

Above defines a PDP context for T-Mobile. The context ID is 1, it will use a IP connection and the APN is set as

AT+CGDCONT=1,”IP”,”epc.tmobile.com”
OK

AT+CGDCONT=2,”IP”,”isp.cingular”
OK

Above defines another PDP context with a different APN. To list all the PDP contexts that are defined,
at+cgdcont?
+CGDCONT: 1,”IP”,”epc.tmobile.com”,”0.0.0.0″,0,0
+CGDCONT: 2,”IP”,”isp.cingular”,”0.0.0.0″,0,0
+CGDCONT: 3,”IP”,”",”0.0.0.0″,0,0

OK

Now that the PDP contexts are defined, please use the correct PDP context that matches the SIM card. For example, if we’re using the T-Mobile SIM card, the PDP context that has the corresponding APN should be used to connect.

Now to set up the session, the appropriate PDP context needs to be activated.
AT+CGACT=1,1
OK
The first parameter(1) is to activate the context and the second parameter is teh context ID. Once the PDP Context is activated sucessfully, the device can send/receive data on the internet. To check if there were any issues with teh PDP activation, send the AT+CEER command. Check the error code and take next steps.

To deactivate the PDP context,
AT+CGACT=0,1
OK

Deactivating the PDP context would ensure that no additional data is sent or received by the device.

To detach from the GPRS network,
AT+CGATT=0
OK
Detaching from the GPRS network will conserve network resources.

Keywords: Module data call, M2M data call, GPRS data call, 3G data call, data call through AT commands,