Building from Source
Prerequisites
| Dependency | Install |
|---|---|
| Rust 1.85+ | rustup — see below |
| C compiler | gcc or clang (for EVRC voice codec) |
| Docker | docker.com — for PostgreSQL, dashboard, and FOU-NAT |
| protoc | brew install protobuf or apt install protobuf-compiler |
Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. "$HOME/.cargo/env"
Common Ubuntu/Debian packages
These are always required, regardless of which radio backend you build:
sudo apt-get install -y \
build-essential cmake git pkg-config protobuf-compiler libssl-dev \
libclang-dev
libclang-dev is needed for bindgen.
Ubuntu: libre/re for the voice gateway
The SIP voice gateway requires Baresip re/libre with SIP registration support. Some Ubuntu libre-dev packages are too old, so build a current upstream release into /usr/local:
sudo apt install build-essential cmake pkg-config libssl-dev git
git clone https://github.com/baresip/re.git
cd re
git checkout v4.6.0
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
cmake --build build -j"$(nproc)"
sudo cmake --install build
sudo ldconfig
Clone
git clone https://github.com/chrismoos/1xbts.git
cd 1xbts
Build & Run with a Radio Backend
Pick one of the SDR backends below. Each block lists the apt package to install and the corresponding cargo run invocation.
bladeRF
sudo apt-get install -y libbladerf-dev
cargo run --release -p cdma-nib --no-default-features --features bladerf-backend -- \
--config-dir config \
--radio-config config/radio_bladerf_micro2.json
USRP / UHD (B200/B210)
sudo apt-get install -y libuhd-dev uhd-host
cargo run --release -p cdma-nib --no-default-features --features uhd-backend -- \
--config-dir config \
--radio-config config/radio_uhd_b210_native.json
LimeSDR
sudo apt-get install -y liblimesuite-dev
cargo run --release -p cdma-nib --no-default-features --features lime-backend -- \
--config-dir config \
--radio-config config/radio_limesdr_mini2_native.json
Backend Reference
| Library | Devices | Cargo feature |
|---|---|---|
libbladerf-dev | bladeRF | --features bladerf-backend |
libuhd-dev | USRP B200/B210 | --features uhd-backend |
liblimesuite-dev | LimeSDR | --features lime-backend |
Docker Services
PostgreSQL, the web dashboard, and the FOU-NAT tunnel all run via Docker Compose. The default docker-compose.yml targets Linux (the dashboard uses network_mode: host so it can reach BSC/MSC gRPC on 127.0.0.1); macOS uses an override that switches to bridge networking with host.docker.internal.
Linux
Load the kernel modules the fou-nat container relies on, then start Compose. Containers cannot load modules even when privileged — without this, fou-nat exits with RTNETLINK answers: No such file or directory / Error talking to the kernel:
sudo modprobe fou ipip
docker compose up -d
# Persist modules across reboots:
echo -e "fou\nipip" | sudo tee /etc/modules-load.d/1xbts-fou-nat.conf
macOS
docker compose -f docker-compose.yml -f docker-compose.macos.yml up -d
The override puts the dashboard on Docker’s bridge network and points it at the host via host.docker.internal, which Docker Desktop proxies through to your Mac’s loopback. (Linux’s host.docker.internal resolves to the docker0 bridge, which can’t reach 127.0.0.1-bound gRPC servers — hence the host-network default.)
This starts:
| Service | Purpose | Port |
|---|---|---|
postgres | HLR + SMSC database | 45432 |
1xbts-web | Web dashboard | 3000 |
fou-nat | FOU tunnel NAT for packet data | 17012 |
The PostgreSQL database (1xbts) and schema are created automatically on first start.
Tests
cargo test --workspace
Covers physical layer, protocol stack, RLP, PPP — including regression tests against real over-the-air recordings.
Next Steps
- Configuration — BTS and radio config files
- First Registration — Get a handset on the air