Device Debugging

Check the BG96 status over the USB serial port and QMI, switch network modes, and perform a factory reset.
Serial Connection
Checking the Serial Ports
root@OpenWrt:~# ls /dev/ttyUSB*
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3
| Port | Purpose |
|---|---|
/dev/ttyUSB0 | Diagnostics (DM) |
/dev/ttyUSB1 | NMEA |
/dev/ttyUSB2 | AT commands |
/dev/ttyUSB3 | AT / Modem |
Testing on this device shows that both
ttyUSB2andttyUSB3can be used as the AT port. If you are not sure, sendATIto each ofttyUSB0throughttyUSB3; the one returningQuectel / BG96is the AT port.
Starting minicom
minicom -D /dev/ttyUSB2 -b 115200
Send AT; a reply of OK means communication is working:
AT
OK
To exit: press Ctrl + A, then X, and select Yes.
The AT port baud rate measured on this device is 115200; if another firmware does not respond, try 9600.
Common AT Commands
Basic Information
| Command | Description | Example response |
|---|---|---|
AT | Test communication | OK |
ATI | Module model and firmware version | Quectel / BG96 / Revision: BG96MAR03A06M1G |
AT+QGMR | Full firmware version | BG96MAR03A06M1G_01.005.01.005 |
AT+CPIN? | SIM card status | +CPIN: READY |
AT+CSQ | Signal quality | +CSQ: 19,99 |
AT+QCSQ | Detailed signal strength | +QCSQ: "GSM",-76 |
AT+CFUN? | RF status | +CFUN: 1 |
The first value of
AT+CSQis the signal strength (0~31, higher is better; 99 means unknown).
Network Mode
AT+QCFG="nwscanmode"
+QCFG: "nwscanmode",0
AT+QCFG="iotopmode"
+QCFG: "iotopmode",0
| Command | Parameter | Description |
|---|---|---|
AT+QCFG="nwscanmode" | 0 | Automatic (GSM + LTE) |
| 1 | GSM only | |
| 3 | LTE only | |
AT+QCFG="iotopmode" | 0 | Cat M1 only |
| 1 | NB-IoT only | |
| 2 | Cat M1 + NB-IoT |
The module must be restarted after setting:
AT+QCFG="nwscanmode",3
OK
AT+QCFG="iotopmode",2
OK
AT+CFUN=1,1
OK
NB-IoT attaches slowly; registration may take 1~3 minutes.
USB Mode
AT+QCFG="usbnet"
ERROR
AT+QCFGEXT="usbnet"
ERROR
The current BG96 firmware does not support USB composition switching; the USB interfaces are fixed at five: DIAG / NMEA / AT / AT-Modem / QMI. Data connectivity must use QMI (
/dev/cdc-wdm0).
Registration and Data Status
| Command | Description |
|---|---|
AT+CEREG? | LTE (Cat M1 / NB-IoT) registration status |
AT+CGREG? | GPRS registration status |
AT+COPS? | Current operator |
AT+QNWINFO | Current network standard and frequency band |
AT+CGDCONT? | APN configuration |
AT+CGATT? | Attach status |
Meaning of the registration status:
| Response | Meaning |
|---|---|
+CEREG: 0,1 | Registered (home network) |
+CEREG: 0,5 | Registered (roaming) |
+CEREG: 0,2 | Searching |
+CEREG: 0,3 | Registration denied |
+CEREG: 0,0 | Not registered, not searching |
Running AT+COPS=? in a no-service environment may not respond for a long time and can block the AT port (in testing on this device, AT stopped responding).
In this case, power cycle or replug the module to recover; do not keep sending commands.
Reset and Reboot
| Command | Function | Description |
|---|---|---|
AT+CFUN=1,1 | Software reboot | Most commonly used; the module re-registers automatically after rebooting |
AT&F | Restore default AT command settings | Does not affect user data |
AT+QPRTPARA=3 | Restore factory NV configuration | Clears settings such as APN and network mode |
AT+QPOWD=1 | Power off | Requires power cycling to start again |
AT+QPRTPARA=3 is a factory reset operation; run AT+CFUN=1,1 afterwards to reboot.
After the reboot, the APN, nwscanmode and iotopmode all return to their defaults and must be reconfigured.
QMI Debugging
Checking the Registration Status
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-serving-system
{
"registration": "registered",
"plmn_mcc": 460,
"plmn_mnc": 11,
"radio_interface": [
"lte"
]
}
When not registered:
{
"registration": "searching",
"radio_interface": [
"none"
]
}
Checking the Signal
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
Viewing / Changing the Operating Mode
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-device-mode
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --set-device-mode low-power
Routine debugging does not require a manual
--start-network; OpenWrt'sproto qmidials automatically.
Complete Check Sequence
AT
OK
ATI
Quectel
BG96
Revision: BG96MAR03A06M1G
OK
AT+CPIN?
+CPIN: READY
OK
AT+CSQ
+CSQ: 19,99
OK
AT+CEREG?
+CEREG: 0,1
OK
AT+QNWINFO
+QNWINFO: "CAT-NB1","46011","LTE BAND 5",2405
OK
AT+CGDCONT?
+CGDCONT: 1,"IPV4V6","ctnet",...
OK
+CEREG: 0,1together with a+CSQvalue other than 99 means the module has registered successfully.
Complete Reset Sequence
AT
OK
AT&F
OK
AT+QPRTPARA=3
OK
AT+CFUN=1,1
OK
Wait 30~60 seconds for the module to re-enumerate, then follow Quick Install - Linux / OpenWrt to configure the network mode and QMI connectivity.
FAQ
| Symptom | Troubleshooting |
|---|---|
| No response to AT commands | Verify the port and baud rate; try ttyUSB2 / ttyUSB3 and 115200 / 9600 |
AT stops responding entirely after AT+COPS=? | Scan blocking; replug the module to power-cycle |
| No AT response and the serial port comes and goes | The module is repeatedly re-enumerating on USB; dmesg shows USB disconnect; use a powered hub / verify the SIM service |
+CSQ: 99,99 persists for a long time | The module is searching for a network; check the antenna and whether the SIM has Cat M1/NB-IoT activated |
+CEREG: 0,3 | Registration denied, usually due to SIM service/plan restrictions |
No wwan0 | kmod-usb-net-qmi-wwan not installed |
wwan0 exists but no IP | Confirm the registration status with uqmi --get-serving-system, then check the APN |