Skip to main content
AT+CEREG: Modes, parameters, and examples

This article is a practical overview of how to use the AT+CEREG command.

P
Written by Peter Skov Bornerup
Updated over a month ago

AT+CEREG is an AT command for the registration status of the device for LTE or newer cellular network technologies.

Overview

Command

Example response(s)

Info

AT+CEREG=?

+CEREG: <n>

Checks for supported configurations.

<n> = list of supported configurations.

AT+CEREG?

+CEREG: <n>,<stat>
OK

+CEREG: <n>,5
OK

+CEREG: <n>,1
OK

Get the current registration status.

<n> = current configuration value.

<stat> = network registration status.

Example: <stat> = 1 means the device is registered to the home network and 5 means it's registered to a roaming network.

AT+CEREG=0

OK

Unsubscribe from Unsolicited Result Codes.

AT+CEREG=1

OK

Subscribe to Unsolicited Result Codes:
+CEREG:<stat>

AT+CEREG=2

OK

Subscribe to Unsolicited Result Codes:
+CEREG:<stat>[,<tac>,<ci>,<AcT>]

AT+CEREG=3

OK

Subscribe to Unsolicited Result Codes:
+CEREG:<stat>[,<tac>,<ci>,<AcT>[,<cause_type>,<reject_cause>]]

AT+CEREG=4

OK

Subscribe to Unsolicited Result Codes:
+CEREG: <stat>[,[<tac>],[<ci>],[<AcT>][,,[,[<Active-Time>],[<Periodic-TAU>]]]]

AT+CEREG=5

OK

Subscribe to Unsolicited Result Codes:
+CEREG: <stat>[,[<tac>],[<ci>],[<AcT>][,[<cause_type>],[<reject_cause>][,[<Active-Time>],[<Periodic-TAU>]]]]

AT+CEREG=?

The test command AT+CEREG=? returns a list of supported modes.

The response syntax is:

+CEREG: <n>

Where <n> denotes the number of supported modes. For example, +CEREG: (0-5).

AT+CEREG?

AT+CEREG? is a read command that queries the registration status of devices with LTE or newer technology. Receiving a “registered” status indicates that the device can access the internet.

Expected responses come in this format:

+CEREG: <n>,<stat>

The <n> indicates the Unsolicited Result Code (URC) status and <stat> indicates the registered status.

Some devices return far more values. AT+CEREG? For the nRF9160 returns the following response syntax, for example:

+CEREG: <n>,<stat>[,[<tac>],[<ci>],[<AcT>][,<cause_type>],[<reject_cause>][,[<Active-Time>],[<Periodic-TAU>]]]]

The value definitions can be found at the bottom of this article.

AT+CEREG=0

This disables the network registration Unsolicited Result Code (aka. unsubscribe from URCs).

AT+CEREG=1

This command enables Unsolicited Response Codes (URCs) for the packet-switched network status. Basically, this tells the modem to respond when the network status changes, without having to check connectivity using AT+CEREG?.

AT+CEREG=2

This command enables Unsolicited Response Codes (URCs) for the packet-switched network status and returns extra information.

The syntax is:

+CEREG:<stat>[,<tac>,<ci>,<AcT>]


AT+CEREG=3

This command enables Unsolicited Response Codes (URCs) for the packet-switched network status and returns extra information.

The syntax is:

+CEREG:<stat>[,<tac>,<ci>,<AcT>[,<cause_type>,<reject_cause>]]

AT+CEREG=4

This command enables Unsolicited Response Codes (URCs) for the packet-switched network status and returns extra information.

The syntax is:

+CEREG:<stat>[,[<tac>],[<ci>],[<AcT>][,,[,[<Active-Time>],[<Periodic-TAU>]]]]

AT+CEREG=5

This command enables Unsolicited Response Codes (URCs) for the packet-switched network status and returns extra information.

The syntax is:​

+CEREG:<stat>[,[<tac>],[<ci>],[<AcT>][,[<cause_type>],[<reject_cause>][,[<Active-Time>],[<Periodic-TAU>]]]]

+CREG vs. +CGREG vs. +CEREG

What are the differences between +CREG, +CGREG, and +CEREG?

+CREG queries the registration to the circuit switched network, aka. GSM networks.

  • +CGREG and +CEREG query registration to the packet switched networks, aka. networks which allow access to the internet.

  • +CGREG queries the registration to GPRS network.

  • +CEREG queries the registration to LTE or newer network technologies.

  • If you are using modems with both GPRS and LTE technologies, use both AT+CGREG? and AT+CEREG?. The modem will report x,4 to the technology that is currently not active.

Defined values

<n> = Network registration unsolicited result code mode.

  • 0 = Unsubscribe unsolicited result codes

  • 1 = Subscribe unsolicited result codes +CEREG:<stat>

  • 2 = Subscribe unsolicited result codes +CEREG:<stat>[,<tac>,<ci>,<AcT>]

  • 3 = Subscribe unsolicited result codes +CEREG:<stat>[,<tac>,<ci>,<AcT>[,<cause_type>,<reject_cause>]]

  • 4 = Subscribe unsolicited result codes +CEREG: <stat>[,[<tac>],[<ci>],[<AcT>][,,[,[<Active-Time>],[<Periodic-TAU>]]]]

  • 5 = Subscribe unsolicited result codes +CEREG: <stat>[,[<tac>],[<ci>],[<AcT>][,[<cause_type>],[<reject_cause>][,[<Active-Time>],[<Periodic-TAU>]]]]

<stat> = Current network registration status.

  • 0 = Not registered. User Equipment (UE) is not currently searching for an operator to register to.

  • 1 = Registered, home network

  • 2 = Not registered, but UE is currently trying to attach or searching an operator to register to

  • 3 = Registration denied

  • 4 = Unknown (for example, out of Evolved Terrestrial Radio Access Network (E-UTRAN) coverage)

  • 5 = Registered, roaming

  • 90 = Not registered due to Universal Integrated Circuit Card (UICC) failure

<tac> = String in hexadecimal format.

2-byte Tracking Area Code (TAC).

<ci> = String in hexadecimal format.

4-byte E-UTRAN cell ID.

<AcT> = Radio access technology.

  • 7 = E-UTRAN

  • 9 = E-UTRAN NB-S1

<cause_type>

0 = <reject_cause> contains an EPS Mobility Management (EMM) cause value. See 3GPP TS 24.301 Annex A.

<reject_cause>

EMM cause value. See 3GPP TS 24.301 Annex A

<Active-Time> = Active Time value allocated to the device in E-UTRAN.

String. 1 byte in 8-bit format.

Indicates the Active Time value (T3324) allocated to the device in E-UTRAN. For the coding and value range, see the GPRS Timer 2 IE in 3GPP TS 24.008 Table 10.5.163/3GPP TS 24.008.

The device can enter Power Saving Mode (PSM) state in LTE idle mode when the

<Active-Time> parameter has a valid value where at least one of bits 6–8 is set to 0. The length of PSM sleep is the value that remains from the value configured for periodic TAU after active time has elapsed, which is T3324 subtracted from T3412.

<Periodic-TAU> = The extended periodic TAU value allocated to the device in E-UTRAN.

String. 1 byte in 8-bit format.

Indicates the extended periodic Tracking Area Update (TAU) value (T3412) allocated to the device in E-UTRAN. For the coding and value range, see the GPRS Timer 3 IE in 3GPP TS 24.008 Table 10.5.163a/3GPP TS 24.008.

A deactivated value where bits 6–8 are set to 1 after a successful LTE Attach or TAU means that the network configures the periodic TAU or PSM cycle length using a non-extended format with General Packet Radio Services (GPRS) timer instead of GPRS timer 3. The configured value of T3412 can be read with the %XMONITOR command. The response includes the value in a format selected by the network.

The command parameters and their defined values listed in this article are mostly based on the Nordic Semiconductor nRF9160 series.

Did this answer your question?