Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Band Controller — KernelSU Module

Web UI for LTE/NR band locking on Qualcomm devices via Network Signal Guru (NSG).

What It Does

Provides a web-based interface to enable/disable specific LTE and NR (5G) bands on Android devices with Qualcomm modems. Useful for:

  • Avoiding problematic bands that cause connection drops
  • Locking to specific bands for testing
  • Optimizing signal quality by disabling weak bands

How It Works

  1. Web UI (Python HTTP server on localhost:8080)
  2. Backend writes to NSG's force_qualcomm.xml configuration
  3. NSG applies band configuration to modem via diag interface
  4. Modem remembers band preferences in NV items (persists across reboots)

Current Status

Feature Status
Web UI reads band config ✅ Working
Web UI writes band config ✅ Working
NSG applies bands ✅ Working
Config persists reboot ✅ Working
Web server auto-starts ✅ Working
NSG dependency ⚠️ Required for modem communication
Band enforcement verified ⚠️ Partial (diag confirmed open)

Verified Evidence

Post-Reboot Trace Log

23:39:10.701 - initialized /dev/diag,5,1

NSG opens diag and maintains session. No "stop" or "cleanup" messages — diag stays active.

Diag Device Status

Multiple processes hold /dev/diag open:

  • audioserver
  • bluetooth
  • system
  • root (NSG)

Band Configuration

  • LTE bands enabled: 1, 2, 3, 4, 5, 8, 12, 17, 20, 28, 38, 40, 41
  • LTE bands disabled: 6, 7, 66 (problematic bands)
  • NR bands enabled: 1, 3, 5, 8, 20, 28, 38, 41, 77, 78
  • NR bands disabled: 7, 66

Installation

Prerequisites

  • Rooted Android device with KernelSU
  • Network Signal Guru (NSG) installed
  • Termux installed (for Python)

Install Module

adb push module /data/adb/modules/bandctl
adb shell "chmod -R 755 /data/adb/modules/bandctl"

Start Server

adb shell "nohup /data/data/com.termux/files/usr/bin/python3 /data/adb/modules/bandctl/web/server.py > /dev/null 2>&1 &"

Access Web UI

Open http://localhost:8080 on the phone (or use adb forward tcp:8080 tcp:8080 from Mac).

API

Read Current Config

curl http://localhost:8080/api/read?action=read

Response: {"lte":["1","2","3",...],"nr":["77","1","78",...]}

Write New Config

curl -X POST -H 'Content-Type: application/json' \
  -d '{"lte":["1","2","3","4","5","8","12","17","20","28","38","40","41"],"nr":["77","1","78","3","5","38","28","8","41","20"]}' \
  http://localhost:8080/api/write?action=write

How NSG Applies Bands

  1. Web UI writes to /data/data/com.qtrun.QuickTest/shared_prefs/force_qualcomm.xml
  2. Web UI force-stops NSG: am force-stop com.qtrun.QuickTest
  3. Web UI relaunches NSG: am start -n com.qtrun.QuickTest/com.qtrun.nsg.LauncherActivity
  4. NSG reads config, opens diag, applies band preferences to modem

Important: TEST_ACTION broadcast stops NSG, doesn't restart it. Always use force-stop + relaunch.

Band Bitmask Encoding

Bands are encoded as a 64-bit bitmask:

  • Bit 0 = Band 1
  • Bit 1 = Band 2
  • ...
  • Bit 65 = Band 66

Example: Bands 1, 2, 3 = 0x0000000000000007

Known Limitations

  1. NSG dependency: Requires NSG installed for modem communication
  2. Band enforcement unverified: Only B4/B12 visible in test area, cannot confirm disabled bands are rejected
  3. NV persistence assumed: Modem likely stores band prefs in NV 06828, but not directly confirmed

Future Work

  • Build standalone diag tool (remove NSG dependency)
  • Verify band enforcement in area with disabled bands
  • Confirm NV persistence across power cycles
  • Add NR band control to web UI

License

MIT

About

Web UI for LTE/NR band locking on Qualcomm Android devices via KernelSU module

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages