# Tweaks

**URL:** <https://discussions.flightaware.com/t/tweaks/20339>\
**Category:** ADS-B Flight Tracking\
**Created:** [July 24, 2017, 6:49am UTC](https://discussions.flightaware.com/t/tweaks/20339 "2017-07-24T06:49:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [July 24, 2017, 6:49am UTC](https://discussions.flightaware.com/t/tweaks/20339/1 "2017-07-24T06:49:09Z")

</div>

INDEX  
To see details, click on the Tweaks below or scroll down

[TWEAK #1: RANGE CIRCLES](https://discussions.flightaware.com/t/tweaks/20339/2)  
(a) Additional Range Circles  
(b) Coloring Range Circles Alternating Red/Blue + Making Circles dashed line instead of solid line.

[TWEAK #2: REPLACING TWO-CLOCK MAP BY SKYVIEW MAP](https://discussions.flightaware.com/t/tweaks/20339/3)  
Replacing Map having two clocks (dump1090-mutability) by SkyView Map (dump1090-fa)  
(a) Keeping dump1090-mutability, but replacing Map only (Skin/GUI replacement)  
(b) Uninstalling dump1090-mutability, and in its place installing dump1090-fa

[TWEAK #3: Gain Optimization Scripts](https://discussions.flightaware.com/t/tweaks/20339/4)  
(a) Optimize-Gain-Piaware-SD-Card-Image  
(b) Optimize-Gain-dump-fa-on-Raspbian-Jessie  
(c) Optimize-Gain-dump-mut-on-Raspbian-Jessie  
(d) Optimize-Gain-dump-Malcom-Robson-on-Raspbian-Jessie

[TWEAK #4:](https://discussions.flightaware.com/t/tweaks/20339/5)  
Place holder for future

[TWEAK #5:](https://discussions.flightaware.com/t/tweaks/20339/6)  
Place holder for future

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [July 24, 2017, 6:54am UTC](https://discussions.flightaware.com/t/tweaks/20339/2 "2017-07-24T06:54:50Z")

</div>

TWEAK-1: RANGE CIRCLES

**(1) INCREASING NUMBER OF RANGE CIRCLES**  
By default, there are 3 circles at 100, 150 & 200 nm.  
If you want to add more circles, go to following line in “config.js” and add numbers as shown in red.

sudo nano /usr/share/dump1090-mutability/html/config.js  
Press Ctrl+w and type SiteCircleDistances and press Enter key.  
The cursor will jump to line below. Add additional circles as shown ib red  
SiteCirclesDistances = new Array(50,100,150,200,250,300);

NOTE:  
If you have installed dump1090-mutability using JProchazka’s Script, the Cicle diameter will be in km instead of nm due to a bug.  
Remove this bug as follows:

sudo nano /usr/share/dump1090-mutability/html/config.js

In file config.js, scroll down till you find a line  
Metric=“false;”

Remove quotes " " (but don’t remove the ; semi colon), so the line becomes  
Metric=false;

Save the file config.js, and restart dump1090-mutability

sudo systemctl restart dump1090-mutability

Now clear cache of your browser, and reload/refresh the map in your browser, and you will see the range rings in nautical miles.

**(2) COLORING RANGE CIRCLES ALTERNATE RED/BLUE dump1090-fa version 3.5.0**

```auto

#enter the html folder
cd /usr/share/dump1090-fa/html/

#make a copy of script.js by the name script_orig.js before modifications.
#this way you will have a backup copy in case somrthing goes wrong.
sudo cp script.js script_orig.js

#open file script.js for editing
sudo nano script.js

```

The last command above will open the file “script.js” for editing

Press Ctrl+w, then type circleStyle , then press Enter key. The cursor will jump to the line:  
var circleStyle = function(distance) {

Make changes as shown in red below, save the file and exit the editor.  
Reload the Browser to see map with colored circles.

**NOTE:**  
Forum is blocking me to post the code. Code below is a screenshot of Word file. Download the Word file containing code to facilitate copy-paste.

[Click here to Download: ColorCircles-dump1090-fa.docx](https://www.dropbox.com/s/kdtsll7oscg3ie1/ColorCircles-dump1090-fa.docx?dl=1)

[https://s20.postimg.org/qhl9lg2t9/Color\_Circle-dump-fa.png](https://s20.postimg.org/qhl9lg2t9/Color_Circle-dump-fa.png)

**(3) COLORING RANGE CIRCLES ALTERNATE RED/BLUE dump1090-mutability version 1.15~dev**

```auto

#enter the html folder
cd /usr/share/dump1090-mutability/html/

#make a copy of script.js by the name script_orig.js before modifications.
#this way you will have a backup copy in case somrthing goes wrong.
sudo cp script.js script_orig.js

#open file script.js for editing
sudo nano script.js

```

The last command above will open the file “script.js” for editing  
Press Ctrl+w, then type siteCircle, then press Enter key. The cursor will jump to siteCircle.  
Make changes as shown in red below, save the file and exit the editor.  
Reload the Browser to see map with colored circles.

**NOTE:**  
Forum is blocking me to post the code. Code below is a screenshot of Word file. Download the Word file containing code to facilitate copy-paste.

[Click here to Download: ColorCircles-dump1090-mut.docx](https://www.dropbox.com/s/0nwof781qem2hl5/ColorCircles-dump1090-mut.docx?dl=1)

[https://s20.postimg.org/cel3hvccd/Color\_Circles.png](https://s20.postimg.org/cel3hvccd/Color_Circles.png)

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [July 24, 2017, 7:13am UTC](https://discussions.flightaware.com/t/tweaks/20339/3 "2017-07-24T07:13:46Z")

</div>

TWEAK-2: REPLACING TWO-CLOCK MAP (DUMP1090-MUTABILITY) BY SKYVIEW MAP (DUMP1090-FA)

This can be achieved in two ways:  
(a) Keeping dump1090-mutability, but replacing Map only (Skin/GUI replacement)  
(b) Unistalling dump1090-mutability, and in its place installing dump1090-fa

(a) Keeping dump1090-mutability, but replacing Map only (Skin/GUI replacement)

```auto

#download the dump1090-fa files from github
cd ~
git clone https://github.com/flightaware/dump1090.git

#the above command will download a folder dump1090, which contains another folder public_html
#copy the folder public_html to folder /usr/share/dump1090-mutability
sudo cp -r dump1090/public_html /usr/share/dump1090-mutability/public_html

#now go to folder dump1090-mutability
cd /usr/share/dump1090-mutability

#first change name of folder html to original-html 
#this preserves the original html folder, and enables revert in case something goes wrong
sudo mv html original-html

#now change the name of folder public_html to html
sudo mv public_html html

#now go to folder html
cd html

#change the name of file index.html to gmap.html
sudo mv index.html gmap.html

#now reboot for changes to take effect
sudo reboot

#after reboot, reload the browser. If new map does not show, clear browser's cache.

```

IMAGE 1 OF 2: BEFORE ABOE MODIFICATIONS

 ![](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/0/f/0fc105f112f33fb409e3fa31e1304fb59ac50455.jpeg)

IMAGE 2 OF 2: AFTER ABOVE MODIFICATIONS

 ![](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/7/b/7bf33f13ea63e1fcee85a1a0897f83234adb74ae.jpeg)  
.  
.  
.  
.  
.  
.

(b) Unistalling dump1090-mutability, and in its place installing dump1090-fa

**STEP-1: Uninstall dump1090-mutability**

> Stop Piaware and dump1090-mutability  
> pi@raspberrypi:~ $ sudo systemctl stop piaware  
> pi@raspberrypi:~ $ sudo systemctl stop dump1090-mutability

> Remove and Purge installed dump1090-mutability  
> pi@raspberrypi:~ $ sudo dpkg --remove dump1090-mutability  
> pi@raspberrypi:~ $ sudo dpkg --purge dump1090-mutability

> Manually remove /usr/share/dump1090-mutability / folder and its content (folder html)  
> pi@raspberrypi:~ $ sudo rm -rf /usr/share/dump1090-mutability

**STEP-2: Install dump1090-fa**

```auto

pi@raspberrypi:~ $ wget http://flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_3.5.0_all.deb
pi@raspberrypi:~ $ sudo dpkg -i piaware-repository_3.5.0_all.deb
pi@raspberrypi:~ $ sudo apt-get update
pi@raspberrypi:~ $ sudo apt-get install dump1090-fa

```

Reboot Pi

```auto

pi@raspberrypi:~ $ sudo reboot

```

Clear cache of your browser and see the map on page /dump1090-fa/

NOTE:  
If you hae installed Web Portal / Graphs by JProchazka’s script then  
(1) The Map link on your adsb project page will bring a page “Not found” as it is pointing to dump1090-mutability which is no more there. See map at /dump1090-fa/  
(2) Graphs will stop populating, as these will try to get data from dump1090-mutability which is no more there. To make the graphs work again, do the following modification

> Edit file collectd.conf  
> pi@raspberrypi:~ $ sudo nano /etc/collectd/collectd.conf

> Press Ctrl+w and type “Module dump1090” (without quotes " "), then press Enter key. The cursor will jump to line containing “Module dump1090”.  
> Add -fa as shown in red below. Save file and exit editor.

> ```
> <Module dump1090>
> <Instance localhost>
> URL "http://localhost/dump1090 **-fa**"
> </Instance>
> </Module>
> 
> ```

> After saving file “collectd.conf”, restart collectd  
> pi@raspberrypi:~ $ sudo systemctl restart collectd

**AFTER REMOVAL OF MUT & INSTALLATION OF FA**

 ![](https://us1.discourse-cdn.com/flex019/uploads/flightaware/original/3X/5/3/53f3cfbc24c95187d152384c800c7579df9f7f87.jpeg)

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [July 24, 2017, 7:18am UTC](https://discussions.flightaware.com/t/tweaks/20339/4 "2017-07-24T07:18:13Z")

</div>

TWEAK-3: Gain Optimization Scripts

Source thread: [Gain Adjustment…](https://discussions.flightaware.com/t/gain-adjustment/18376)

CONTRIBUTORS:  
In chronological order:  
(1) Apr 26, 2016 - Original Author: **BratJr**  
(2) Apr 28, 2016 - Enhancement by: **Lignumaqua**  
(3) Aug 21, 2016 - Adaptation for Piaware image by: **abcd567**  
(4) Oct 08, 2016 - Adaptation for dump1090-fa on Raspbian by: **abcd567**  
(4) Dec 15, 2016 - Variant for Piaware image by: **wittrup58**

Procedure:  
(1) Download the Word document pertaining to your installation from Dropbox links below.

[Optimize-Gain-Piaware-SD-Card-Image.docx](https://www.dropbox.com/s/uv5bg1ie5pwgfcy/Optimize-Gain-Piaware-SD-Card-Image.docx?dl=1)

[Optimize-Gain-dump-fa-on-Raspbian-Jessie.docx](https://www.dropbox.com/s/4bhv5q9rdu3p5bp/Optimize-Gain-dump-fa-on-Raspbian-Jessie.docx?dl=1)

[Optimize-Gain-dump-mut-on-Raspbian-Jessie.docx](https://www.dropbox.com/s/n1nwinhjg8opvww/Optimize-Gain-dump-mut-on-Raspbian-Jessie.docx?dl=1)

[Optimize-Gain-dump-Malcom-Robson-on-Raspbian-Jessie.docx](https://www.dropbox.com/s/ftq537htu1g1h09/Optimize-Gain-dump-Malcom-Robson-on-Raspbian-Jessie.docx?dl=1)

Script for Piaware sd card img by wittrup58.  
[https://raw.githubusercontent.com/wittrup/piawarebash/master/pyh/optimize-gain-piaware3.py](https://raw.githubusercontent.com/wittrup/piawarebash/master/pyh/optimize-gain-piaware3.py)

(2) Create a blank file:

```auto

sudo nano optimize-gain.py

```

(3) In the newly created blank file, copy-paste the script from relevant downloaded word file from dropbox links above.

(4) Save file Ctl+o and exit editor Ctl+x

(5) Make file executable.

```auto

sudo chmod +x optimize-gain.py

```

(6) Run the script.

```auto

sudo ./optimize-gain.py

```

(7) Go to kitchen and prepare a cup or two of coffee. You will need it during the long wait the script is running and outputs the final results. 🙂

.

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [July 24, 2017, 7:19am UTC](https://discussions.flightaware.com/t/tweaks/20339/5 "2017-07-24T07:19:45Z")

</div>

TWEAK-4:  
Place holder for future tweak

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [July 24, 2017, 7:12pm UTC](https://discussions.flightaware.com/t/tweaks/20339/6 "2017-07-24T19:12:28Z")

</div>

TWEAK-5:  
Place holder for future tweak

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [July 30, 2017, 9:36pm UTC](https://discussions.flightaware.com/t/tweaks/20339/7 "2017-07-30T21:36:02Z")

</div>

.  
Gain Optimization Scripts Added. Please see TWEAK-3

.

---

<div class="post-metadata">

**Author:** ![J89eu](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/j89eu/32/115254_2.png) [@J89eu](https://discussions.flightaware.com/u/J89eu)\
**Post date:** [August 1, 2017, 7:03pm UTC](https://discussions.flightaware.com/t/tweaks/20339/8 "2017-08-01T19:03:02Z")

</div>

Thanks for these tweaks but the first link on tweak 3 isn’t working ☹

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [August 1, 2017, 7:52pm UTC](https://discussions.flightaware.com/t/tweaks/20339/9 "2017-08-01T19:52:49Z")

</div>

> [@J89eu](#):
>
> Thanks for these tweaks but the first link on tweak 3 isn’t working ☹

I checked the links now. All download links, including the first one, are working. Please try again.

---

<div class="post-metadata">

**Author:** ![J89eu](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/j89eu/32/115254_2.png) [@J89eu](https://discussions.flightaware.com/u/J89eu)\
**Post date:** [August 1, 2017, 8:07pm UTC](https://discussions.flightaware.com/t/tweaks/20339/10 "2017-08-01T20:07:16Z")

</div>

I’m getting the following

This site can’t be reached

[www.dropbox.com](http://www.dropbox.com) is currently unreachable.  
ERR\_CONNECTION\_FAILED

---

<div class="post-metadata">

**Author:** ![SoNic67](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/sonic67/32/119872_2.png) [@SoNic67](https://discussions.flightaware.com/u/SoNic67)\
**Post date:** [August 1, 2017, 10:59pm UTC](https://discussions.flightaware.com/t/tweaks/20339/11 "2017-08-01T22:59:56Z")

</div>

Works here.

---

<div class="post-metadata">

**Author:** ![sossanator](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/sossanator/32/93274_2.png) [@sossanator](https://discussions.flightaware.com/u/sossanator)\
**Post date:** [September 16, 2017, 11:22pm UTC](https://discussions.flightaware.com/t/tweaks/20339/12 "2017-09-16T23:22:03Z")

</div>

Tweak 3 issue.  
Getting an error when running the script:

File “./optimize-gain.py”, line 14  
SyntaxError: Non-ASCII character ‘\xc2’ in file ./optimize-gain.py on line 14, but no encoding declared; see [PEP 263 – Defining Python Source Code Encodings | peps.python.org](http://python.org/dev/peps/pep-0263/) for details

I put this # -_- coding: utf-8 -_- at the top of the script however and now getting a new error message:

./optimize-gain.py: 3: ./optimize-gain.py: import: not found  
./optimize-gain.py: 5: ./optimize-gain.py: measure\_duration: not found  
./optimize-gain.py: 6: ./optimize-gain.py: ntests: not found  
./optimize-gain.py: 7: ./optimize-gain.py: Syntax error: “(” unexpected

Working on this with a friend and he is having the same issue on his setup. Thanks in advance for the help.

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [September 17, 2017, 10:34am UTC](https://discussions.flightaware.com/t/tweaks/20339/13 "2017-09-17T10:34:57Z")

</div>

In step (1), which one of following 5 “.docx” files you downloaded from dropbox and copy-pasted to “optimize-gain.py”?

> [@](#):
>
> - Optimize-Gain-Piaware-SD-Card-Image.docx
> 
> - Optimize-Gain-dump-fa-on-Raspbian-Jessie.docx
> 
> - Optimize-Gain-dump-mut-on-Raspbian-Jessie.docx
> 
> - Optimize-Gain-dump-Malcom-Robson-on-Raspbian-Jessie.docx
> 
> - Script for Piaware sd card img by wittrup58.

---

<div class="post-metadata">

**Author:** ![sossanator](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/sossanator/32/93274_2.png) [@sossanator](https://discussions.flightaware.com/u/sossanator)\
**Post date:** [September 17, 2017, 1:15pm UTC](https://discussions.flightaware.com/t/tweaks/20339/14 "2017-09-17T13:15:36Z")

</div>

First one (SD Card Image)

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [September 17, 2017, 2:53pm UTC](https://discussions.flightaware.com/t/tweaks/20339/15 "2017-09-17T14:53:13Z")

</div>

Should be ok. Seems either the .docx file got corrupted during download, or copy-paste did not go well. Python is very sensetive to characterset, spaces and line breaks.

Try again by first deleting both the downloaded **.docx** file and the **optimize-gain** file, then start with fresh download and fresh optimize-gain file.

**Note:** If above does not work, before copy-paste, reduce font size on .docx file so that each line of code takes one line and there is no line break

---

<div class="post-metadata">

**Author:** ![sossanator](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/sossanator/32/93274_2.png) [@sossanator](https://discussions.flightaware.com/u/sossanator)\
**Post date:** [September 17, 2017, 5:02pm UTC](https://discussions.flightaware.com/t/tweaks/20339/16 "2017-09-17T17:02:29Z")

</div>

Will try again, my buddie who was having the same issue reformatted it for me and it did not give an error message it just said it ran but did not(only took 5 sec) he got his working last night having to reconfigure the script and he is helping me with mine. We have different setups but he helped me set mine up originally. Will continue to work on it and keep you informed. Thanks for your help and if you have any other ideas that may pop into your head let me know. I can post a screenshot of the script if needed.

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [September 17, 2017, 8:35pm UTC](https://discussions.flightaware.com/t/tweaks/20339/17 "2017-09-17T20:35:59Z")

</div>

For Piaware SD Card image, there are two alternate scripts (the first and last) . Which one you used and faced problem?

To find where is the problem, I replicate your issue as follows:  
(1) Downloaded “piaware-sd-card-3.5.0.img.zip” and unzipped it.  
(2) Formatted microSD card, and wrote “piaware-sd-card-3.5.0.img” to it.

**TEST-1**

- Downloaded following file:  
**The First one in the list**  
[Optimize-Gain-Piaware-SD-Card-Image.docx](https://www.dropbox.com/s/uv5bg1ie5pwgfcy/Optimize-Gain-Piaware-SD-Card-Image.docx?dl=1)

- Created file optimize-gain.py and copy-pasted from downloaded .docx file

- Made the file executable and then ran the file. **It worked perfectly well without any error.**

**TEST-2**

- Downloaded following file,  
Script for Piaware sd card img by wittrup58.  
[https://raw.githubusercontent.com/wittrup/piawarebash/master/pyh/optimize-gain-piaware3.py](https://raw.githubusercontent.com/wittrup/piawarebash/master/pyh/optimize-gain-piaware3.py)

- Made downloaded file executable, and ran the file. **It ran without any problems**

---

<div class="post-metadata">

**Author:** ![sossanator](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/sossanator/32/93274_2.png) [@sossanator](https://discussions.flightaware.com/u/sossanator)\
**Post date:** [September 18, 2017, 4:12pm UTC](https://discussions.flightaware.com/t/tweaks/20339/18 "2017-09-18T16:12:13Z")

</div>

Ok so I feel like an idiot and trusted that it was the Piaware -SD-Card-Image (thats on a different setup) this setup was actually the Raspbian so i used the Dump-Fa script (second one down) and got the test to start. However it does not seam to be doing all the gain levels. Here is the output:

test 1 of 5  
gain= 49.6 messages= 11866 positions= 906 planes= 55

===Totals===  
Gain, Messages, Positions, Aircraft  
49.6 11866 906 55  
Traceback (most recent call last):  
File “./optimize-gain.py”, line 53, in   
(messages,positions,planes) = results[g]  
KeyError: ‘48.0’

Thanks for your help earlier and I apologize for wasting your time with out me knowing the proper build.

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [September 18, 2017, 6:18pm UTC](https://discussions.flightaware.com/t/tweaks/20339/19 "2017-09-18T18:18:01Z")

</div>

Should work ok. Just now I downloaded file “Optimize-Gain-dump-fa-on-Raspbian-Jessie.docx” (2nd from top) and tried it on Pi with Raspbian Stretch Lite + dump1090-fa. It is working ok. Not yet finished, still continuing. Partial results are below:

```auto
#created new blank file "optimize-gain.py"
pi@raspberrypi:~ $ sudo nano optimize-gain.py

#copy pasted the contents of downloaded file in the blank file "optimize-gain.py"
#saved (ctrl+o) and closed (ctrl+x) file

#made file executable
pi@raspberrypi:~ $ sudo chmod +x optimize-gain.py

#ran the script
pi@raspberrypi:~ $ sudo ./optimize-gain.py
test 1 of 5
gain= 49.6 messages= 18149 positions= 920 planes= 97
gain= 48.0 messages= 18121 positions= 1021 planes= 96
gain= 44.5 messages= 17554 positions= 927 planes= 99
gain= 43.9 messages= 17786 positions= 946 planes= 92
gain= 43.4 messages= 17828 positions= 986 planes= 100
gain= 42.1 messages= 18708 positions= 1085 planes= 86
gain= 40.2 messages= 18436 positions= 1037 planes= 82
gain= 38.6 messages= 14929 positions= 781 planes= 74
gain= 37.2 messages= 13631 positions= 752 planes= 74
gain= 36.4 messages= 13399 positions= 957 planes= 75
gain= 33.8 messages= 11740 positions= 637 planes= 73
gain= 32.8 messages= 9373 positions= 589 planes= 57
gain= 29.7 messages= 8612 positions= 547 planes= 63
gain= 28.0 messages= 8655 positions= 548 planes= 62
gain= 25.4 messages= 7286 positions= 555 planes= 51
gain= 22.9 messages= 7531 positions= 481 planes= 42
gain= 20.7 messages= 4394 positions= 272 planes= 30
test 2 of 5
gain= 49.6 messages= 14719 positions= 874 planes= 88
gain= 48.0 messages= 15736 positions= 964 planes= 91
gain= 44.5 messages= 13704 positions= 737 planes= 85
gain= 43.9 messages= 12560 positions= 624 planes= 86
gain= 43.4 messages= 16597 positions= 1120 planes= 94
gain= 42.1 messages= 17444 positions= 1147 planes= 92
gain= 40.2 messages= 17746 positions= 1234 planes= 98
gain= 38.6 messages= 17836 positions= 1092 planes= 90
gain= 37.2 messages= 15545 positions= 1035 planes= 92
gain= 36.4 messages= 16173 positions= 1225 planes= 88

```

**Please try again.**  
First delete both following files  
(1) Optimize-Gain-dump-fa-on-Raspbian-Jessie.docx  
(2) “optimize-gain.py” (sudo rm optimize-gain.py),

Now again download “Optimize-Gain-dump-fa-on-Raspbian-Jessie.docx”, and repeat all steps.

---

<div class="post-metadata">

**Author:** ![sossanator](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/sossanator/32/93274_2.png) [@sossanator](https://discussions.flightaware.com/u/sossanator)\
**Post date:** [September 18, 2017, 8:19pm UTC](https://discussions.flightaware.com/t/tweaks/20339/20 "2017-09-18T20:19:20Z")

</div>

Ok it took about three times of doing the exact same thing but it is working now. Thank you for all your help.

[Next page](https://discussions.flightaware.com/t/tweaks/20339.md?page=2)
