FlightAware Discussions

For Beginners - How to Set / Change Gain

I studied the thread you mentioned.

And as I would like to get more out of my antenna etc, I thought it could be an idea by changing the gain, or perhaps I misunderstood the things said in the thread:(
Tried 30 just to see what would happen. Abcd567 gave that number is is example. So no specific reason the gain of 30.

You are right, after changing I could not see plane. Changed it back to -10 and saw at least a few

There are some clear conditions given in that thread when you should lower gain.
With your current setup i wouldn’t expect those conditions to be met.

If you don’t need to lower gain in the first place and then lower it massively, it’s gonna reduce reception.
Having no aircraft received with a gain of 30 seems strange and might indicate a syntax error.
To exclude that you can check the log for dump1090-fa, it’s mentioned here: https://github.com/wiedehopf/adsb-wiki/wiki/Debug-commands

It should return to the previous performance without issue.

Anyhow … go ahead and try 49, 44, 40, 35 … you’ll likely see a trend.
Experiment :slight_smile:

Thanks for the advice, will do as you suggested.

I made one of these stupid beginner mistakes after rebuilding the device some months ago and forgot to remove the “-” sign after chagning the gain.

So i switched from “-10” to “-48.0” and was confused not seeing any aircraft. It took a couple of minutes to identify the mistake.


After seeing -10 in gain setting, lot of beginners think that gain values should be entered with a minus sign.

They dont realize that -10 is a special case and if any other number is used with a minus sign, it will set gain to ZERO, resulting in no aircraft on the map, as happened with @Dutchyb.

1 Like

more worse is that i knew it must be removed from any other value than 10.
But i missed that.

I added a couple of lines to my dump1090-fa to make gain changing much easier. Just a couple of comment lines but they have been invaluable as I tuned up my gain.

# gains = 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
# gain = -10 is max gain (55.0 with AGC)

(Thanks for the code how-to, ABCD!)

(I use the FlightAware blue dongle SDR. These gain values should be the same for any dongle that uses the same SDR chip.)

I put the comments (denoted by the # signs) just above the line that sets the gain for handy reference whenever I make gain adjustments.

In tuning the gain, you can make the initial adjustments pretty much just by inspection while watching your local PiAware map display, but I let averages take over and used my FlightAware site page rankings to do the fine adjustments and maximize my 30-day site ranking and comparisons with nearby sites.

Just how I do it. YMMV. But the gain key comments in dump1090-fa have just been super handy and using rankings on my FA site page has allowed tuning to the point I get regularly highlighted as having the highest position counts among all nearby sites.

1 Like

It is easy.
Just write [code] above the code lines, and [/code] below the lines like this

code line 1
code line 2

code line n

It will appear like this:

# gains = 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
# gain = -10 is max gain (55.0 with AGC)


Alternatively instead of [code] above, and [/code] below, you can:
place 3 backticks ``` above the code, and 3 backticks ``` below the code, like this:

code line 1
code line 2

code line n

The backtick (grave-accent) key is left of number 1 key on US keyboard, as shown in image below.



How To Format Messages in This Discussion Forum




Just want to say thank you to both @abcd567 and @wiedehopf! What a difference this makes.

I had struggled to improve reception for a couple weeks before seeing Thoughts on optimizing gain which led to this guide. Picking up from another thread about gain, I even spent a whole night optimizing voltage in order to maximize gain. Nothing seemed to return my PiAware to message rate I accidentally saw while on a disastrous route. Then @wiedehopf’s illustration of signal saturation finally made me realize that I may need to decrease gain instead. Within 50 km, I have two small airports and two major airports. My interest is mostly in low-altitude flight, but my antenna elevation doesn’t give line of sight from distant low-altitude objects anyway. Using @wiedehopf’s formula, strong signal ratio was like >30.

After some experiment, I set gain at 40dB and saw message rate hopping way past past accidental highs. Then, another disater hit and I have to lay my antenna horizontally on my window sill with alligator clips on the PCB, (don’t ask) which is against all rules of good reception. Even so, message rate routinely exceeds “max” days. I will do more experiments once my replacement part comes in.

BTW, I simplified the command to

awk "$(sed -n 's/.*total.*accepted":\[\([0-9]*\).*strong_signals":\([0-9]*\).*/BEGIN {printf "\\nPercentage of strong messages: %.3f \\n" , \2 * 100 \/ \1}/p' /var/run/dump1090*/stats.json)"

Alternatively, to make the calculation slightly easier to understand, use jq.

dc -e "$(jq .total.local.strong_signals,.total.local.accepted[0] </var/run/dump1090*/stats.json) 3k 100 / / * p"

That works.
Can’t edit old posts on here but i might update it on my wiki pages.

Oh, you should look into this especially /?pTracks is very useful for reception: