AT commands for cellular modems
A cheat-sheet of the AT commands you reach for most when bringing up and debugging a cellular module, each with a copy-ready snippet and the standard clause that defines it (3GPP TS 27.007 and 27.005). Below it, a generator that builds AT+CGDCONT from your APN and a decoder for the network-registration status.
Identification
Check the modem responds (should return OK).
Show manufacturer, model and firmware revision.
Return the module manufacturer.
Return the module model.
Return the firmware version.
Return the device IMEI.
SIM / card
Check whether the SIM needs a PIN (READY if already unlocked).
Read the subscriber IMSI (identifies country and operator).
Read the SIM's ICCID (vendor command: +CCID, +QCCID or +ICCID depending on the module).
Network & registration
Show the registered operator and access technology.
Scan available networks (slow; the modem de-registers briefly).
Circuit-switched 2G/3G network registration status.
GPRS/UMTS packet-data registration status.
EPS registration status (LTE, NB-IoT and LTE-M).
Signal
Signal quality: CSQ index and bit-error rate.
PDP context / APN
Define the PDP context with the APN before connecting.
Set the APN username, password and authentication protocol.
Activate (or deactivate) the defined PDP context.
Show the IP address assigned to the context.
Power / radio
Control the functionality level: turn the radio off or on.
SMS
Select the SMS mode (1 = text, 0 = PDU).
Send an SMS to the given number.
AT+CGDCONT generator
Compose the command that defines the PDP context from your APN.
Registration-status decoder
Enter the <stat> value from the +CREG / +CGREG / +CEREG response.
Where to start debugging
The bring-up order is the same on almost any module: first AT to confirm it responds, then AT+CPIN? to rule out a SIM PIN, then AT+CSQ to check there is signal, and AT+CEREG? (or +CREG on 2G/3G) to check network registration. Only once the registration state is 1 (home network) or 5 (roaming) does it make sense to define the data context with AT+CGDCONT, activate it with AT+CGACT and confirm the IP with AT+CGPADDR. If registration stays at 2, the modem is still searching for a network — almost always a coverage, band or operator-profile issue, not the APN configuration. If it stays at 3, the network has rejected the registration, which is usually a SIM or subscription matter, not the firmware.