Quick Install - Linux / OpenWrt

BG96 Installation
Quickly get started with the BG96 LTE Cat M1 / NB-IoT Dongle on Linux / OpenWrt
Prerequisites
- A Linux device (this article uses an OpenWrt / ImmortalWrt router as an example)
- Dongle BG96 and a USB data cable
- A Nano-SIM card with LTE Cat M1 or NB-IoT activated
- The router's WAN port has working Internet access (for downloading drivers)
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 returnERRORin testing) - Data connectivity uses QMI (
/dev/cdc-wdm0+wwan0), which requireskmod-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

- If the device has a USB protective cover, remove it first (skip this step for bare-board devices without an enclosure)
- 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 disconnectmessages indmesg). 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:
| Interface | Class | Purpose |
|---|---|---|
1-1:1.0 | ff/ff/ff | DIAG |
1-1:1.1 | ff/ff/ff | NMEA |
1-1:1.2 | ff/ff/ff | AT |
1-1:1.3 | ff/fe/ff | AT / Modem |
1-1:1.4 | ff/ff/ff | QMI |
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 seewwan0+/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
ATIto each of/dev/ttyUSB0through/dev/ttyUSB3; the one returningQuectel / BG96is the AT port.
Factory Reset
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,
nwscanmodeandiotopmodeall 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
| 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 |
NB-IoT attaches slowly; after a reboot it may take 1~3 minutes to register, during which
+CSQ: 99,99and+CEREG: 0,2are 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
0and set the cellular link to20.
Option 2: Web Interface
- Open
Network→Interfaces→ Add new interface - Select
QMI Cellularas the protocol - Select
/dev/cdc-wdm0as the device - Enter the
APN - 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.
Tested on ImmortalWrt 25.12.2 (MT7981, kernel 6.12):
- Module
BG96, firmwareBG96MAR03A06M1G_01.005.01.005 - USB ID
2c7c:0296, fixed 5 interfaces, enumerated as/dev/ttyUSB0~/dev/ttyUSB3,/dev/cdc-wdm0andwwan0 - The firmware does not support
AT+QCFG="usbnet"/AT+QCFGEXT="usbnet"(both returnERROR), 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 onCAT-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
- With
- 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
| Symptom | Cause | Solution |
|---|---|---|
lsusb does not show 2c7c:0296 | USB not enumerated / insufficient power | Use another USB port or a powered hub |
No /dev/ttyUSB* | Serial driver not installed | Install kmod-usb-serial-option |
No /dev/cdc-wdm0 / wwan0 | QMI driver not installed | Install kmod-usb-net-qmi-wwan |
wwan0 exists but no IP | Not registered / wrong APN | Check the registration status with uqmi --get-serving-system |
Stuck at +CEREG: 0,2 | SIM has no Cat M1/NB-IoT service or no coverage | Use a suitable SIM and confirm nwscanmode=3, iotopmode=2 |
+CEREG: 0,3 registration denied | SIM has no corresponding service / rejected by the carrier | Use a SIM with NB-IoT / Cat M1 activated |
| AT port suddenly stops responding | AT+COPS=? scan blocking | Replug the module to power-cycle and recover |
| Module keeps reconnecting | Insufficient USB power / abnormal network search | Use a powered hub and confirm whether the SIM service is activated |
For AT commands and registration checks, see Device Debugging.