|
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