ADS-B decoder swiss knife
This is a detached fork of https://github.com/Mictronics/readsb
It's continually under development, expect bugs, segfaults and all the good stuff :)
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" see the LICENSE file for details
I'd recommend this script to automatically install it:
See the Debian Package section if you want to build the package yourself.
Or check here on how to further install a webinterface and other useful stuff:
For macOS build and info, check the macOS section
antirez (original dump1090) Malcom Robb (work on his dump1090 fork) mutability (forked to dump1090-mutability and further to dump1090-fa) Mictronics (readsb as a fork of dump1090-fa) wiedehopf (this fork of Mictronics readsb)
readsb connects to a listening server.
Sending beast data (beast_out):
--net-connector 192.168.2.22,30004,beast_outReceiving beast data (beast_in);
--net-connector 192.168.2.28,30005,beast_inSelectively forwards beast messages if the received data hasn't been forwarded in the last 125 ms (or --net-beast-reduce-interval).
Data not related to the physical aircraft state are only forwarded every 500 ms (4 * --net-beast-reduce-interval).The messages of
this output are normal beast messages and compatible with every program able to receive beast messages.
This is used by some aggregators to aggregate ADS-B data, an example net connector would be:
--net-connector=feed.airplanes.live,30004,beast_reduce_plus_out,uuid=0033062d-e17e-4389-91a9-79ebb967fb4cThe uuid is optional, if none is given, the uuid from --uuid-file is used, if that isn't present no uuid is sent. The beast_reduce_out net-connector will never send an uuid. The aggregator enables --net-receiver-id and --net-ingest on their readsb server, it's made to work with beast_reduce_plus_out.
sudo apt update
sudo apt install --no-install-recommends --no-install-suggests -y \
git build-essential debhelper libusb-1.0-0-dev pkg-config fakeroot \
libncurses-dev zlib1g-dev libzstd-dev librtlsdr-dev help2man
git clone --depth 20 https://github.com/wiedehopf/readsb.git
cd readsb
export DEB_BUILD_OPTIONS=noddebs
rm -f ../readsb_*.deb
dpkg-buildpackage -b -ui -uc -us --build-profiles=rtlsdr
sudo dpkg -i ../readsb_*.debdpkg-buildpackage -b -ui -uc -us.dpkg-buildpackage -b -ui -uc -us --build-profiles=rtlsdrdpkg-buildpackage -b -ui -uc -us --build-profiles=with_sdrsrequired build deps (omit last line if you're not building with the various SDR support)
git build-essential debhelper pkg-config fakeroot help2man \
libncurses-dev zlib1g-dev libzstd-dev libusb-1.0-0-dev \
librtlsdr-dev libsoapysdr-dev libhackrf-dev libbladerf-dev libad9361-dev libiio-devYou can probably just run "make". By default "make" builds with no specific library support. See below. Binaries are built in the source directory; you will need to arrange to install them (and a method for starting them) yourself.
"make RTLSDR=yes" will enable rtl-sdr support and add the dependency on librtlsdr.
On Raspbian 32 bit, mostly rpi2 and older you might want to use this to compile if you're running into CPU issues:
make RTLSDR=yes OPTIMIZE="-Ofast -mcpu=arm1176jzf-s -mfpu=vfp"In general if you want to save on CPU cycles, you can try building with these options:
make AIRCRAFT_HASH_BITS=11 RTLSDR=yes OPTIMIZE="-O3 -march=native"The difference of using -Ofast or -O3 over the default of -O2 is likely very minimal. -march=native also usually makes little difference but it might, so it's worth a try.
If required, edit /etc/default/readsb to set the service options, device type, network ports etc.
For rtl-sdr devices a software gain algorithm is the default, it's optimized for ADS-B.
On the command line it's activated using --gain=auto an is silent by default.
--gain=auto-verbose can be used to enable log messages for gain changes.
To tweak the internals, more parameters can be passed:
--gain=auto-verbose,,,,The defaults are:
--gain=auto-verbose,0,34,36,243The thresholds are numbers 0 to 256, tweaking them requires some understanding of how it works. One option would be to change the noise thresholds up or down and then observe the log. There should be no need to tweak these parameters.
Use this utility independent of readsb: https://github.com/wiedehopf/adsb-wiki/wiki/RTL-Bias-Tee
One of this forks main uses is to be the backend of a global map. For that purpose it's used in conjunction with tar1090 with some extra options to cope with the number of aircraft and also record a history of flight paths: https://github.com/wiedehopf/tar1090#0800-destroy-sd-card
Websites using this software:
Projects using this softare:
Projects that use or have used data generated by this software:
History function as used by several online aggregators using tar1090.
Warning: the following will generate several thousand files a day and can use significant amounts of disk space depending on your data source.
The following command line options need to be added to for example the decoder options in /etc/default/readsb
--write-globe-history /var/globe_history --heatmap 30To increase time resolution to maximum, you can add --json-trace-interval=0.1 which will add every
position received to traces. The heatmap interval can also be reduced from the default of 30
seconds, i wouldn't recommend less than 5 seconds for that though.
Aggregators will generally use --write-json-globe-index as well but that's not necessary if you don't have more than 500 concurrent planes.
/var/globe_history needs to be a directory writeable by the user readsb.
sudo mkdir /var/globe_history and sudo chown readsb /var/globe_history are useful for that.
You should also download
wget -O /usr/local/share/tar1090/aircraft.csv.gz https://github.com/wiedehopf/tar1090-db/raw/csv/aircraft.csv.gzand add this command line option (for exaple via /etc/default/readsb):
--db-file /usr/local/share/tar1090/aircraft.csv.gzThis will obviously write data to the hard drive, be aware of that. The data format is subject to change, don't expect this to be stable. Be aware of that when upgrading either tar1090 or readsb to a new commit.
If you're using --write-json-globe-index, it's also recommended to use --tar1090-use-api It will use the readsb API to get data, it's less requests and usually more efficient, for details see the file nginx-readsb-api.conf (this needs adding to your existing nginx tar1090 configuration, this is only for people who really know their stuff anyway)
If configuring this stuff seems complicated, consider just using the sdr-enthusiasts ultrafeeder container. Just don't configure feeds for aggregated data or if you don't want to feed data from there.
If you don't want readsb to read data from the SDR, you'll also need to change the receiver options line to something like this:
RECEIVER_OPTIONS="--net-only --net-connector 192.168.2.7,30005,beast_in"If you have another dump1090/readsb running on the same machine, you'll also need to change all the ports to avoid conflicts.
For current reference please see the speed_check function.
hex
SQ means same quality (ADS-B vs MLAT and stuff) LQ means lower quality
fail / ok ok means speed check passed (displayed only with cpr-focus)
A means airborne and S means surface.
reliable is my reliability counter every good position increases each aircrafts position reliability, if it gets to zero, speed check is no longer applied and it's allowed to "JUMP", "JUMP" is also allowed if we haven't had a position for 2 minutes.
tD is the trackDifference 170 or 180 means the new position goes in the opposite direction of the ground track broadcast by the aircraft.
then we have actual distance / allowed distance. the allowed distance i tweak depending on the trackDifference high trackDifference makes the allowed distance go slightly negative as i don't want aircraft to jump backwards.
elapsed time
actual / allowed speed (allowed speed based on allowed distance)
old --> new lat, lon -> lat, lon
oh if you want that display: --debug=S you'll have to update, just disabled the MLAT speed check from displayign stuff ... because usually it's not interesting
Thank you to https://github.com/ind006/readsb_macos/ for all the shims needed to make this work.
readsb should be (largely) compatible with macOS, on both Intel and ARM architectures.
There is a recipe for homebrew avalailable: https://formulae.brew.sh/formula/readsb
Run brew install readsb to install readsb using homebrew.
Or compile manually roughly like this: You may need to modify the Makefile to point at where on your mac you have the standard libs and includes installed. This in turn depends on whether you're using macports or homebrew for those libs and includes. The Makefile has paths pre-set for homebrew.
These packages are needed, possibly more:
git librtlsdr libusb ncursesBuild using:
make -j4 RTLSDR=yesYou can run it from the command line (try screen -S readsb and run it in there, press ctrl-A to detach the terminal)
Example command line:
…For a graphical interface, the tar1090 webinterface is recommended: https://github.com/wiedehopf/tar1090 The install script won't work so i'd recommend the following basic webserver configuration:
git clone --depth 1 https://github.com/wiedehopf/tar1090 ~/tar1090
wget -O ~/tar1090/aircraft.csv.gz https://github.com/wiedehopf/tar1090-db/raw/csv/aircraft.csv.gzSimple http server using python reachable using http://localhost:8081
cd ~/tar1090/html
python3 -m http.server 8081Using nginx this would look something like this (replace USER appropriately):
location /tar1090/data/ {
alias /home/USER/tar1090/data/;
add_header Cache-Control "no-cache";
location /tar1090/data/traces/ {
gzip off;
add_header Content-Encoding "gzip";
add_header Cache-Control "no-cache";
}
}
location /tar1090/globe_history/ {
alias /home/USER/readsb_history/;
gzip off;
add_header Content-Encoding "gzip";
add_header Cache-Control "no-cache";
}
location /tar1090 {
alias /home/USER/tar1090/html/;
add_header Cache-Control "no-cache";
}An easy way to add some traces when selecting a plane (with nginx):
Add --write-globe-history=/home/USER/readsb_history to the readsb command line.
You can also serve this folder as /tar1090/globe_history but that's only required for the history going back further
than 24h.
The classical tar1090 uses traces created via a shell script and served at /tar1090/chunks but running that shel
No open issues yet, or sync has not completed.