Gain Adjustment

So I wanted to post my numbers to make sure I am doing this correctly.
I have an RPi 3 running the ADSB Receiver project image dumping to FA, FR24, PF and ADSBExchange. I have my antenna in the west-facing window of my bonus room on the second floor connected to a ProStick Plus.

I previously set my gain to 45 using the piaware-config command.

This was started at 1PM EDT near Richmond, VA

===Totals===
Gain, Messages, Positions, Aircraft
49.6 47941 1823 157
48.0 48803 1982 146
44.5 46738 2036 153
43.9 43054 1909 151
43.4 41588 1868 148
42.1 40154 1852 152
40.2 39432 1864 145
38.6 39967 1669 142
37.2 38882 1576 139
36.4 37132 1481 132
33.8 36363 1533 135
32.8 34410 1509 133
29.7 32930 1492 117
28.0 33487 1509 118
25.4 28992 1317 98
22.9 27040 1095 94
20.7 21403 721 79

So I am finally taking a bite and here comes the dumb newbie questions: Is this script supposed to work with 3.3.0 SD image?

I was able to download via the wget command but when I try to run via the above command I get “command not found”.

I am very much a follow directions kind of person as I have zero clue what I am doing with any of this piaware stuff other than what a step by step writing would tell me.

I too am a noob here, and wish to run a Gain script on my 3.30 SD image. though getting errors too. I have tried 3 different scripts but all seem to be written for other builds.

I can’t figure this stuff out either.

Can someone lend me their “PiAware for Dummies”?? :blush:

Think the python paths are different too.


pi@piaware:/$ sudo find -name "python*"
./usr/lib/python2.7
./usr/lib/python3
./usr/share/nano/python.nanorc
./usr/share/gcc-4.9/python
pi@piaware:/$


pi@piaware:~$ python -V
-bash: python: command not found
pi@piaware:~$

I honestly dont think it is installed under PiAware 3.3.0

It’s not, but you can install it via apt-get.

Thanks for that. I wasnt sure on the Build of PiAware.

So I am running mutability on an RPi 3 with a Prostick Plus. Do I need to adjust the gain in piaware-config and in the dump1090-mutability file?

I would post the full script and process for piaware but for some unknown reason I keep getting

**Forbidden
**
You don’t have permission to access /posting.php on this server.

even though I am posting within the limit.

guess it wont let me post code or ascii characters.

I have made the file available to download instead with a brief readme.txt file on instructions. hope this helps anyone with a Standard piaware setup.

https://www.conligwx.org/files/piware_gain_script.zip

So this doesn’t do anything for the SD Card Image based PiAware. Nothing works.

so do I guess what error message you get?

how can anyone help you if you just say it “doesnt work” or is that the error message?

if you followed the instructions in the zip file, installed python2.7 onto your piaware 3.3.0 card, and then copy the python script over to you card as well

run the correct command, and you get an error message of “NOTHING WORKS” ???

Same thing as above : “command not found”

There is no file structure other than one folder. PiAware itself is installed on the SD Card hence the image. Using the included commands from the walk through resulted in nothing happening.

and what “command is not found” ? -please copy, paste the exact input/output you are using, there are several commands I have listed in the readme, do I have to guess what one you used to diagnose you fault?

have you installed Python2.7?
have you installed the “optimize-gain-piaware.py” file from the zip file and placed it into the correct folder?

did you run the command as

optimize-gain-piaware.py
or
./optimize-gain-piaware.py
or
sudo ./optimize-gain-piaware.py

try them all.

it works here

conligwx.org/files/piware_gain_script.zip

here is the example from logon and running the script. I adjusted the script for a quicker run. measure_duration = 10 #seconds ntests = 5

login as: pi
pi@172.16.10.73’s password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Wed Mar 29 22:24:56 2017 from homepc

SSH is enabled and the default password for the ‘pi’ user has not been changed.
This is a security risk - please type ‘passwd’ to set a new password.

pi@piaware:~$ ls
optimize-gain-piaware.py
pi@piaware:~$ sudo ./optimize-gain-piaware.py
test 1 of 5
gain= 49.6 messages= 1440 positions= 115 planes= 13
gain= 48.0 messages= 1392 positions= 100 planes= 11
gain= 44.5 messages= 1274 positions= 101 planes= 12
gain= 42.1 messages= 1380 positions= 113 planes= 13
gain= 40.2 messages= 1500 positions= 116 planes= 12
gain= 38.6 messages= 1223 positions= 91 planes= 13
gain= 36.4 messages= 1182 positions= 97 planes= 12
test 2 of 5
gain= 49.6 messages= 1308 positions= 107 planes= 14
gain= 48.0 messages= 1222 positions= 95 planes= 11
gain= 44.5 messages= 1151 positions= 102 planes= 11
gain= 42.1 messages= 1126 positions= 88 planes= 10
gain= 40.2 messages= 1118 positions= 81 planes= 14
gain= 38.6 messages= 1114 positions= 101 planes= 13
gain= 36.4 messages= 1236 positions= 106 planes= 11
test 3 of 5
gain= 49.6 messages= 1584 positions= 126 planes= 16
gain= 48.0 messages= 1736 positions= 127 planes= 15
gain= 44.5 messages= 1682 positions= 145 planes= 14
gain= 42.1 messages= 1713 positions= 158 planes= 16
gain= 40.2 messages= 1676 positions= 157 planes= 18
gain= 38.6 messages= 1598 positions= 162 planes= 14
gain= 36.4 messages= 1463 positions= 132 planes= 13
test 4 of 5
gain= 49.6 messages= 1687 positions= 142 planes= 15
gain= 48.0 messages= 1762 positions= 145 planes= 14
gain= 44.5 messages= 1779 positions= 139 planes= 14
gain= 42.1 messages= 1644 positions= 129 planes= 13
gain= 40.2 messages= 1599 positions= 125 planes= 13
gain= 38.6 messages= 1332 positions= 114 planes= 13
gain= 36.4 messages= 1407 positions= 108 planes= 12
test 5 of 5
gain= 49.6 messages= 1751 positions= 130 planes= 14
gain= 48.0 messages= 1918 positions= 141 planes= 15
gain= 44.5 messages= 1538 positions= 114 planes= 13
gain= 42.1 messages= 1582 positions= 124 planes= 11
gain= 40.2 messages= 1248 positions= 95 planes= 11
gain= 38.6 messages= 1206 positions= 106 planes= 11
gain= 36.4 messages= 1162 positions= 93 planes= 10

===Totals===
Gain, Messages, Positions, Aircraft
49.6 7770 620 27
48.0 8030 608 24
44.5 7424 601 24
42.1 7445 612 22
40.2 7141 574 24
38.6 6473 574 23
36.4 6450 536 24
pi@piaware:~$

Gain Optimization Script for Piaware 3.3 Image

One hour ago, I downloaded Piaware 3.3 image, formatted a spare microSD card, wrote Piaware3.3 image.
I then executed the procedure listed below. It worked.

(1) Install Python:
pi@piaware:~$ sudo apt-get install python

(2) Create new blank file:
pi@piaware:~$ sudo nano optimize-gain-piaware3.py

(3) Copy code in my post for Piaware 3.0.4 image on page 3 of this thread (CLICK HERE), and paste it in newly created file “optimize-gain-piaware3.py”. Save file.

(4) Make executable the file “optimize-gain-piaware3.py”
pi@piaware:~$ sudo chmod +x optimize-gain-piaware3.py

(5) Run the code
pi@piaware:~$ sudo ./optimize-gain-piaware3.py
test 1 of 5
gain= 49.6 messages= 10304 positions= 755 planes= 62
…
…

Untested! Should work…
Replace step 2 & 3 with:


pi@piaware:~$ wget https://raw.githubusercontent.com/wittrup/piawarebash/master/pyh/optimize-gain-piaware3.py

1 Like

Don’t forget to use alo -10 (AGC) in the test script. After a lot of testing, we found that it still provided the best setting, over time.

/M

Thank you for the steps for stupid people. 8) Not all of us are Pi savvy but I have it running now.

i’m extremely pi stupid (I see the steps in a nearby post how to setup a script but I don’t know how to access the pi to do those steps).

I think I need to do a gain adjustment using the new piaware stick plus that just came.

What I want to know is if I can avoid the script stuff that’s been dominating this thread and just edit a line in a config text file or something on the sd card of my piaware. Can I put the SD card in my windows pc SD card slot, navigate to a config text file, edit a gain setting in that file, put the sd card back in the pi and do a pi reset command from the FA ADS-B user page where you have dropdown piaware commands?

Alternately, can I use windows explorer to connect to the PI through my home network to edit a config text file?

thanks from someone who is more at home with arduino.

If you know the gain you want, then yes you can do exactly that. Edit piaware-config.txt on the sdcard (it is on the first, FAT, partition so should be visible on Windows etc) and edit in a line like this:



rtlsdr-gain 40


Replace 40 with the gain you want. Save the file, safely-eject the sdcard, return it to the Pi.

This thread is more about automatically finding the “right value” but you can always do manual trial-and-error.

when set at -10 is there any actual command to find what it is really set at?

“sudo systemctl status dump1090-fa -l” shows the Gain at 0.00 dB