FlightAware Discussions

Gain Adjustment


How did you get maximum range plot on dump1090-fa, similar to what we get on VRS?


I am not trying to be a smart azz, but I followed your instructions, I think! I have configured so many times I honestly don’t remember the specific post I used, but I rely on your instructions so much you are probably the suspect!!!


Right now I am totally obstructed to west and south. The antenna is under porchroof, but with clear view north and east.

I am going to be almost 25 feet higher, and pretty much unobstructed. Unfortunately, with first the hurricane and then flooding, my “roof” guy has been tied up. It will be up there soon, I hope.


No, It is not me. I never posted anything about dynamically plotting maximum range like the way it is done by VRS.
See this post by lignumaqua: post186780.html#p186780
Have you installed lignumaqua’s fork of dump1090 (github.com/lignumaqua/dump1090)?


OK, I got it now, I was riding with my daughter and was not real focused.

Those are not range rings, but the altitude rings from the HeyWhatsThat site. You had me scared there for a minute.


Well I have successfully been running the scripts from this thread and getting some good data from my 2 units. My question is, using the 3 data sources from such script testing, messages, positions and aircraft, which specific data source do you aim to use, to get the best db setting for optimum detection settings??

Now what I have been doing, is running various tests, at different times of the day or night, at different lengths of time say from 5 mins to 90 mins and getting the averages, as produced by the script report, putting that data together per type and gaining an overall average. Now I know that such data will change in relation to how busy the airspace is that your are scanning etc. But I am thinking if you use data from all times and different traffic levels, you should get a good overall average across each data field. Sometimes the different averages for messages, positions and aircraft will be fairly obvious, a certain db level will stand out as the optimum setting, however other times, as more data is added to the overall averages, there may be a difference at what db setting is the best between positions, messages and aircraft.

So what should be the data source, in such a situation of discrepancy of ideal or best db setting , should you pick, the messages, positions or aircraft. Which is the most relevant for good detection??



Post power spike meltdown:

Had everything working great and then had a power spike on Tuesday or Wednesday. Ended up having to copy a backed up image, since Piaware started running erratically.

I am using the Piaware 3.1 image.

I am having trouble now, running the Gain Analysis script. Everything else is fine.

Using Bart’s script, I get the following error, kind of randomly:
pi@raspberrypi:~ $ sudo ./optimize-gain-piaware3.py
test 1 of 3
gain= 49.6 messages= 3721 positions= 137 planes= 23
gain= 48.0 messages= 3296 positions= 133 planes= 23
gain= 44.5 messages= 4700 positions= 266 planes= 32
gain= 43.9 messages= 4372 positions= 237 planes= 35
Traceback (most recent call last):
  File “./optimize-gain-piaware3.py”, line 24, in
  File “/usr/lib/python2.7/socket.py”, line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 111] Connection refused

Sometimes the script would run, sometimes, like above, it would run a couple of trials, sometimes it would just freeze. “Appeared” really random. I changed the wait time from 2, to 3 to 4, still “kinda worked”

I then went with ignumaqua’s script. It runs, but I get a Restarting dump1090-mutability message before each trial. The final table, summary, is fine, however!

Back in May, RadioAstronomy reported a similar issue. He apparently fixed it, but was advised he had used “bad code,” so he deleted his code.

Can anyone tell me what is going on? Appreciate it. I am not wed to anything or any script, I am happy to change scripts, I just want the script to work like it used to.


Traceback (most recent call last):
  File “./optimize-gain-piaware3.py”, line 24, in
  File “/usr/lib/python2.7/socket.py”, line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 111] Connection refused[/quote]

This just means the gain script couldn’t connect to dump1090 port 30003. Either dump1090 didn’t start correctly, or dump1090 started slowly and wasn’t ready when the script tried to connect. Hard to say why it would be failing sporadically for you even after upping the wait time.

(really i should make the script smarter to wait until dump1090 is ready rather than just waiting N seconds)


I graphed the output of the various amplification settings of the, and changed my gain from -10 to 44.5. The result? In the first 24 hours, I’ve gone from about 400k positions to about 500k, and from 2700 airplanes to 3100. That’s not bad for having an open horizon for only 1/4th the sky. My hottest sector is in the 320-400km range. Equipment consists of a Pro Stick, filter, and FA antenna situated on the balcony.


I have piaware3 working with dump 1090 fa on my OPi now. It is running on Armbian Jessie Server. I can’t just edit the configure file by putting the sd card in the reader and editing the txt file. So, where is the file located so I can access via SSH? Currently, the antenna is a passive system so I am interested to see what affect changing gain has on reception.


piaware-config.txt is in /boot


These are the only files I can see in /Boot
bin boot.cmd initrd.img-3.4.112-sun8i uInitrd
bin.old boot.scr script.bin vmlinuz-3.4.112-sun8i
boot.bmp config-3.4.112-sun8i System.map-3.4.112-sun8i zImage

I used this: find / -name ‘piaware-config.txt’ to no avail but dropping off the .txt revealed /usr/lib/piaware-config and **
/usr/bin/piaware-config** One was jibberish and the other contained nothing.


The file /boot/piaware-config.txt exists only if you have written a Piaware 3 img to your card. Since you have written Armbian, then installed separate packages of dump1090-fa and Piaware 3 (add-on), the piaware-config.txt will not be there. You have to edit another file to adjust gain:

#open file dump1090-fa in a text editor to change value of gain
pi@orangepipc:~$ sudo nano /etc/default/dump1090-fa

#after editing the gain value and saving above file, restart dump1090-fa for new gain value to take effect.
pi@orangepipc:~$ sudo systemctl restart dump1090-fa

#now check status of dump1090-fa.
#it will show, among other things, the gain value set.
pi@orangepipc:~$ sudo systemctl status dump1090-fa -l



Thanks for that. Now modified and showing up as suggested.


Oops, missed that you weren’t running the standard image, sorry about that.


It is very natural to make this mistake because people normally say “Piaware” for both the image as well as data feeder. I have rarely seen anyone using full names “Piaware img (SD card)” and "Piaware (add-on).

It would have been much better if these two had distinct names. An example is Flightradar24 software. Their img is named “Pi24” and the data-feeder add-on is named “fr24feed”.


20/20 hindsight…


Hi, what does the red grass in the performance graphs mean, legend = Messages > -3 dBFS/hr.

Does more red mean there are more strong messages, or more weak ones?

Thanks, B


Forgive me for not reading the last 3 pages thoroughly, yet.
Inspired by this post and the work behind it, I stared modifying…

I have ended with a script that runs on both:

Python 2.7.9 (default, Sep 17 2016, 20:26:04) [GCC 4.9.2] on linux2


Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)] on win32

Latter one, obviously without the actual gain changing…

New features:

  • Formatting output, possible to select delimiter, default (tab)

  • Timeout, will not wait for socket receive if time is passed, needed in target poor environment

  • Handling packets directly, should be more memory efficient if run over a long time

  • Arguments parser, script now takes arguments for behaviour modification, help gives this:

pi@piaware:~$ pyh/optimize-gain-piaware3.py -h
usage: optimize-gain-piaware3.py -h] -t TESTTIME] -n TESTSNUM] -s SERVER]
                                 -p PORT] -g GAINS] -c CONFIG] -r GREPSTR]
                                 -v] -d] --delim DELIM]

optional arguments:
  -h, --help     show this help message and exit
  -t TESTTIME    Seconds for each test
  -n TESTSNUM    Number of tests to perform
  -s SERVER      hostname for data feeder, default 'localhost'
  -p PORT        port, default 30003
  -g GAINS       list of strings with gains to test
  -c CONFIG      path to config file, default '/boot/piaware-config.txt'
  -r GREPSTR     gain settings string in config, default 'rtlsdr-gain'
  -v             verbose output
  -d             runs the script without actually changing the gain
  --delim DELIM  delimiter to seperate output

Script is available here: github/wittrup/piawarebash/pyh/optimize-gain-piaware3.py



Is there anything else that needs tweaking on a typical dump1090 install? I keep hearing about adjusting the receiver’s PPM, but for something like a Pro Stick/Pro Stick + with a TCXO, I’m not sure if it really makes a difference…?