Automatic gain optimization for readsb and dump1090 fa - wiedehopf/adsb-scripts GitHub Wiki

autogain1090

  • only for rtl-sdr/DVB-T USB receiver, not Airspy or Beast receivers
  • no longer works with dump1090-fa except on the piaware image due to changed configuration
  • at 2:45 in the morning, if necessary the gain is changed and the decoder restarted
  • changes gain by one step every night, only if required
  • uses strong signals (messages >-3dB) to determine if gain should be changed
  • if the percentage of strong signals is greater than 7 percent -> gain is reduced
  • if the percentage of strong signals is less than 0.5 percent -> gain is increased
  • thresholds adjustable in /etc/default/autogain1090

More info on gain: https://github.com/wiedehopf/adsb-wiki/wiki/Optimizing-gain

Installation:

sudo bash -c "$(curl -L -o - https://github.com/wiedehopf/adsb-scripts/raw/master/autogain-install.sh)"
hash -r

Testing it, rough adjustment

Run this every 2 minutes:

sudo autogain1090

Or you can run this and it will run it every 2 minutes for the next hour to find an initial gain setting:

for i in {0..30}; do sudo autogain1090; sleep 120; done

Some errors are normal, but it should still change the gain or report that it doesn't need changing. If there aren't many planes around this might be unreliable and you should wait for the nightly adjustment.

Configuration:

  • not required, will automatically adjust gain one step if required at night
  • thresholds adjustable in /etc/default/autogain1090

Logs / what is it doing?

sudo journalctl -eu autogain1090

Removal / Deinstallation:

sudo bash -c "$(wget -nv -O - https://github.com/wiedehopf/adsb-scripts/raw/master/autogain-remove.sh)"