Manual airspy configuration to work with dump1090 fa and piaware - wiedehopf/airspy-conf GitHub Wiki
This guide isn't kept up to date, please just use this install script: https://github.com/wiedehopf/airspy-conf#airspy-conf
If you have questions about this guide, you should ask them in this thread: https://discussions.flightaware.com/t/howto-airspy-mini-and-airspy-r2-piaware-dump1090-fa-configuration/44343
In case your Airspy was purchased earlier than 2017, you will probably need to update its firmware, see the note in regards to ADS-B on the quick start page: https://airspy.com/quickstart/
It's best to use readsb with this guide, in case it isn't yet installed, install it: https://github.com/wiedehopf/adsb-scripts/wiki/Automatic-installation-for-readsb or https://github.com/wiedehopf/adsb-wiki/wiki/Building-readsb-from-source
It also works fine on piaware sd-cards, in that case don't use readsb as those are meant to be used with dump1090-fa.
Use either step 1 a) or option 1 b), not both.
sudo piaware-config receiver-type relay
sudo piaware-config receiver-host localhost
sudo piaware-config receiver-port 29999
sudo systemctl restart piaware dump1090-fa
readsb configuration in the file /etc/default/readsb
needs to be changed, open it via a text editor, for example like this:
sudo nano /etc/default/readsb
Either change it to look like the following or just delete everything and paste the following:
RECEIVER_OPTIONS="--net-only"
DECODER_OPTIONS="--max-range 360"
NET_OPTIONS="--net --net-heartbeat 60 --net-ro-size 1280 --net-ro-interval 0.05 --net-ri-port 0 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-bo-port 30005"
JSON_OPTIONS="--json-location-accuracy 2"
Compared to the default configuration file the RECEIVER_OPTIONS
are changed to "--net-only"
.
Ctrl-x to exit, press y (yes) to save.
To apply the changes to the readsb config you need to restart it:
sudo systemctl restart readsb
If you are using other feed clients set them up as if you had a standard readsb / dump1090-fa running. Use Beast as the protocol and 30005 as port.
cd
mkdir -p airspy
cd airspy
# 32 bit - unless you know for certain you are using a 64bit OS, you're probably using a 32bit OS.
wget -O airspy.tgz https://airspy.com/downloads/airspy_adsb-linux-arm.tgz
# 64 bit
wget -O airspy.tgz https://airspy.com/downloads/airspy_adsb-linux-arm64.tgz
tar xzf airspy.tgz
sudo cp airspy_adsb /usr/local/bin/
cd
mkdir -p airspy
cd airspy
# 32 bit
wget -O airspy.tgz https://airspy.com/downloads/airspy_adsb-linux-x86.tgz
# 64 bit
wget -O airspy.tgz https://airspy.com/downloads/airspy_adsb-linux-x86_64.tgz
tar xzf airspy.tgz
sudo cp airspy_adsb /usr/local/bin/
Open /etc/systemd/system/airspy_adsb.service with nano using this command:
sudo nano /etc/systemd/system/airspy_adsb.service
Copy and paste the following:
[Unit]
Description=Airspy ADS-B receiver
Documentation=https://discussions.flightaware.com/t/howto-airspy-mini-piaware-dump1090-fa-configuration/44343/2
[Service]
EnvironmentFile=/etc/default/airspy_adsb
ExecStart=/usr/local/bin/airspy_adsb $OPTIONS $NET $G $GAIN $M $SAMPLE_RATE $STATS
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=airspy_adsb
User=root
Group=root
Environment=NODE_ENV=production
Nice=-19
[Install]
WantedBy=multi-user.target
Ctrl-X to exit, press Y (yes) to save.
Open /etc/default/airspy_adsb with nano using this command:
sudo nano /etc/default/airspy_adsb
Paste this and modify it as needed:
#
#gain is 0 to 21, each step of gain is equivalent to about 3dB, so reduce in increments of 1 if 21 is too high
GAIN= auto
#other options, append or remove from the line starting with OPTIONS=
OPTIONS= -v -t 90 -f 1 -w 5 -P 8 -C 60 -E 20
#-C: CPU target in time percentage: 5 to 95 (adjust preamble filter while running to target CPU load)
# a CPU target of 50 will use around 1 core completely on a multi-core system
#-e: preamble filter sensitivity, values: 1.0 to 60.0 (higher values increase CPU load and can improve detection)
#
#-E <max_preamble_filter> Maximum preamble filter when using CPU target 0..60 (default: 60)
#-P <non_crc_preamble_filter> non-CRC Preamble filter: 1..preamble_filter
# a low setting (8 or less) for -P can help when running higher -e or -C and encountering wrong altitudes or planes showing ground in VRS
# note this will reduce the number of messages without CRC, for example altitude of MLAT aircraft
# at the same time it will reduce CPU usage which can be used to get some more ADS-B position messages
#
#-w <whitelist_threshold> Whitelist threshold: 1..10 (default: 5, lower not recommended due to bogus messages
# threshold is not measured in message number, DF11 are worth 2, DF17 are worth 4 points
# -t <timeout> Aircraft timeout in seconds for the whitelist (default: 60)
#
#-b: enable bias-t (50 mA max according to specification)
#
#-f: error correction bits, 0, 1 or 2: default and recommended is 1 for now.
# (-f 2 is not recommended at the moment when feeding FlightAware and maybe others
# as they have expressed concern about 2 bit error correction)
#
#-v: verbose, will provide messages to system log, read with this command: sudo journalctl -u airspy_adsb
#
#-x: dx mode, introduces bogus messages, improves reception of weak messages (opinion: not worth it)
#-p: bit packing, reduces USB bandwidth.
# please always check the following command for the options used by the current version:
# airspy_adsb -h
# sample rate can be 12 or 20, 20 may not work depending on the system
# when using the Airspy Mini a sample rate of 20 MSPS is not officially supported and an extra heat sink attached to the metal case or active ventilation are recommended
SAMPLE_RATE= 12
# when using a sample rate of 20, check if MLAT is stable!
# If MLAT isn't stable, 12 is the better choice and performance is similar in most cases.
# stats.json
STATS= -S /run/airspy_adsb/stats.json
#don't change:
G=-g
M=-m
#network settings
NET= -l 47787:beast -c 127.0.0.1:30004:beast
If you are using the piaware sd-card image, remove -c 127.0.0.1:30004:beast
in the last line of the configuration.
Enabling the bias-t: Add -b
to the OPTIONS= line
You don’t need to change any other options, but it should be clear from the comment how to change them if you like to.
Ctrl-x to exit, press y (yes) to save.
After creating and saving those two files the service needs to be enabled:
sudo systemctl daemon-reload
sudo systemctl enable airspy_adsb
sudo reboot
Now airspy_adsb should be starting on boot.
You can read up on the airspy_adsb options in it's help text:
airspy_adsb -h
If you want to change the airspy options edit the option file with the command
sudo nano /etc/default/airspy_adsb
Ctrl-x to exit, press y (yes) to save.
Restart airspy_adsb with
sudo systemctl restart airspy_adsb
To avoid issues with FA MLAT, it's wise to restart dump1090-fa / readsb at the same time:
readsb: sudo systemctl restart airspy_adsb readsb
dump1090-fa: sudo systemctl restart airspy_adsb dump1090-fa
(the following commands assume the program (executable) is located in the folder /usr/local/bin
which it should be if you downloaded it as described in step 2)
Sample command line to start airpsy_adsb: (for example if you don't use systemd and couldn't use step 3)
sudo nice -n -19 -- /usr/local/bin/airspy_adsb -l 29999:beast -c localhost:30104:beast -v -m 12 -f 1 -g 21
Add -b
to enable the bias tee if necessary. (50 mA current draw maximum, the rtl-sdr LNA will lead to extra heat in the airspy, not recommended)
Adjust the gain by changing the number after -g
.
You don't need to change any other options.
Refer to the programs help to see what the options mean if you are curious:
airspy_adsb -h
-m 20
can yield better results than -m 12
but is not recommended for the Raspberry Pi as the USB can be too slow to handle the amount of data properly. This is not officially supported for the Airspy Mini but can work, extra cooling is recommended though.
(even on the newest Raspberry Pi 3B+ -m20 is not recommended, testing has shown problems with MLAT when the message rate exceeds 1600) (https://discussions.flightaware.com/t/checking-for-lost-packages-from-airspy/44638)
If you have questions or the guide is not working for you please let me know over at the flightaware forum: https://discussions.flightaware.com/t/howto-airspy-mini-and-airspy-r2-piaware-dump1090-fa-configuration/44343