AT Command

Description

AT+CGATT AT command is used to attach or detach the device to packet domain service.

Usage
Command Possible Response(s)
+CGATT=[] OK ERROR
+CGATT? +CGATT:
+CGATT=? +CGATT: (list of supporteds)

Examples

Check the status of Packet service attach. '0' implies device is not attached and '1' implies device is attached.
AT+CGATT?
+CGATT:0
OK

Perform a GPRS Attach. The device should be attached to the GPRS network before a PDP context can be established
AT+CGATT=1
OK

Perform a GPRS Detach. This is ensure that that the device doesn't lock up any netwrok resources.
AT+CGATT=0
OK

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

Once the device is registered with the network, the device attaches to it automatically in most cases. Only when the device is sucessfully attached to the network, data call successfully established.

With Online AT Command Tester tool, you can test the network attach with the AT+CGATT command in many ways. In the ‘diagostics’ tab get the device attach status,

Users can also test the AT+CGATT command under the ‘Command Mode’ tab of the AT Command Tester.
AT+CGATT?
+CGATT: 1
OK

AT+CGATT=0
OK

AT+CGATT=1
OK

AT+CGATT=?
+CGATT: (0,1)
OK

You can send batch of AT commands including the AT+CGATT command in the ‘Script Mode’ tab



Try this script included in AT Command Tester Tool.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Script-at_cgatt.at

//Test AT+CGATT AT command

//AT+CGATT command is used to attach or detach to packet domain service

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

//List of supported responses

//Supported states are 0- Detached, 1 - Attached

AT+CGATT=?

 

//WAIT for 1 sec

WAIT=1

 

//Get the current state

AT+CGATT?

 

//WAIT for 1 sec

WAIT=1

 

//Detach from network

AT+CGATT=0

 

//WAIT for 1 sec

WAIT=2

 

//Check if detached from network

AT+CGATT?

 

//WAIT for 1 sec

WAIT=1

 

 

//Attach to network

AT+CGATT=1

 

//WAIT for 1 sec

WAIT=2

 

//Check if attached to network

AT+CGATT?

 

//WAIT for 1 sec

WAIT=1


Output of above script in AT Command Tester Tool.

AT+CGATT=?

+CGATT: (0,1)

 

OK

 

AT+CGATT?

+CGATT: 1

 

OK

Device is attached to the network

 

AT+CGATT=0

OK

 

AT+CGATT?

+CGATT: 0

 

OK

Device is NOT attached to the network

 

AT+CGATT=1

OK

 

AT+CGATT?

+CGATT: 1

 

OK

Device is attached to the network