Skip to content

ResQTerra/5G-Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LTE / 5G Modem Manual Control (QMI, Linux)

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)

What This Does

  • Starts a cellular data session using QMI
  • Brings up the wwan0 network 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.


Requirements

Hardware

  • 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)

Software

  • Linux kernel with QMI support

  • Packages:

    sudo apt install libqmi-utils udhcpc

Files

5g/
├── 5g-up.sh      # Start LTE/5G data connection
├── 5g-down.sh    # Stop LTE/5G data connection
└── 5g-status.sh  # (Optional) Check modem status

Usage

1. Make scripts executable

chmod +x 5g-up.sh 5g-down.sh 5g-status.sh

2. Start LTE / 5G connection

./5g-up.sh

What this does:

  1. Checks if a data session is already active
  2. Starts a QMI data session if needed
  3. Brings up wwan0
  4. Requests an IP address via DHCP

If successful, you’ll see an IP like:

inet 100.x.x.x/30 dev wwan0

3. Stop LTE / 5G connection

./5g-down.sh

What this does:

  • Stops DHCP
  • Brings wwan0 down
  • Stops the QMI data session (best-effort)

NoEffect errors are normal and safely ignored.


4. Check status (optional)

./5g-status.sh

Shows:

  • wwan0 interface state
  • QMI packet service status

Configuration

APN

Edit 5g-up.sh and change:

APN="jionet"

Common APNs (India):

Carrier APN
Jio jionet
Airtel airtelgprs.com
VI www

Notes & Behavior

  • The script is idempotent Running 5g-up.sh multiple 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).

Troubleshooting

Check signal

sudo qmicli -d /dev/cdc-wdm1 --device-open-proxy \
  --nas-get-signal-strength

Check registration

sudo qmicli -d /dev/cdc-wdm1 --device-open-proxy \
  --nas-get-system-info

Check packet service

sudo qmicli -d /dev/cdc-wdm1 --device-open-proxy \
  --wds-get-packet-service-status

Design Philosophy

  • 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.


License

MIT (scripts only)


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages