Tweaks

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

TWEAK #1: RANGE CIRCLES
(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
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
(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:
Place holder for future

TWEAK #5:
Place holder for future

3 Likes

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



#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://s20.postimg.org/qhl9lg2t9/Color_Circle-dump-fa.png

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



#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://s20.postimg.org/cel3hvccd/Color_Circles.png

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)



#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

IMAGE 2 OF 2: AFTER ABOVE MODIFICATIONS


.
.
.
.
.
.

(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



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



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

2 Likes

TWEAK-3: Gain Optimization Scripts

Source thread: Gain Adjustment…

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

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.
https://raw.githubusercontent.com/wittrup/piawarebash/master/pyh/optimize-gain-piaware3.py

(2) Create a blank file:


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.


sudo chmod +x optimize-gain.py

(6) Run the script.


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. :slight_smile:

.

2 Likes

TWEAK-4:
Place holder for future tweak

1 Like

TWEAK-5:
Place holder for future tweak

1 Like

.
Gain Optimization Scripts Added. Please see TWEAK-3

.

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

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

I’m getting the following

This site can’t be reached

www.dropbox.com is currently unreachable.
ERR_CONNECTION_FAILED

Works here.

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 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.

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

First one (SD Card Image)

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

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.

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

  • 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

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.

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:

#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.

1 Like

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