Gain Adjustment

You are cutting and pasting a python script into a shell. That’s not going to work.

1 Like

Is it possible to run something via putty? If not. How do you run it with a pi and computer?

You need to have Python installed as a processor for that script. it’s a simple command to get this done.

Is that python3? Sorry to sound dumb. I’m sure that is already on. Or is it something else?

You need to put that script into a file and then run the file.

Anyhow, i don’t think those scripts are particularly good, i’d recommend just following this: Thoughts on optimizing gain - #2 by wiedehopf

1 Like

What is Python 3?

Python 3 is a processor which is able to interpret and run the script.

Launch your SSH shell (Putty), login and enter “python” on the command line.
If it’s installed, you should see something like this:

Python 2.7.16 (default, Oct 10 2019, 22:02:15)
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

If it is installed, run the command “python” followed by the name of your script.

Python is installed

pi@piaware:~ $ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09)
[GCC 6.3.0 20170516] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

#!/usr/bin/python2
import time, socket, subprocess

What would the command be now to get the script working?

python ./name-of-your-script

this works if you launch python from the same folder. Otherwise you have to enter the full path where the script is located.

What they are saying is to take your script that you pasted above, connect to the Pi via putty, open a text editor such as nano, paste the whole thing into an empty file, and then save it to somewhere on the Pi such as ~/gainscript.py

Then, from the command line, run

python ~/gainscript.py

This is where it gets confusing for me using things like nano. Getting copy and paste code in via is just about my limit using all these other commands things go wrong unless I see it on a video or screenshots that allows me to follow it slowly.

I’ll probably just end up sticking with -10

Change it manually once a day and check it. Simple and efficient.
-10 is normally not the best option.

Just use this then:
Home · wiedehopf/adsb-scripts Wiki · GitHub

With the graphs you will also be able to see if anything changes or -10 is already the gain you should be using:
GitHub - wiedehopf/graphs1090: Graphs for readsb / dump1090-fa / dump1090 (based on dump1090-tools by mutability)

1 Like

Thank you.

All looks ok on first test

pi@piaware:~ $ sudo bash -c “$(wget -q -O - https://raw.githubusercontent.com/wi edehopf/adsb-scripts/master/dump1090-fa-autogain.sh)”
Created symlink /etc/systemd/system/timers.target.wants/dump1090-fa-autogain.tim er → /lib/systemd/system/dump1090-fa-autogain.timer.

All done!
pi@piaware:~ $ sudo /usr/local/bin/dump1090-fa-autogain
No gain change needed, percentage of messages >-3dB is in nominal range. (4.712% )

It is a Saturday night though here in the UK and not much is flying. I’ll need to try it more frequently during a busier time.

Regularly checked this over the past 3 days every time it comes back -3dB is in nominal range.

That’s with it set to -10 should I just leave it at that or make any changes?

Hey @gavin323, I’m new to this but seeing how nobody has answered yet, it depends?

I moved my antenna from an initial location in my house in a window to up on the roof. I have an airport that is 3 miles away and with that change I couldn’t see anything happening at the airport. Great range out over 200nm though. The near signals were so strong It was overwhelming the receiver.

My interest was seeing airport operations so I had to drop the gain. It’s at 28.0 dB now and that seems to give me both local ops without really changing max range. That was surprising to me since it’s such a big change from “-10”/55 dB.

My experience has been that maximum gain doesn’t really do much for range in my installation. YMMV. As others point out, you are amplifying all signals that make it to the amp - signal and noise. That may not be of much practical consequence if you still see all the aircraft, but with a good enough installation (high/clear antenna, short cable run, etc) the high gain might make near aircraft with strong signals swamp the receiver and disappear.

You may not be located or have an installation where that really matters, though. The tell is in the statistics (various methods posted around to know), or if near aircraft disappear as they get closer to you (dotted line tracks or gone completely) while you can still see far aircraft. If that is happening, decreasing gain will help but depending on your installation and location, it could also impact your max range. If you’re in that situation it’s a balance where you have to decide which end you want to favor.

2 Likes

I don’t trust those “automated” gain adjustments. For me it worked better when I did it manually, observing the effect in real time in an open browser window.

4 Likes

The automated methods should be good for many or most, but I’m also a fan of manual tuning. What I have found valuable was turning on displaying all tracks and seeing where planes appear and disappear. With the near airport, for me also also watching the aircraft taxi to see if there were dropouts from too high signal levels was necessary. Without constant ops, though, it was time consuming. Definitely agree the SkyAware map page is really handy and so is the RSSI column.

2 Likes

What automated version? If i leave it as it is, the gain setting is way too high.
I can see drops for aircraft trails if they are close enough.

So i reduced it which does not have a visible impact to range.

The ‘old’ MAX and -10 dilemma.

Is it even worth going for the extra gain, if any?

I’ll venture to say that the vast majority of people on this forum will have installations that will not benefit from it.

Worth it with unamplified SDRs.

Otherwise, not so much.