Enabling Auto Gain

Rather than upgrade my 5.0 installation, I installed a fresh copy of 6.0 using the SD card image.

Immediately after the first boot, I set my gain to 28, which after months of experimentation seemed to be optimal for my setup.

How do I disable the fixed setting and enable the new Auto Gain feature instead?

When editing piaware-config.txt in Nano, I see my gain setting, but nothing related to Auto Gain.

1 Like

SOURCE: https://github.com/flightaware/dump1090/blob/master/README.adaptive-gain.md#default-settings

Where to configure adaptive gain options

How to configure adaptive gain varies depending on how you have installed dump1090.

If you are using a PiAware sdcard image, adaptive gain can be configured by editing /boot/piaware-config.txt or by using the piaware-config command.

If you are using the Debian package, adaptive gain can be configured by editing /etc/default/dump1090-fa .

If running dump1090 directly, adaptive gain options are set directly by command-line options.

Default settings

For new PiAware or Debian package installations, adaptive dynamic range mode is enabled by default and adaptive burst mode is disabled by default.

For upgrades of PiAware or the Debian package from versions older than 6.0, both adaptive gain modes are disabled by default.

These defaults can be overridden as described below.

Adaptive gain in dynamic range mode

The dynamic range adaptive gain mode attempts to set the receiver gain to maintain a given dynamic range - that is, it tries to set the gain so that general noise is at or below a given level. This takes into account different or changing RF environments and different receiver hardware (antenna, preamplifiers, etc) that affects the overall gain of the system, and usually will pick a reasonable gain setting without intervention.

To enable this mode:

  • Set adaptive-dynamic-range yes in piaware-config; or
  • Set ADAPTIVE_DYNAMIC_RANGE=yes in /etc/default/dump1090-fa ; or
  • Pass the --adaptive-range option on the command line.

The default settings for dynamic range will use a dynamic range target chosen based on SDR type (e.g. 30dB for rtlsdr receivers). This is usually a good default. To override this target:

  • Set adaptive-dynamic-range-target in piaware-config; or
  • Set ADAPTIVE_DYNAMIC_RANGE_TARGET in /etc/default/dump1090-fa ; or
  • Pass the --adaptive-range-target option on the command line.

Adaptive gain in “burst” / loud signal mode

The “burst” adaptive gain mode listens for loud bursts of signal that were not successfully decoded as ADS-B messages, but which have approximately the right timing to be possible messages that were lost due to receiver overloading. When enough overly-loud signals are heard in a short period of time, dump1090 will reduce the receiver gain to try to allow them to be received.

This is a more situational setting. It may allow reception of loud nearby aircraft (e.g. if you are close to an airport). The tradeoff is that when there are nearby aircraft, overall receiver range may be reduced. Whether this is a good tradeoff depends on the aircraft you’re interested in. By default, adaptive gain burst mode is disabled.

To enable burst mode:

  • Set adaptive-burst yes in piaware-config; or
  • Set ADAPTIVE_BURST=yes in /etc/default/dump1090-fa ; or
  • Pass the --adaptive-burst option on the command line.

This mode is more experimental than the dynamic range mode and tweaking of the advanced burst options may be needed depending on your local installation. In particular, --adaptive-burst-loud-rate and adaptive-burst-quiet-rate may need adjusting. Feedback on what works for you and what doesn’t would be appreciated!

Burst mode and dynamic range mode can be enabled at the same time.

Limiting the gain range

If you know in advance approximately what the gain setting should be, so you want to allow adaptive gain to change the gain only within a certain range, you can set minimum and maximum gain settings in dB. Adaptive gain will only adjust the gain within this range. To set this:

  • Set adaptive-min-gain and adaptive-max-gain in piaware-config; or
  • Set ADAPTIVE_MIN_GAIN and ADAPTIVE_MAX_GAIN in /etc/default/dump1090-fa ; or
  • Pass the --adaptive-min-gain and --adaptive-max-gain options on the command line.

If you know approximately where the gain should be, then a good starting point would be to set the max and min adaptive gain to +/- 10dB around your gain setting.

3 Likes

When I go to sudo nano /boot/piaware-config.txt, there is nothing there related to adaptive gain.

All of the above yes/no settings are not present in the file.

This is on a fresh SD card install of 6.0.

You can add them to the file directly, or use the piaware-config command to add them.

If you wrote a fresh sdcard image, adaptive gain dynamic range mode is already enabled without needing any explicit configuration.

I assumed by manually setting a gain value, that adaptive gain was disabled.

I’ve added the “adaptive-dynamic-range yes” line to the config file, but what do I do with the previous setting? Put a # symbol at the start of that line?

No, it just sets the initial gain.

What previous setting?

I assume that there is no “gear” option to set this? OR I assume that we have to dismount the os and edit the card under Windows. OR you could tell us what the command line option is rather than “hint” at a truncated command.

Thank you abcd567 for all that you do. If not for you a lot of us would be totally lost. (More lost?) Seems that the command line is still alive and well within Flightaware. (Not a very user friendly environment.)
Perhaps the new ownership will broaden the base.

No there is no gear command to enable it.
It will be automaticly enabled if you install a new image on a fresh card.

For exisiting installations this has to be done manually

It’s already im the description but here are the steps:
Login to your Pi using SSH
enter the follwing command
cd\

next command
cd /boot

next command
sudo nano piaware-config,txt

Then set the options as described by abcd567

Adaptive gain in dynamic range mode

The dynamic range adaptive gain mode attempts to set the receiver gain to maintain a given dynamic range - that is, it tries to set the gain so that general noise is at or below a given level. This takes into account different or changing RF environments and different receiver hardware (antenna, preamplifiers, etc) that affects the overall gain of the system, and usually will pick a reasonable gain setting without intervention.

To enable this mode:

  • Set adaptive-dynamic-range yes in piaware-config; or
  • Set ADAPTIVE_DYNAMIC_RANGE=yes in /etc/default/dump1090-fa ; or
  • Pass the --adaptive-range option on the command line.

The default settings for dynamic range will use a dynamic range target chosen based on SDR type (e.g. 30dB for rtlsdr receivers). This is usually a good default. To override this target:

  • Set adaptive-dynamic-range-target in piaware-config; or
  • Set ADAPTIVE_DYNAMIC_RANGE_TARGET in /etc/default/dump1090-fa ; or
  • Pass the --adaptive-range-target option on the command line.

Adaptive gain in “burst” / loud signal mode

The “burst” adaptive gain mode listens for loud bursts of signal that were not successfully decoded as ADS-B messages, but which have approximately the right timing to be possible messages that were lost due to receiver overloading. When enough overly-loud signals are heard in a short period of time, dump1090 will reduce the receiver gain to try to allow them to be received.

This is a more situational setting. It may allow reception of loud nearby aircraft (e.g. if you are close to an airport). The tradeoff is that when there are nearby aircraft, overall receiver range may be reduced. Whether this is a good tradeoff depends on the aircraft you’re interested in. By default, adaptive gain burst mode is disabled.

To enable burst mode:

  • Set adaptive-burst yes in piaware-config; or
  • Set ADAPTIVE_BURST=yes in /etc/default/dump1090-fa ; or
  • Pass the --adaptive-burst option on the command line.

This mode is more experimental than the dynamic range mode and tweaking of the advanced burst options may be needed depending on your local installation. In particular, --adaptive-burst-loud-rate and adaptive-burst-quiet-rate may need adjusting. Feedback on what works for you and what doesn’t would be appreciated!

Burst mode and dynamic range mode can be enabled at the same time.

Limiting the gain range

If you know in advance approximately what the gain setting should be, so you want to allow adaptive gain to change the gain only within a certain range, you can set minimum and maximum gain settings in dB. Adaptive gain will only adjust the gain within this range. To set this:

  • Set adaptive-min-gain and adaptive-max-gain in piaware-config; or
  • Set ADAPTIVE_MIN_GAIN and ADAPTIVE_MAX_GAIN in /etc/default/dump1090-fa ; or
  • Pass the --adaptive-min-gain and --adaptive-max-gain options on the command line.

If you know approximately where the gain should be, then a good starting point would be to set the max and min adaptive gain to +/- 10dB around your gain setting.

Thank you! Had to use /etc/default/dump1090-fa instead of boot but all is well.

is there a place to monitor?

Yes use the following command
sudo systemctl status dump1090-fa

It will show you the status and the steps taken to adjust gain.

Ctrl-c will return you to the prompt again

For more history I use
$ grep "gain" /var/log/syslog.1 /var/log/syslog

Another option is to look at the JSON page

http://ipadress-of-pi/dump1090-fa/data/stats.json
Then you can see it in a text mode on the bottom of that page.

1 Like

So I am unable to set adaptive gain. I did the commands and it opened a list of config settings, when I try and move the green cursor up levels to change the setting it flicks through a load of previous commands. When I open the SD card on the computer I have the config file but it doesn’t read the same as on putty. Other commands like /etc/default…dump1090-fa says permission denied. I need to change it as it wasn’t a problem before this past week but my ham radio antenna is being picked up and to the point I’m only getting 5/6 aircraft.

Any help is appreciated.

Tom

@thomascundy
Is it a piaware SD card image
(command prompt pi@piaware:~ $)

OR

Raspbian image with package install of piaware & dump1090-fa
(command prompt pi@raspberrypi:~ $)

Piaware image. One of the commands forgot which one it also said directory didn’t exist. But it did exist on another one of the commands as the file opened.

@thomascundy

For Piaware SD Card image:

OPTION -1: COMMAND-LINE (SSH/PUTTY)

sudo piaware-config adaptive-dynamic-range yes

sudo systemctl restart piaware

OPTION-2: EDIT FILE "/boot/piaware-config.txt ", scroll down to bottom, and add this line:

adaptive-dynamic-range yes

Save File

Restart piaware
sudo systemctl restart piaware

 

@thomascundy

FIVE (5) Settings for Adaptive Gain

For Piaware SD Card image

sudo piaware-config [PARAMETER]  
sudo systemctl restart piaware

Replace [PARAMETER] by any one of the parameters below

adaptive-burst                no                             
adaptive-dynamic-range        yes                           
adaptive-dynamic-range-target xx        # Replace xx by gain value. No value set and no default value      
adaptive-max-gain             xx        # Replace xx by gain value. No value set and no default value
adaptive-min-gain             xx        # Replace xx by gain value. No value set and no default value

 

 

For package install of dump1090-fa & Piaware on Raspbian or other OS

sudo nano /etc/default/dump1090-fa  

 

# 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=

Save File after editing

Restart piaware

sudo systemctl restart piaware    

So i got a good range following option one and then I tested out putting a call out on my radio and yes the radio antenna is interfering with the ADSB antenna as it has knocked me back to 1, how long does adaptive gain take to restore again? Just until I can relocate one of the antennas somewhere else or if tehy can cohabit together and the ADSB restore.

All sorted I altered the adaptive dynamic range target

1 Like

at my installation, it checks and readjusts every 3 hour.
If dip in gain is just after the adaptive gain has checked, it will take about 3 hours to restore.
If the dip in gain is say 2.5 hrs after the last adaptive check, i.e. the next adaptive check is after 1/2 an hour, it will be restored in 1/2 an hour.

That was yesterday’s observation. Today the adaptive checked immediately after disturbing signal was removed (about 2 hrs after last check) and restored. Please see graph below, left dip is last evening’s, right dip is today midday’s, which was restored immediately after interference subsided.