Skip to main content

Device Debugging

Navigation bar

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
PortPurpose
/dev/ttyUSB0Diagnostics (DM)
/dev/ttyUSB1NMEA
/dev/ttyUSB2AT commands
/dev/ttyUSB3AT / Modem

Testing on this device shows that both ttyUSB2 and ttyUSB3 can be used as the AT port. If you are not sure, send ATI to each of ttyUSB0 through ttyUSB3; the one returning Quectel / BG96 is 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.

Tip

The AT port baud rate measured on this device is 115200; if another firmware does not respond, try 9600.


Common AT Commands​

Basic Information​

CommandDescriptionExample response
ATTest communicationOK
ATIModule model and firmware versionQuectel / BG96 / Revision: BG96MAR03A06M1G
AT+QGMRFull firmware versionBG96MAR03A06M1G_01.005.01.005
AT+CPIN?SIM card status+CPIN: READY
AT+CSQSignal quality+CSQ: 19,99
AT+QCSQDetailed signal strength+QCSQ: "GSM",-76
AT+CFUN?RF status+CFUN: 1

The first value of AT+CSQ is 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
CommandParameterDescription
AT+QCFG="nwscanmode"0Automatic (GSM + LTE)
1GSM only
3LTE only
AT+QCFG="iotopmode"0Cat M1 only
1NB-IoT only
2Cat 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​

CommandDescription
AT+CEREG?LTE (Cat M1 / NB-IoT) registration status
AT+CGREG?GPRS registration status
AT+COPS?Current operator
AT+QNWINFOCurrent network standard and frequency band
AT+CGDCONT?APN configuration
AT+CGATT?Attach status

Meaning of the registration status:

ResponseMeaning
+CEREG: 0,1Registered (home network)
+CEREG: 0,5Registered (roaming)
+CEREG: 0,2Searching
+CEREG: 0,3Registration denied
+CEREG: 0,0Not registered, not searching
Note

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​

CommandFunctionDescription
AT+CFUN=1,1Software rebootMost commonly used; the module re-registers automatically after rebooting
AT&FRestore default AT command settingsDoes not affect user data
AT+QPRTPARA=3Restore factory NV configurationClears settings such as APN and network mode
AT+QPOWD=1Power offRequires power cycling to start again
Note

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's proto qmi dials 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,1 together with a +CSQ value 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​

SymptomTroubleshooting
No response to AT commandsVerify 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 goesThe 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 timeThe module is searching for a network; check the antenna and whether the SIM has Cat M1/NB-IoT activated
+CEREG: 0,3Registration denied, usually due to SIM service/plan restrictions
No wwan0kmod-usb-net-qmi-wwan not installed
wwan0 exists but no IPConfirm the registration status with uqmi --get-serving-system, then check the APN
AI Translation Notice

This page was translated into English by AI and is provided for reference only. The original document is written in Chinese. If there is any discrepancy, the Chinese version prevails.

本页英文内容由 AI 自动翻译生成,仅供参考;原文为中文,如有差异请以中文原文为准。

查看中文原文 / View the Chinese original →