This project provides manual start/stop scripts for bringing up a USB-attached LTE/5G modem on Linux using QMI.
It is designed for:
- Development & debugging
- Laptops, Raspberry Pi, Jetson
- Full control (no auto-connect, no boot-time services)
- Starts a cellular data session using QMI
- Brings up the
wwan0network interface - Obtains an IP address via DHCP
- Cleanly tears down the connection on demand
No NetworkManager automation. No systemd auto-start. You decide when the modem is up or down.
- USB or M.2 LTE/5G modem (SIMCom / Qualcomm-based)
- SIM card with active data plan
- Proper antennas connected
- Stable power (USB 3.0, laptop plugged in)
-
Linux kernel with QMI support
-
Packages:
sudo apt install libqmi-utils udhcpc
5g/
├── 5g-up.sh # Start LTE/5G data connection
├── 5g-down.sh # Stop LTE/5G data connection
└── 5g-status.sh # (Optional) Check modem status
chmod +x 5g-up.sh 5g-down.sh 5g-status.sh./5g-up.shWhat this does:
- Checks if a data session is already active
- Starts a QMI data session if needed
- Brings up
wwan0 - Requests an IP address via DHCP
If successful, you’ll see an IP like:
inet 100.x.x.x/30 dev wwan0
./5g-down.shWhat this does:
- Stops DHCP
- Brings
wwan0down - Stops the QMI data session (best-effort)
NoEffect errors are normal and safely ignored.
./5g-status.shShows:
wwan0interface state- QMI packet service status
Edit 5g-up.sh and change:
APN="jionet"Common APNs (India):
| Carrier | APN |
|---|---|
| Jio | jionet |
| Airtel | airtelgprs.com |
| VI | www |
- The script is idempotent
Running
5g-up.shmultiple times is safe. - QMI control endpoints may reset — this is normal.
- DHCP succeeding means the data session is active.
- IP addresses are usually CGNAT (100.64.0.0/10).
sudo qmicli -d /dev/cdc-wdm1 --device-open-proxy \
--nas-get-signal-strengthsudo qmicli -d /dev/cdc-wdm1 --device-open-proxy \
--nas-get-system-infosudo qmicli -d /dev/cdc-wdm1 --device-open-proxy \
--wds-get-packet-service-status- Manual > automatic
- Explicit control over boot-time magic
- Transparent QMI behavior
- Debuggable and predictable
This setup mirrors how embedded systems and field devices are typically operated.
MIT (scripts only)