AT+CGREG is an AT command for the GPRS registration status of the device.
Overview
Command | Example response(s) | Info |
|
| Checks supported configurations.
|
|
| Get the current registration status.
|
|
| Disables Unsolicited Result Codes. |
|
| Enables Unsolicited Result Codes (receive automatic updates on registration status). |
|
| Enables network registration and location information Unsolicited Result Codes. |
AT+CGREG=?
AT+CGREG=? is a test command that returns the list of supported network configurations.
AT+CGREG?
AT+CGREG? is a read command for the GPRS registration status of the device. Receiving “registered” status from AT+CGREG? indicates that the device can access the internet.
Expected responses include +CGREG: <n>,5 and +CGREG: <n>,1.
The
nindicates the Unsolicited Result Code (URC) status,“
5” indicates that the modem is registered to a network and is roaming, and“
1” means the device is registered to the home network.
AT+CGREG=0
AT+CGREG=0 is a set command that disables the return of Unsolicited Response Codes (URCs) when network registration occurs.
In other words, there is no automated update on network registration.
AT+CGREG=1
AT+CGREG=1 is a set command that enables Unsolicited Response Codes (URCs) for the packet-switched network status.
Basically, this command tells the modem to respond when the network status changes, without having to manually check connectivity using AT+CGREG?.
AT+CGREG=2
AT+CGREG=2 is a set command that enables network registration and location information Unsolicited Result Codes (URCs).
+CREG, +CGREG & +CEREG
What are the differences between +CREG, +CGREG, and +CEREG?
+CREGqueries the registration to the circuit switched network, aka GSM networks.+CGREGand+CEREGquery registration to the packet switched networks, aka networks which allow access to the internet.+CGREGqueries the registration to GPRS network.+CEREGqueries the registration to LTE or newer network technologies.
If you’re using modems with both GPRS and LTE technologies, use both AT+CGREG? and AT+CEREG?. The modem will report <n>,4 to the technology that is currently not active.
Defined values
<n> = Network registration unsolicited result code mode.
0= Disable network registration unsolicited result code.1= Enable network registration unsolicited result code+CGREG: <stat>.2= Enable network registration and location information unsolicited result code+CGREG: <stat>[,<lac>,<ci>,<AcT>,<rac>].
<stat> = Current network registration status.
0= Not registered and the modem is not currently searching for an operator to register to.1= Registered to the home network.2= Not registered, but the modem is currently trying to attach or is searching for an operator to register to.3= Registration denied.4= Unknown.5= Registered to a roaming network.6= Registered for “SMS only”, home network (applicable only when <Act> indicates E-UTRAN)7= Registered for “SMS only”, roaming (applicable only when<Act>indicates E-UTRAN)
<lac> = Location area code.
String type; two byte location area code in hexadecimal format (e.g. “00C3” equals 195 in decimal).
<ci> = Cell ID
String type; four byte UTRAN/GERAN/E-UTRAN cell ID in hexadecimal format.
<AcT> = Access technology of the registered network.
0= GSM1= GSM Compact2= UTRAN3= GSM w/EGPRS4= UTRAN w/HSDPA5= UTRAN w/HSUPA6= UTRAN w/HSDPA and HSUPA7= E-UTRAN8= EC-GSM-IoT (A/Gb mode)9= E-UTRAN (NB-S1 mode)
Interpreting this; 0 would typically be 2G connectivity, 7 is typically LTE (including LTE-M), and 9 is typically NB-IoT.
<rac> = Routing area code.
String type; one byte routing area code in hexadecimal format.
Notes
The information in this article is predominantly based on the SIMCOM 7020 series.