1xBTS 1xBTS

Building from Source

Prerequisites

DependencyInstall
Rust 1.85+rustup — see below
C compilergcc or clang (for EVRC voice codec)
Dockerdocker.com — for PostgreSQL, dashboard, and FOU-NAT
protocbrew 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

LibraryDevicesCargo feature
libbladerf-devbladeRF--features bladerf-backend
libuhd-devUSRP B200/B210--features uhd-backend
liblimesuite-devLimeSDR--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:

ServicePurposePort
postgresHLR + SMSC database45432
1xbts-webWeb dashboard3000
fou-natFOU tunnel NAT for packet data17012

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