For Beginners - How to Set / Change Gain

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"