Skip to content

About

An automated tool to set the best frequency for zitel modems.

Resources

Stars

5 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

Zitel Auto Frequency (Go)

Finds the fastest LTE frequency for a Zitel modem and locks the radio onto it.

The tool logs into the modem's local admin API, measures download speed on the current frequency and on each candidate frequency, then locks the radio onto whichever performed best — no more waiting on support to do it for you.

This is a Go rewrite of Mahdi0024/ZitelAutoFrequency, which was written in C#/.NET. See Credits.

Heads up: trying a frequency means switching to it, so your internet connection drops for a few seconds on every candidate. Expect the tool to take a couple of minutes, and don't run it in the middle of something important.

What's different from the original

  • Single static binary. No .NET runtime to install.
  • No external speed test. The original shells out to the Ookla Speedtest CLI, which you had to install separately. This version measures download speed itself over plain HTTP.
  • Nothing is written to disk. Downloaded data is discarded as it arrives.
  • No root required. Reconnection is detected with a TCP dial instead of an ICMP ping, so no raw-socket privileges are needed.
  • Everything is configurable. Modem address, credentials, candidate frequencies and every speed-test parameter are command-line flags rather than hardcoded values.

The login flow, command codes, frequency parsing and selection logic all follow the original.

There are two clients in this repository: a command-line tool and an Android app. Both talk to the same modem API and measure speed the same way.

Install

Grab a build from the releases page:

Platform File
Android (arm64) zitel-autofreq-<version>.apk
Windows (64-bit) zitelautofreq-windows-amd64.exe
Linux ARM64 (Raspberry Pi, etc.) zitelautofreq-linux-arm64

The desktop binaries are statically linked and have no dependencies. On Linux, make it executable first:

chmod +x zitelautofreq-linux-arm64

Android app

Zitel

The app does the same sweep as the command-line tool, plus a live radio readout. Put the phone on the modem's Wi-Fi, pick whether to measure against domestic or international servers, and press Start.

  • Live signal — RSRP, SINR and RSRQ, each colour-coded green / amber / red against the usual LTE field-engineering bands, alongside band, EARFCN, PCI, channel width and modulation. It refreshes every two seconds, including during a scan.
  • Graphical speed readout while each frequency is measured, then a ranked comparison of every frequency with the winner marked.
  • Pinned to the modem's Wi-Fi. Changing frequency drops the modem's uplink for a few seconds; Android reacts by demoting that Wi-Fi and moving traffic to mobile data. The app binds its sockets to the Wi-Fi network so the test keeps measuring the modem — and never spends your mobile data quota.
  • A failed frequency is skipped, not fatal. If one candidate cannot be measured the sweep carries on, and on any failure or cancellation the radio is put back on the best frequency measured so far rather than left wherever the sweep stopped.

The APK is around 1 MB, targets arm64 devices, and needs Android 8.0 or newer. It is signed with a debug key, so Android will ask you to allow installation from an unknown source.

Usage

Run it with no arguments to use the defaults:

./zitelautofreq-linux-arm64

To try a different set of frequencies:

./zitelautofreq-linux-arm64 --frequencies 42490,42690,42890,43090

Sample output:

>>Getting current cell info...
->Current radio status:
-->Cell id: 101
-->Frequency: 42690
-->Locked: true
------------------------------
->Testing download speed (2 runs)...
-->Run 1/2: 38.41 Mbps (via github.com)
-->Run 2/2: 41.02 Mbps (via github.com)
-->Score (fastest of 2): 41.02 Mbps
------------------------------
->Setting freq to 42490, CellId: 101
->Frequency set successfully, waiting for internet connection...
->Connected, letting the link settle for 5s...
->Testing download speed (2 runs)...
...
->Fastest frequency was 42690, configuring radio...
-->Frequency set successfully. Enjoy!

Flags

Flag Default Meaning
--address http://192.168.0.254/cgi-bin/http.cgi Modem admin API endpoint
--username farabord Modem admin username
--password farabord Modem admin password
--frequencies 42490,42690,42890 Comma-separated candidate EARFCN values
--test-url two large-file sources Comma-separated download URLs, tried in order
--test-connections 4 Concurrent connections per speed test
--test-duration 7s Length of each speed test run
--test-runs 2 Runs per frequency; the fastest run is its score
--settle 5s Pause after reconnecting, before measuring
--wait-host 4.2.2.4:53 host:port dialed to detect that the connection is back

Run --help for the full list.

How the speed test works

Getting a comparable number for each frequency matters more than getting an impressive one, so a few things are deliberate:

  • Connection setup is excluded from the measurement. All connections are opened first; the clock starts only once every one of them is streaming. On a link that has just re-attached after a frequency change, setup can take seconds — folding that into the window would penalise every candidate frequency against the one you started on.
  • The link is given time to settle. The first packet getting through doesn't mean the radio is ready, so the tool waits --settle before measuring.
  • A source must serve every connection. Some hosts cap concurrent downloads per IP and reject the extras. Rather than quietly measuring at reduced concurrency, such a source is skipped and the next URL is used, so every frequency is measured under the same conditions. The working source is then reused for the rest of the run.
  • Each frequency is scored by its fastest run. Throughput noise is one-sided — congestion or a slow ramp-up can only make a link look slower than it is, never faster — so the best run is the closest estimate of what a frequency can actually carry, and one unlucky run can't knock a good frequency out of the running.

Data usage

With the defaults, each frequency is downloaded against for about 14 seconds. A full pass over three frequencies moves on the order of 150 MB. On a metered plan, lower --test-runs or --test-duration.

Building from source

The command-line tool requires Go 1.24 or newer.

# Linux ARM64 (Raspberry Pi)
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o zitelautofreq-linux-arm64 .

# Windows 64-bit
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o zitelautofreq-windows-amd64.exe .

The Android app needs a JDK and the Android SDK (API 36 and build-tools). The app is pure Kotlin and Jetpack Compose, with no third-party runtime.

cd android && ./gradlew assembleRelease

Credits

All credit for the original idea, the reverse-engineering of the Zitel admin API, and the frequency-selection approach goes to Mahdi0024 and the original ZitelAutoFrequency project.

This repository only rewrites that work in Go to drop the .NET runtime and the external Speedtest CLI dependency. Without the original there would have been nothing to port — thank you.

About

An automated tool to set the best frequency for zitel modems.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages