Gain Adjustment

working like a champ, Busy time now so see what results I get. Plus I can just leave the window open as Ill be gone for hour or two :slight_smile:

So far it 48 still leads the way :slight_smile:

what really surprised me is I had power supply issues that took time to trouble shoot. One step I had performed is re-imaged the memory card. I didnt change the gain settins and had been running default -10 and so far that is showing the worst performance of the gain settings.

after running the script and making changes in /boot/piaware-config.txt, my receive hits drop to 2, any ideas why this would be ??? gain is currently set @ -10 in this file but a change to -44 has the above result.

This script was unstable on my device, causing me to have no way to get a complete test result. I currently use the -10 setting.

A negetive (-) value of gain results in gain set to zero. Only positive values between 0 and 49.6 are accepted by dongle.

The -10 gain value is the only negetive value accepted by dongle and is a special value. It does NOT set gain to -10. It switches the dongle to AGC mode (Automatic Gain Control mode).

Use gain setting 44 without minus sign.

1 Like

Doh, what a fool.
Thanks

Am I missing something? Instead of using the SUDO method of changing data, is it possible to do the same thing directly on the SD card for PiAware?

Yes, it is possible to change gain (and also other configurations) without console command (SUDO method as you have said), but only if you have burned your microSD card with Piaware SD card image. Even in this case, it is more difficult than console command.

  1. Shut down your PI
  2. Slip out microSD card and slip into card reader of your Desktop / Laptop
  3. Double click on the drive letter of microSD card to open it
  4. In the folder opened you will find a file named piaware-config.txt
  5. Open this file, scroll down till you see this text
# RECEIVER CONFIGURATION
#

# For a complete list of receiver types and their associated settings,
# see the Advanced Configuration page linked at the top of this file.

# For a receiver type of 'rtlsdr', this setting controls the dongle gain.
# -10 means AGC / maximum gain; other values mean a gain value in dB.
rtlsdr-gain -10

#
  1. In line starting with rtlsdr-gain, change -10 to the value you want to set for gain.

  2. Slip microSD card into Pi and power up.

Thanks for the answer!
Is it possible to set on the SD card all other settings available with the SUDO method?

Yes, all these listed on this page.

If any configuration is not already available in file piaware-config.txt, scroll down the file and add a line with required config entry at the bottom of file.

Thanks a lot abcd567!

Has anyone tried this on the new stretch version of flightaware?

I keep getting errors.

@w7psk

(1) you should use sudo to run the script. Without sudo it may give error message.

sudo ./optimize-gain.py

.
(2) If using sudo does not solve your problem, then copy-paste applicable script from this post:

Copy-Paste Gain Optimization Scripts From Here (4 versions for 4 different types of installs)

.

I have just now run script #3 on Raspbian Stretch with dump1090-mutability, and it is working fine.

pi@raspberrypi:~ $ sudo ./optimize-gain.py
test 1 of 5
gain= 49.6 messages= 17257 positions= 1230 planes= 66
gain= 48.0 messages= 18778 positions= 1421 planes= 72
.......
.......

EDIT:

Tested script # 1 on Piaware SD Card image 3.6.2 (which is Stretch), works ok.

pi@piaware:~ $ sudo ./optimize-gain.py
test 1 of 5
gain= 49.6 messages= 15376 positions= 1379 planes= 65
gain= 48.0 messages= 15609 positions= 1392 planes= 65
............
............
1 Like

abcd567

Looks like I got some bad code somewhere. That one works well. Checked back to command history and I did use sudo …
Seems to be running now with the one you just posted.

Hi guys,

Just upgraded to the RTL-SDR 3 dongle.
Removed the fA filter, as my Hab amp is already filtered.
Reporting c80 birds.

Adjusted optimize-gain.py to include all recognised gain settings (0.0…).

Running it for 20 cycles of 20 seconds per setting.

Stopped dump1090 mutability manually.

Oddly, the per gain reports (while it’s running) all show

Messages = positions= 0 planes=2

at each gain setting?

pi@orangepipc:~$ sudo service dump1090-mutability stop
pi@orangepipc:~$ sudo nano ./optimize-gain.py
pi@orangepipc:~$ sudo ./optimize-gain.py
test 1 of 20
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 49.6 messages= 902 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 48.0 messages= 919 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 44.5 messages= 933 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 43.9 messages= 891 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 43.4 messages= 813 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 42.1 messages= 809 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 40.2 messages= 838 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 38.6 messages= 784 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 37.2 messages= 802 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 36.4 messages= 746 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 33.8 messages= 784 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 32.8 messages= 821 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 29.7 messages= 752 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 28.0 messages= 737 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 25.4 messages= 693 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 22.9 messages= 647 positions= 0 planes= 2
[ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
gain= 20.7 messages= 663 positions= 0 planes= 2

Reset to the original range of gains from the script - still the same - positions=0, planes=2

Strange…

You could also try lower gain settings.

yup - just had the optimize-gain.py script testing the full range…

available gain settings are 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 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

, script reports positions=0 planes=2 at all gains, although showing a realistic number of messages… not sure whats going on there.

Live map shows c80 planes.

some gain optimization scripts delete - inadvertently - the dump1090-mutability in /etc/default, happened to me in the past
what is the output from sudo cat /etc/default/dump1090-mutability ?
should be a file with many lines.

After 5 runs we get the totals and I would expect the cumulative sum for messages, positions and airplanes.
It seems that the airplanes are calculated differently because they don’t add up as they should, why?