FlightAware Discussions

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.

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.

1 Like

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.