Skip to content

Building readsb from source

wiedehopf edited this page May 2, 2023 · 47 revisions

Install required packages:

sudo apt update
sudo apt install --no-install-recommends --no-install-suggests -y \
    git build-essential debhelper libusb-1.0-0-dev \
    librtlsdr-dev librtlsdr0 pkg-config \
    libncurses5-dev zlib1g-dev zlib1g

Compile and install readsb (wiedehopf fork)

cd /tmp
rm /tmp/readsb -rf
git clone --depth 1 https://github.com/wiedehopf/readsb.git -b stale
cd readsb
rm -f ../readsb_*.deb
export DEB_BUILD_OPTIONS=noddebs
dpkg-buildpackage -b -Prtlsdr -ui -uc -us
sudo dpkg -i ../readsb_*.deb

If you haven't used other rtl-sdr software on the system before, a reboot will be necessary to access the SDR.

Use tar1090 as a webinterface

https://github.com/wiedehopf/tar1090#tar1090 Will be available at http://192.168.XX.YY/tar1090

configuration:

sudo nano /etc/default/readsb
# make changes, save with Ctrl-O and enter, exit with Ctrl-X
sudo systemctl restart readsb

example configuration for net-only mode:

Change the RECEIVER_OPTIONS line to this:

RECEIVER_OPTIONS="--net-only --net-connector 192.168.2.7,30005,beast_in"

The IP address / port is where your beast data source is.

net-only: fetch data from 192.168.2.8:20005 and send it to 192.168.2.7:30004

RECEIVER_OPTIONS="--net-only --net-connector 192.168.2.8,20005,beast_in --net-connector 192.168.2.7,30004,beast_reduce_out"

Uninstall

sudo apt remove readsb
# the following are stuff that were needed to build it, don't remove them if you need them to build other software :)
sudo apt remove debhelper libusb-1.0-0-dev librtlsdr-dev pkg-config dh-systemd libncurses5-dev zlib1g-dev

For problems detaching the kernel driver: install the rtl-sdr udev rules

wget -O /tmp/rtl-sdr.rules https://raw.githubusercontent.com/wiedehopf/adsb-scripts/master/osmocom-rtl-sdr.rules
sudo cp /tmp/rtl-sdr.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules

Update the binary using the dev branch assuming you already have the package installed:

cd /tmp && rm /tmp/readsb -rf
git clone --depth 1 https://github.com/wiedehopf/readsb.git -b dev
cd readsb && make -j3 RTLSDR=yes
sudo cp -f readsb /usr/bin/readsb
sudo cp -f viewadsb /usr/bin/viewadsb
sudo systemctl restart readsb

Blacklist kernel drivers (shouldn't be required, sometimes useful)

echo -e 'blacklist rtl2832\nblacklist dvb_usb_rtl28xxu\n' | sudo tee /etc/modprobe.d/blacklist-rtl-sdr.conf
Clone this wiki locally