Skip to main content

Quick Install - Linux / OpenWrt

Navigation bar

BG96 Installation​

Quickly get started with the BG96 LTE Cat M1 / NB-IoT Dongle on Linux / OpenWrt

Prerequisites​

  1. A Linux device (this article uses an OpenWrt / ImmortalWrt router as an example)
  2. Dongle BG96 and a USB data cable
  3. A Nano-SIM card with LTE Cat M1 or NB-IoT activated
  4. The router's WAN port has working Internet access (for downloading drivers)
Important

The USB behavior of the BG96 differs from that of the EC20/EC25/EG25:

  • The USB composition of the BG96 is fixed; the firmware has no AT+QCFG="usbnet" / AT+QCFGEXT="usbnet" (both return ERROR in testing)
  • Data connectivity uses QMI (/dev/cdc-wdm0 + wwan0), which requires kmod-usb-net-qmi-wwan + uqmi
  • A regular 4G SIM card cannot be used with the BG96; the SIM must have Cat M1 / NB-IoT service activated, otherwise the module stays in the network search state indefinitely

Connecting the Device​

Installing the Nano-SIM Card​

Image

  1. If the device has a USB protective cover, remove it first (skip this step for bare-board devices without an enclosure)
  2. Push the Nano-SIM card into the slot in the direction indicated on the slot

Connecting to the Router USB Port​

Note: The BG96 draws a large transient current when registering on the network; insufficient USB power on some routers causes the module to reboot repeatedly (consecutive USB disconnect messages in dmesg). A USB hub with an independent power supply is recommended.


Configuring the Dongle - Router Side​

Connecting to the Router​

ssh root@192.168.1.1

Checking the USB Device​

root@OpenWrt:~# lsusb

Expected output:

Bus 001 Device 002: ID 2c7c:0296 Quectel Wireless Solutions Co., Ltd. BG96 CAT-M1/NB-IoT modem

If lsusb: not found is reported:

# opkg
opkg update && opkg install usbutils

# apk
apk update && apk add usbutils

Viewing the USB Interface Composition​

root@OpenWrt:~# for i in /sys/bus/usb/devices/1-1:1.*; do echo "$i $(cat $i/bInterfaceClass)/$(cat $i/bInterfaceSubClass)/$(cat $i/bInterfaceProtocol)"; done

The BG96 always has 5 interfaces:

InterfaceClassPurpose
1-1:1.0ff/ff/ffDIAG
1-1:1.1ff/ff/ffNMEA
1-1:1.2ff/ff/ffAT
1-1:1.3ff/fe/ffAT / Modem
1-1:1.4ff/ff/ffQMI

Installing Drivers and Tools​

USB serial driver (for AT commands):

# opkg
opkg update
opkg install kmod-usb-serial-option

# apk
apk update
apk add kmod-usb-serial-option

QMI driver and dialing tool:

# opkg
opkg install kmod-usb-net-qmi-wwan uqmi

# apk
apk add kmod-usb-net-qmi-wwan uqmi

Serial terminal tool:

# opkg
opkg install minicom

# apk
apk add minicom

After installation, confirm:

root@OpenWrt:~# ls /dev/ttyUSB* /dev/cdc-wdm* /sys/class/net/wwan0

Expected output:

/dev/cdc-wdm0
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3
/sys/class/net/wwan0

The ECM network adapter of the EC20/EC25 is usb0; the BG96 uses QMI, so you see wwan0 + /dev/cdc-wdm0.

AT Serial Port​

root@OpenWrt:~# ls /dev/ttyUSB*

On the BG96, both /dev/ttyUSB2 and /dev/ttyUSB3 usually work as the AT port; the baud rate measured on this device is 115200.

If you are not sure, send ATI to each of /dev/ttyUSB0 through /dev/ttyUSB3; the one returning Quectel / BG96 is the AT port.


Factory Reset​

Note

A reset clears the APN, frequency bands, network search mode and other settings. It is recommended for new devices or when the configuration is in disarray.

1. Enter the AT Terminal​

minicom -D /dev/ttyUSB2 -b 115200

2. Restore Factory Settings and Reboot​

AT&F
OK

AT+QPRTPARA=3
OK

AT+CFUN=1,1
OK

After the reboot, USB re-enumerates; wait 30~60 seconds.

After the reset, the APN, nwscanmode and iotopmode all return to their defaults and must be reconfigured.

3. Exit minicom​

Press Ctrl + A, then X, and select Yes.


Setting the Network Mode​

The BG96 supports LTE Cat M1, NB-IoT and GSM/EGPRS. Cat M1 / NB-IoT in mainland China mainly use LTE bands, so it is recommended to disable 2G network search:

AT+QCFG="nwscanmode",3
OK

AT+QCFG="iotopmode",2
OK

AT+CFUN=1,1
OK
CommandParameterDescription
AT+QCFG="nwscanmode"0Automatic (GSM + LTE)
1GSM only
3LTE only
AT+QCFG="iotopmode"0Cat M1 only
1NB-IoT only
2Cat M1 + NB-IoT

NB-IoT attaches slowly; after a reboot it may take 1~3 minutes to register, during which +CSQ: 99,99 and +CEREG: 0,2 are normal.

Configuring the APN​

AT+CGDCONT=1,"IPV4V6","ctnet"
OK

AT+CFUN=1,1

The APN must follow the carrier's requirements. Even if the APN of a regular 4G SIM (such as ctnet) is entered correctly, the module cannot register without Cat M1 / NB-IoT service activated.


Configuring Internet Access (QMI)​

Option 1: Command Line (UCI)​

Single-WAN scenario:

uci set network.wan.proto='qmi'
uci set network.wan.device='/dev/cdc-wdm0'
uci set network.wan.apn='ctnet'

uci commit network
service network reload

Multi-WAN scenario (cellular as backup):

uci set network.wan3=interface
uci set network.wan3.proto='qmi'
uci set network.wan3.device='/dev/cdc-wdm0'
uci set network.wan3.apn='ctnet'
uci set network.wan3.metric='20'

uci commit network
service network reload

The smaller the metric value, the higher the priority; keep the primary link at 0 and set the cellular link to 20.

Option 2: Web Interface​

  1. Open Network → Interfaces → Add new interface
  2. Select QMI Cellular as the protocol
  3. Select /dev/cdc-wdm0 as the device
  4. Enter the APN
  5. Click Save → Save & Apply

About IPv6​

IPv6 on the QMI interface is obtained by wan6 over DHCPv6 on wwan0:

uci set network.wan6.proto='dhcpv6'
uci set network.wan6.device='wwan0'
uci commit network
service network reload

Verification​

Checking the Interface Status​

root@OpenWrt:~# ifstatus wan

Confirm "up": true and that a 10.x.x.x or carrier-assigned address has been obtained.

Checking the Routes​

root@OpenWrt:~# ip route

Testing Internet Access​

root@OpenWrt:~# ping -I wwan0 -c 3 223.5.5.5

Checking the Registration Status with QMI​

root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-serving-system
{
"registration": "registered",
"plmn_mcc": 460,
"plmn_mnc": 11,
"radio_interface": [
"lte"
]
}

"registration": "searching" means not yet registered; "radio_interface": ["none"] means the module is not camped on any network.


Findings on This Device

Tested on ImmortalWrt 25.12.2 (MT7981, kernel 6.12):

  • Module BG96, firmware BG96MAR03A06M1G_01.005.01.005
  • USB ID 2c7c:0296, fixed 5 interfaces, enumerated as /dev/ttyUSB0 ~ /dev/ttyUSB3, /dev/cdc-wdm0 and wwan0
  • The firmware does not support AT+QCFG="usbnet" / AT+QCFGEXT="usbnet" (both return ERROR), so it cannot be switched to ECM/RNDIS
  • After a factory reset, no usbnet-related configuration exists; data can only go through QMI
  • Tested with a regular China Telecom 4G SIM (ctnet): the SIM was recognized (+CPIN: READY)
    • With nwscanmode=3 + iotopmode=1 (NB-IoT only), the module once camped on CAT-NB1 (46011, LTE BAND 5, EARFCN 2405), but the signal was very weak (+CSQ: 5,99) and registration was denied: +CEREG: 0,3
    • With iotopmode=0 (Cat M1 only) there was no service at all: +QNWINFO: No Service
    • In automatic mode (nwscanmode=0), GSM 900 (46000, China Mobile) could be scanned, but the China Telecom SIM could not register on that network
  • Therefore the data dial-up verification could not be completed
  • During the NB-IoT network search and registration-denied phase, the module re-enumerated on USB roughly every 60~100 seconds (USB disconnect → re-enumeration), and the AT port briefly disappeared each time

Conclusion: The BG96 must use a SIM card with Cat M1 / NB-IoT activated; a regular 4G SIM will be rejected by the network (+CEREG: 0,3). The data configuration procedure in this article awaits retesting with a suitable SIM.

If USB repeatedly reconnects under weak signal or failed network search, a USB hub with an independent power supply is recommended.

In addition: AT+COPS=? may not respond for a long time in a no-service environment and can cause the AT port to stop responding, requiring a power cycle or replugging the module to recover.


FAQ​

SymptomCauseSolution
lsusb does not show 2c7c:0296USB not enumerated / insufficient powerUse another USB port or a powered hub
No /dev/ttyUSB*Serial driver not installedInstall kmod-usb-serial-option
No /dev/cdc-wdm0 / wwan0QMI driver not installedInstall kmod-usb-net-qmi-wwan
wwan0 exists but no IPNot registered / wrong APNCheck the registration status with uqmi --get-serving-system
Stuck at +CEREG: 0,2SIM has no Cat M1/NB-IoT service or no coverageUse a suitable SIM and confirm nwscanmode=3, iotopmode=2
+CEREG: 0,3 registration deniedSIM has no corresponding service / rejected by the carrierUse a SIM with NB-IoT / Cat M1 activated
AT port suddenly stops respondingAT+COPS=? scan blockingReplug the module to power-cycle and recover
Module keeps reconnectingInsufficient USB power / abnormal network searchUse a powered hub and confirm whether the SIM service is activated

For AT commands and registration checks, see Device Debugging.

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 →