> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hologram.io/llms.txt
> Use this file to discover all available pages before exploring further.

# AT command reference and troubleshooting cellular modules

> Common AT commands to configure, monitor, and troubleshoot cellular modules with examples and next steps.

## Overview

AT commands help you diagnose connectivity, SIM, registration, signal, and SMS issues. This reference includes standard 3GPP commands and vendor variations with example outputs and actions.

<Note>
  **Note:** Responses vary by vendor and firmware. Use vendor AT manuals in parallel.
</Note>

## 1. AT - Basic connectivity check

```bash theme={null}
AT
```

| Response    | Meaning                     | Next steps                |
| ----------- | --------------------------- | ------------------------- |
| OK          | Modem responsive            | —                         |
| ERROR       | Not responding to basic cmd | Check serial, baud, power |
| No response | Host not connected          | Verify hardware           |

## 2. Identify device: ATI / +CGMI / +CGMM / +CGMR / +CGSN / +GSN

```bash theme={null}
ATI
AT+CGMI
AT+CGMM
AT+CGMR
AT+CGSN
AT+GSN
```

```bash theme={null}
ATI
Quectel
BG96
Revision: BG96MAR02A07M1G
OK
```

## 3. +CPIN? - SIM status

```bash theme={null}
AT+CPIN?
```

| Response            | Meaning                   | Next steps                |
| ------------------- | ------------------------- | ------------------------- |
| +CPIN: READY        | SIM detected and unlocked | —                         |
| +CPIN: SIM PIN      | PIN required              | Enter with AT+CPIN="xxxx" |
| +CPIN: SIM PUK      | SIM blocked               | Contact SIM provider      |
| +CPIN: NOT INSERTED | SIM not detected          | Check tray/orientation    |
| +CPIN: SIM FAILURE  | SIM unreadable            | Try another SIM           |
| +CPIN: PH-SIM PIN   | SIM network lock          | Unlock with carrier code  |

## 4. +CCID - ICCID retrieval

```bash theme={null}
AT+CCID
```

```bash theme={null}
+CCID: 891234XXXXXXXXXXXXXX
OK
```

## 5. +CREG? / +CGREG? / +CEREG? - Registration status

```bash theme={null}
AT+CREG?
AT+CGREG?
AT+CEREG?
```

| Stat | Meaning              | Common causes            | Next steps              |
| ---- | -------------------- | ------------------------ | ----------------------- |
| 0    | Not registered       | Modem off, antenna issue | AT+CFUN=1, check +CPIN? |
| 1    | Registered (home)    | Normal                   | —                       |
| 2    | Searching            | Scanning                 | Wait / relocate         |
| 3    | Registration denied  | SIM blocked or wrong RAT | Check SIM/APN           |
| 4    | Unknown              | Transient                | Retry                   |
| 5    | Registered (roaming) | Normal for global SIMs   | —                       |
| 8    | Emergency only       | Weak coverage            | Move                    |

## 6. +COPS - Operator selection

```bash theme={null}
AT+COPS?
AT+COPS=?
AT+COPS=mode,format,oper,AcT
```

* **Modes**: 0 Auto, 1 Manual, 2 Deregister, 4 Manual/auto fallback
* **Formats**: 0 Long name, 1 Short name, 2 Numeric MCCMNC
* **AcT**: 0 GSM, 2 UTRAN, 7 LTE, 8 LTE-M, 9 NB-IoT

```bash theme={null}
+COPS: 0,0,"T-Mobile",8
+COPS: 1,2,"310260",7
```

## 7. +CSQ - Signal strength

```bash theme={null}
AT+CSQ
```

| RSSI  | dBm         | Meaning    | Action             |
| ----- | ----------- | ---------- | ------------------ |
| 0     | ≤ -113      | No signal  | Check antenna      |
| 1-9   | -111 to -93 | Very weak  | Relocate           |
| 10-14 | -91 to -81  | Weak       | Expect drops       |
| 15-19 | -79 to -69  | Fair       | May drop           |
| 20-24 | -67 to -57  | Good       | —                  |
| 25-30 | -55 to -45  | Strong     | —                  |
| 31    | ≥ -51       | Excellent  | —                  |
| 99    | Unknown     | Not camped | Check registration |

## 8. +CESQ - Extended signal quality

```bash theme={null}
AT+CESQ
```

* RSRP (dBm) = -140 + rsrp
* RSRQ (dB) = -19.5 + (rsrq × 0.5)

## 9. +CGATT / +CGACT - Attach and activate PDP

```bash theme={null}
AT+CGATT?
AT+CGATT=1
AT+CGACT?
AT+CGACT=1,1
```

| Response  | Meaning      | Next steps                      |
| --------- | ------------ | ------------------------------- |
| +CGATT: 1 | Attached     | —                               |
| +CGATT: 0 | Not attached | Check SIM, signal, registration |

## 10. +CGDCONT - Define PDP context

```bash theme={null}
AT+CGDCONT=<cid>,"<PDP_type>","<APN>"
```

```bash theme={null}
AT+CGDCONT=1,"IP","hologram"
```

## 11. +CNMI - New SMS indication

```bash theme={null}
AT+CNMI=<mode>,<mt>,<bm>,<ds>,<bfr>
```

```bash theme={null}
AT+CNMI=2,1,0,1,1
```

## 12. +CMGF - SMS message format

```bash theme={null}
AT+CMGF=<mode>
```

| Mode | Meaning               |
| ---- | --------------------- |
| 0    | PDU (raw hex)         |
| 1    | Text (human-readable) |

## 13. +CSCA - SMSC address

```bash theme={null}
AT+CSCA?
AT+CSCA="<SMSC_number>",<type>
```

```bash theme={null}
+CSCA: "+1234567890",145
```

## 14. +CMGS - Send SMS

```bash theme={null}
AT+CMGF=1
AT+CMGS="+1234567890"
>Hello World<CTRL+Z>
+CMGS: 45
OK
```

## 15. +CME ERROR - Equipment errors

```bash theme={null}
+CME ERROR: 10   // SIM not inserted
+CME ERROR: 30   // No network service
```

## 16. +CMS ERROR - SMS errors

```bash theme={null}
+CMS ERROR: 1   // Unassigned number
+CMS ERROR: 27  // Invalid SMSC
```

## 17. +CFUN - Functionality level

```bash theme={null}
AT+CFUN?
AT+CFUN=<fun>[,<rst>]
```

## 18. +CGEREP - Packet domain event reporting

```bash theme={null}
AT+CGEREP=<mode>,<bfr>
```

## 19. +CGPADDR - Show PDP address

```bash theme={null}
AT+CGPADDR[=<cid>]
```

## 20. +CGCONTRDP - Read PDP context parameters

```bash theme={null}
AT+CGCONTRDP=<cid>
```

## 21. +COPS=? - Network scan

```bash theme={null}
+COPS: (1,"T-Mobile","TMO","310260",8),
       (1,"AT&T","ATT","310410",7)
```

## 22. +CSCON - RRC connection status

```bash theme={null}
AT+CSCON?
```

## 23. +CEDRXS / +CPSMS - Power saving modes

```bash theme={null}
AT+CEDRXS=<mode>,<AcT_type>,<eDRX_value>
AT+CPSMS=<mode>[,<Requested_PeriodicTAU>,<Requested_Active_Time>]
```

## 24. 3GPP reject cause codes

| Code | Meaning                    | Action              |
| ---- | -------------------------- | ------------------- |
| 2    | IMSI unknown               | SIM not active      |
| 3    | Illegal MS                 | Contact provider    |
| 7    | GPRS not allowed           | SIM plan issue      |
| 15   | No suitable cells          | Move/check bands    |
| 33   | Service option unsupported | APN issue           |
| 40   | No EPS bearer              | LTE network problem |

## Appendix - Vendor-specific commands

### Quectel

* AT+QNWINFO - Network & RAT info
* AT+QENG="servingcell" - Serving cell
* AT+QCSQ - Extended signal
* AT+QCFG - RAT/band selection

### SIMCom

* AT+CSERVINFO - Service info
* AT+CNETSCAN - Scan with metrics
* AT+CSQEXT - Extended CSQ

### u-blox

* AT+URAT - RAT selection
* AT+UBANDMASK - Band mask
* AT+UCGED - Cell info
