[OUTDATED] Piaware ver 6 with Adaptive Gain Control - Install it on x86_64 Machines with Ubuntu 20, Debian 10 &11, and on RPi 2, 3, 4 with Raspbian Buster (32-bit and 64-bit) and DietPi Bullseye (32-bit & 64-bit)

OK, I set the initial gain to 60 and the max gain to no value and restarted the service. I’ll continue to monitor. Thank you.

I removed that value as well. My current deviations from the default settings are that I’ve enabled adaptive dynamic range and adaptive burst, and added my latitude and longitude. That’s all.

These are my default Adaptive Gain settings i.e. I did NOT edit config file after fresh install (not an upgrade):

# Initial receiver gain, in dB. If adaptive gain is enabled (see below) the act$
# may change over time
RECEIVER_GAIN=60

# Adjust gain to try to achieve optimal dynamic range / noise floor?
ADAPTIVE_DYNAMIC_RANGE=yes
# Target dynamic range in dB (leave blank to autoselect based on SDR type)
ADAPTIVE_DYNAMIC_RANGE_TARGET=
# Reduce gain when loud message bursts from nearby aircraft are seen?
ADAPTIVE_BURST=no
# Gain range to allow when changing gain, in dB (empty = no limit)
ADAPTIVE_MIN_GAIN=
ADAPTIVE_MAX_GAIN=

 

This is what dump1090-fa says:

pi@raspberrypi:~ $ sudo systemctl status dump1090-fa
● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
   Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-09-02 06:17:17 BST; 3h 21min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 573 (dump1090-fa)
    Tasks: 3 (limit: 1431)
   CGroup: /system.slice/dump1090-fa.service
           └─573 /usr/bin/dump1090-fa --quiet --device-type rtlsdr --device-index 00001090 --gain 60 --adaptive-range --fix --lat 43.5xxx --lon -79.6xxxx -

Sep 02 07:56:45 raspberrypi dump1090-fa[573]: adaptive: changing gain from 58.6dB (step 29) to 49.6dB (step 28) because: probing dynamic range gain lower bo
Sep 02 07:56:45 raspberrypi dump1090-fa[573]: rtlsdr: tuner gain set to 49.6 dB (gain step 28)
Sep 02 07:56:55 raspberrypi dump1090-fa[573]: adaptive: available dynamic range (37.0dB) >= required dynamic range (30.0dB), stopping downwards scan here
Sep 02 08:56:55 raspberrypi dump1090-fa[573]: adaptive: start periodic scan for acceptable dynamic range at increased gain
Sep 02 08:56:55 raspberrypi dump1090-fa[573]: adaptive: changing gain from 49.6dB (step 28) to 58.6dB (step 29) because: periodic re-probing of dynamic rang
Sep 02 08:56:55 raspberrypi dump1090-fa[573]: rtlsdr: tuner gain set to about 58.6 dB (gain step 29) (tuner AGC enabled)
Sep 02 08:57:05 raspberrypi dump1090-fa[573]: adaptive: available dynamic range (26.7dB) < required dynamic range (30.0dB), switching to downward scan
Sep 02 08:57:05 raspberrypi dump1090-fa[573]: adaptive: changing gain from 58.6dB (step 29) to 49.6dB (step 28) because: probing dynamic range gain lower bo
Sep 02 08:57:05 raspberrypi dump1090-fa[573]: rtlsdr: tuner gain set to 49.6 dB (gain step 28)
Sep 02 08:57:15 raspberrypi dump1090-fa[573]: adaptive: available dynamic range (37.1dB) >= required dynamic range (30.0dB), stopping downwards scan here

That’s basically the same as mine. I did enable adaptive burst though as I live near an international airport so there are a lot of nearby aircraft. That and my latitude/longitude are the only differences from your settings now. It seems to be working all right, considering my antenna location, just outside of an upstairs window and roughly level with the gutters and current coax (3 meters of LMR400 plus 6 meters or RG6) all of which is just temporary as I plan to redo everything in a few weeks and put my antenna on a mast with just LMR400.

I did NOT set latitude & Longitude in dump1090-fa config file. The piaware pulled it from FA Server and wrote it to file /var/cache/piaware/location.env. The dump1090-fa read it from this file. Please see my dump1090-fa config file setting, in which Lat & Lon are left unset:

# Receiver location, used for some types of position decoding. Provide the location as
# signed decimal degrees. If not given here, dump1090 will also try to read a receiver
# location from /var/cache/piaware/location.env (written automatically by PiAware, if installed)
RECEIVER_LAT=
RECEIVER_LON=

I’m using a Debian-based Linux distro on a PC, not Piaware. I don’t own a Pi.Will setting my latitude and longitude harm anything?

This looks right for a Prostick or similar: it tries 58.6 (equivalent to the legacy -10 setting) but the noise floor is too high with that setting so it settles one step down on 49.6. ~10dB difference in noise floor between the two in your case.

Would be interesting to see results on non-prosticks without the extra LNA in front, or results with external LNAs (for obvious reasons most of my testing has been with prosticks)

No harm (and in fact providing a receiver location, one way or the other, is necessary for some types of position decoding)

I have a Nooelec NESDR SMArt also. I can swap coaxes and test it if you like and provide the dump1090-fa status results.It may be a while as there are fewer flights in the evenings, which it is now where I live. I don’t have an LNA other than the one in my Pro dongle. (I’m currently using the NESDR to monitor my airport’s comms.)

This is when a Cathay Pacific flight landed at my local airport around 8km away and a US Air Force C130 transport plane was so close that I could hear its engines:

● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
   Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-09-02 18:08:06 PST; 24min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 15644 (dump1090-fa)
    Tasks: 3 (limit: 4915)
   Memory: 2.3M
   CGroup: /system.slice/dump1090-fa.service
           └─15644 /usr/bin/dump1090-fa --quiet --device-type rtlsdr --device-index 00000001 --gain 60 --wisdom /etc/dump1090-fa/wisdom.local --adaptive-range --adaptive-burst --fix --lat 10.35 --lon 123.92 --max-range 360 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-bo-port 30005 --json-location-accuracy 1 --write-json /run/dump1090-fa

Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: rtlsdr: using device #0: Generic RTL2832U OEM (Realtek, RTL2838UHIDIR, SN 00000001)
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: Detached kernel driver
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: Found Rafael Micro R820T tuner
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: rtlsdr: tuner gain set to about 58.6 dB (gain step 29) (tuner AGC enabled)
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: adaptive: using 50% duty cycle
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: adaptive: enabled adaptive gain control with gain limits 0.0dB (step 0) .. 58.6dB (step 29)
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: adaptive: enabled dynamic range control, target dynamic range 30.0dB
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: adaptive: enabled burst control
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: Allocating 4 zero-copy buffers
Sep 02 18:08:16 mxdesktop dump1090-fa[15644]: adaptive: reached upper gain limit, halting dynamic range scan here

This is the current status after a Quatari flight departed and a PAL flight just appeared on my (VirtualRadarServer) map:

● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
   Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-09-02 18:08:06 PST; 40min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 15644 (dump1090-fa)
    Tasks: 3 (limit: 4915)
   Memory: 2.4M
   CGroup: /system.slice/dump1090-fa.service
           └─15644 /usr/bin/dump1090-fa --quiet --device-type rtlsdr --device-index 00000001 --gain 60 --wisdom /etc/dump1090-fa/wisdom.local --adaptive-range --adaptive-burst --fix --lat 10.35 --lon 123.92 --max-range 360 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-bo-port 30005 --json-location-accuracy 1 --write-json /run/dump1090-fa

Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: rtlsdr: using device #0: Generic RTL2832U OEM (Realtek, RTL2838UHIDIR, SN 00000001)
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: Detached kernel driver
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: Found Rafael Micro R820T tuner
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: rtlsdr: tuner gain set to about 58.6 dB (gain step 29) (tuner AGC enabled)
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: adaptive: using 50% duty cycle
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: adaptive: enabled adaptive gain control with gain limits 0.0dB (step 0) .. 58.6dB (step 29)
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: adaptive: enabled dynamic range control, target dynamic range 30.0dB
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: adaptive: enabled burst control
Sep 02 18:08:06 mxdesktop dump1090-fa[15644]: Allocating 4 zero-copy buffers
Sep 02 18:08:16 mxdesktop dump1090-fa[15644]: adaptive: reached upper gain limit, halting dynamic range scan here

This is with the NESDR dongle. Same dump1090 settings as before. HTH.

image
image
image

 

pi@raspberrypi:~ $ sudo systemctl status dump1090-fa
● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
   Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-09-02 11:52:09 BST; 25min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 563 (dump1090-fa)
    Tasks: 3 (limit: 1431)
   CGroup: /system.slice/dump1090-fa.service
           └─563 /usr/bin/dump1090-fa --quiet --device-type rtlsdr --device-index 00001090 --gain 60 --adaptive-range --fix --lat 43.5xxx --lon -79.6xxx

Sep 02 11:52:09 raspberrypi dump1090-fa[563]: Thu Sep  2 11:52:09 2021 BST  dump1090-fa 6.0 starting up.
Sep 02 11:52:09 raspberrypi dump1090-fa[563]: rtlsdr: using device #1: Generic RTL2832U OEM (Realtek, RTL2838UHIDIR, SN 00001090)
Sep 02 11:52:09 raspberrypi dump1090-fa[563]: Detached kernel driver
Sep 02 11:52:10 raspberrypi dump1090-fa[563]: Found Rafael Micro R820T tuner
Sep 02 11:52:10 raspberrypi dump1090-fa[563]: rtlsdr: tuner gain set to about 58.6 dB (gain step 29) (tuner AGC enabled)
Sep 02 11:52:10 raspberrypi dump1090-fa[563]: adaptive: using 50% duty cycle
Sep 02 11:52:10 raspberrypi dump1090-fa[563]: adaptive: enabled adaptive gain control with gain limits 0.0dB (step 0) .. 58.6dB (step 29)
Sep 02 11:52:10 raspberrypi dump1090-fa[563]: adaptive: enabled dynamic range control, target dynamic range 30.0dB
Sep 02 11:52:10 raspberrypi dump1090-fa[563]: Allocating 4 zero-copy buffers
Sep 02 11:52:35 raspberrypi dump1090-fa[563]: adaptive: reached upper gain limit, halting dynamic range scan here


image

image

image

 

pi@raspberrypi:~ $ sudo systemctl status dump1090-fa
● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
   Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-09-02 12:58:51 BST; 10min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 20355 (dump1090-fa)
    Tasks: 3 (limit: 1431)
   CGroup: /system.slice/dump1090-fa.service
           └─20355 /usr/bin/dump1090-fa --quiet --device-type rtlsdr --device-index 00001090 --gain 60 --adaptive-range --fix --lat 43.5xxx --lon -79.6xxx

Sep 02 12:59:52 raspberrypi dump1090-fa[20355]: adaptive: available dynamic range (27.1dB) < required dynamic range (30.0dB), continuing downwards scan
Sep 02 12:59:52 raspberrypi dump1090-fa[20355]: adaptive: changing gain from 43.4dB (step 24) to 42.1dB (step 23) because: probing dynamic range gain lowe
Sep 02 12:59:52 raspberrypi dump1090-fa[20355]: rtlsdr: tuner gain set to 42.1 dB (gain step 23)
Sep 02 13:00:02 raspberrypi dump1090-fa[20355]: adaptive: available dynamic range (28.4dB) < required dynamic range (30.0dB), continuing downwards scan
Sep 02 13:00:02 raspberrypi dump1090-fa[20355]: adaptive: changing gain from 42.1dB (step 23) to 40.2dB (step 22) because: probing dynamic range gain lowe
Sep 02 13:00:02 raspberrypi dump1090-fa[20355]: rtlsdr: tuner gain set to 40.2 dB (gain step 22)
Sep 02 13:00:12 raspberrypi dump1090-fa[20355]: adaptive: available dynamic range (29.3dB) < required dynamic range (30.0dB), continuing downwards scan
Sep 02 13:00:12 raspberrypi dump1090-fa[20355]: adaptive: changing gain from 40.2dB (step 22) to 38.6dB (step 21) because: probing dynamic range gain lowe
Sep 02 13:00:12 raspberrypi dump1090-fa[20355]: rtlsdr: tuner gain set to 38.6 dB (gain step 21)
Sep 02 13:00:22 raspberrypi dump1090-fa[20355]: adaptive: available dynamic range (30.6dB) >= required dynamic range (30.0dB), stopping downwards scan her

Thanks for trying it out. Is a gain of 38.6 reasonable for that setup? (If you were doing it manually, what gain would you pick?)

I normally dont use RTL-SDR Triple Filtered LNA. About 2 years ago I purchased it only for trial purposes. If I recall correctly, I found by trial and error that a gain of 36 was optimal for this setup.

@abcd567 - your Github page still says “…piaware 5.0, dump1090-fa 5.0”
abcd567a/piaware-ubuntu20-amd64 (github.com)

Thanks for pointing out. Updated. Now says 6.0

1 Like

@abcd567 is this also applicable for Armbian based boards like the Orange Pi ? Its running on Armbian Buster so I expect it will, just checking :wink:

 

I tested these scripts on OrangePiPC/Armbian Buster, and these work perfect :slight_smile:

 

pi@orangepipc:~$ cat /proc/device-tree/model
Xunlong Orange Pi PC


pi@orangepipc:~$ uname -a
Linux orangepipc 5.10.34-sunxi #21.05.1 SMP Thu May 6 20:13:21 UTC 2021 armv7l GNU/Linux


pi@orangepipc:~$ cat /etc/os-release
PRETTY_NAME="Armbian 21.05.1 Buster"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"

 

 

  ___  ____  _   ____   ____
 / _ \|  _ \(_) |  _ \ / ___|
| | | | |_) | | | |_) | |
| |_| |  __/| | |  __/| |___
 \___/|_|   |_| |_|    \____|

Welcome to Armbian 21.05.1 Buster with Linux 5.10.34-sunxi

System load:   35%              Up time:       3 min
Memory usage:  14% of 999M      IP:            10.0.0.22
CPU temp:      61°C             Usage of /:    35% of 7.1G
RX today:      484.3 MiB

[ 0 security updates available, 34 updates total: apt upgrade ]
Last check: 2021-09-02 10:13

[ General system configuration (beta): armbian-config ]

Last login: Thu Sep  2 10:15:34 2021 from 10.0.0.10
pi@orangepipc:~$ apt-cache policy piaware
piaware:
  Installed: 6.0
  Candidate: 6.0
  Version table:
 *** 6.0 100
        100 /var/lib/dpkg/status
     5.0 500
        500 http://flightaware.com/adsb/piaware/files/packages buster/piaware armhf Packages
pi@orangepipc:~$ apt-cache policy dump1090-fa
dump1090-fa:
  Installed: 6.0
  Candidate: 6.0
  Version table:
 *** 6.0 100
        100 /var/lib/dpkg/status
     5.0 500
        500 http://flightaware.com/adsb/piaware/files/packages buster/piaware armhf Packages
pi@orangepipc:~$ apt-cache policy dump978-fa
dump978-fa:
  Installed: 6.0
  Candidate: 6.0
  Version table:
 *** 6.0 100
        100 /var/lib/dpkg/status
     5.0 500
        500 http://flightaware.com/adsb/piaware/files/packages buster/piaware armhf Packages

 

pi@orangepipc:~$ sudo systemctl status dump1090-fa
● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
   Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-09-02 10:12:36 EDT; 10min ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 1409 (dump1090-fa)
    Tasks: 3 (limit: 2065)
   Memory: 4.3M
   CGroup: /system.slice/dump1090-fa.service
           └─1409 /usr/bin/dump1090-fa --quiet --device-type rtlsdr --device-index 00001090 --gain 60 --adaptive-range --fix --lat 43.5xxx --lon -79.6xxx --

Sep 02 10:12:38 orangepipc dump1090-fa[1409]: Found Rafael Micro R820T tuner
Sep 02 10:12:38 orangepipc dump1090-fa[1409]: rtlsdr: tuner gain set to about 58.6 dB (gain step 29) (tuner AGC enabled)
Sep 02 10:12:38 orangepipc dump1090-fa[1409]: adaptive: using 50% duty cycle
Sep 02 10:12:38 orangepipc dump1090-fa[1409]: adaptive: enabled adaptive gain control with gain limits 0.0dB (step 0) .. 58.6dB (step 29)
Sep 02 10:12:38 orangepipc dump1090-fa[1409]: adaptive: enabled dynamic range control, target dynamic range 30.0dB
Sep 02 10:12:38 orangepipc dump1090-fa[1409]: Allocating 4 zero-copy buffers
Sep 02 10:12:48 orangepipc dump1090-fa[1409]: adaptive: available dynamic range (26.7dB) < required dynamic range (30.0dB), switching to downward scan
Sep 02 10:12:48 orangepipc dump1090-fa[1409]: adaptive: changing gain from 58.6dB (step 29) to 49.6dB (step 28) because: probing dynamic range gain lower boun
Sep 02 10:12:48 orangepipc dump1090-fa[1409]: rtlsdr: tuner gain set to 49.6 dB (gain step 28)
Sep 02 10:12:58 orangepipc dump1090-fa[1409]: adaptive: available dynamic range (37.1dB) >= required dynamic range (30.0dB), stopping downwards scan here

1 Like

Thanks for your reply, I can start this in the upcoming weekend :innocent:

@abcd567 Can I use these scripts to upgrade Piaware, etc,. to 6 if I’m running airspy_adsb? I am now running piaware, dump1090-fa and dump978-fa v5.

Edit: x86_64

Thanks!