What's the easiest way of adding the choice of GAIN in Skyaware?

Hi!
I have Flightaware Pro Stick Plus and I use dump1090-fa in 6.1 version.
pi@raspberrypi:~ $ apt-cache policy dump1090-fa
dump1090-fa:
Installed: 6.1
Candidate: 6.1

I have recently noticed that it is possible to manually choose Gain in GUI Skyaware. I have read through the topics below, but I don’t know how to do it to avoid it crushing with ADSBExchange, Radarbox,Flightradar and Planefinder.

Could you please give me any sort of advice on how to make it work?

Thanks,
best regards.

1 Like

I am using this one:

 

 

 

1 Like

I want it to look exactly like this, but I don’t have this option added. What commands should I use to make it work? I can see you use dump1090 in 7.0ver. Is it a test version or can I update my interface to it?

No, dont use 7.0~dev version, it is not recommended, as it is still “work in progress” and has no advantage yet over released version 6.1. I have installed it as test.

You shoud wait till it is released officially, most likely by the end of year,

This gain control is NOT part of skyawsre. It is an add-on. Yiu can add this by running following script.

Scroll right to see and copy thid long command

sudo bash -c "$(wget -O - https://raw.githubusercontent.com/abcd567a/set-gain/master/raspios+dump-fa-6.1.sh)"   

After sript finishes, it will display a set of indtructions. Follow those… These instructions are given here slso for your easy reference;

1 Like

Thanks for the instructions! Before I use it I want to make sure about some things below:

  1. Does this script regulate gain for all of the following services: radaxbox, flightradar, planefinder, adsbexchange?
  2. I think that in settings of Flightradar I might have seen -10, but I can’t find this option now. I read that it is some kind of auto gain, won’t it interfere with the rest of the settings? Is it possible to verify it?

This add-on button changes the gain of dump1090-fa. All the feeders (flightaware, radaxbox, flightradar, planefinder, adsbexchange) are fed from dump1090-fa, and any change in dump1090-fa’s performance will affect all feeders.

The Flightradar24 controls gain only if you use its dump1090-mutability. As you are not using dump1090-mutability, Flightradar24 feeder will not control gain even if you enter gain in its settings.

-10 in previous versions is same as 60 in ver 6.1

Note:
(1) Do not forget to make a backup copy of file /usr/share/skyaware/html/index.html before you start editing it. This is important to revert if you make a mistake during editing.

(2) If after running the script and adding the prescribed line of code in crontab and rebooting, you dont want to make any changes in the file /usr/share/skyaware/html/index.html, you can still get and use the gain add-on in browser at following address:

IP-of-Pi/skyaware/gain.php

 

image

 

With dropdown open, showing all available & selectable values of gain

1 Like

This mod does not work for me in Microsoft Edge. I changed from 60 gain to 48.0 and it worked. Unable to change the gain with the mod to anything other than 48.0 Page refresh does nothing. Did a step in the instructions get missed?
KB4ERT…

1 Like

(A) This script is for package install of dump1090-fa on Raspi OS . It will NOT work on Piaware SD Card image. Which one is your install?

(B) It is for dump1090-fa ver 6.0 and 6.1. It wont work on older versions.

(C) I have just now tested it in Microsoft Edge,and it works.
Did you execute following steps after the script completed execution?

(D) If all above is OK, then it seems some file in your install got corrupted.
Please delete the existing files by following command and run the script again.

(1) DELETE THE “SET-GAIN” FILES & FOLDERS:

sudo rm /usr/share/skyaware/html/gain.php  

sudo rm -rf /usr/local/sbin/gain  

 

(2) AGAIN INSTALL “SET-GAIN” FILES AND FOLDERS:
Scroll right to see and copy this long command

sudo bash -c "$(wget -O - https://raw.githubusercontent.com/abcd567a/set-gain/master/raspios+dump-fa-6.1.sh)"     

sudo reboot  

1 Like

Thanks, I will try it again…
KB4ERT…

1 Like

Thanks for the advice.
After using the script, I can choose a gain from the link http://192.168.1.21/skyaware/gain.php
script
As you can see, it is set on 60 in default. Could you tell me what does it mean? Is it a maximum enhancement? Or is it some kind of autogain?
After using “command sudo crontab -e” I had already had this line, so does it mean I should ommit the first point of the instruction?

(1) In your screenshot, it is NOT showing value of “Current Gain”. First Reboot Pi and after reboot, Reload Browser. It will start showing current gain in red like “Current Gain 44.5”. Please see my screenshot below.

(2) The 60 displayed in dropdown is NOT the gain set. It is only the first value of the list of selectable values. When you open the dropdown it will display all values, and you can choose the one you want. Please see screeshot below.

The 60 in current version is same as -10 was in previous versions. The default setting of dump1090-fa used to be -10 in previous versions. In ver 6.0 & 6.1 the default setting is 60.

 

 

Yes, last night I have modified the installation script, and the script now adds line in crontab. The first point of instruction (sudo crontab -e) is no more required to be done by user. Please see screenshot below which is displayed when script finishes installation.

 

Set-Gain

 

1 Like

To install on Raspi OS Buster or Bullseye with package install of dump1090-fa ver 6.1, run following command:

The command bellow may be wrapped and displayed in two lines, but it is one single command. Copy both lines together

sudo bash -c "$(wget -O - https://raw.githubusercontent.com/abcd567a/set-gain/master/raspios+dump-fa-6.1.sh)"

 

When the script finishes installation, it displays instructiond for embedding Gain Button in Skyaware Map.

Please copy-paste these instructions in Notepad and save.

Set-Gain-1

 

Set-Gain-2

 

To Uninstall

sudo rm /usr/share/skyaware/html/gain.php  

sudo rm -rf /usr/local/sbin/gain  

sudo crontab -e
## In file opened, locate and DELETE following line. 
@reboot /bin/bash /usr/local/sbin/gain/setgain.sh  

## Reboot Pi
sudo reboot

To remove embedded gain button from Skyaware Map

 
Set-Gain-3

 

If you have embeded gain button in Skyaware Map by modifying file index.html in folder /usr/share/skyaware/html/ then it is easy to remove it.

CASE-1: If you followed installation instructions and have created a backup copy index.html.orig before starting modifications:

Copy backup file index.html.orig over modified file index.html by following commands:

cd /usr/share/skyaware/html/ 
sudo cp index.html.orig index.html   

## Reload Browser (Ctrl+F5)

CASE-2: If you did not create a backup of file index.html before modifying it.

Delete the 3 lines of code you have added to file index.html by following method:

(1) Open file index.html for editing

sudo nano /usr/share/skyaware/html/index.html

(2) Press Ctrl+W and type buttonContainer and press Enter key.
The cursor will jump to <div class="buttonContainer">
Delete following 3 lines of code you have added just above line <div class="buttonContainer">

    <div id="GAIN" style="text-align:center;width:175px;height:65px;">
    <iframe src=gain.php style="border:0;width:175px;height:65px;"></iframe>
    </div> <!----- GAIN --->

 
(3) Save & Close file index.html. Go to Skyaware Map and Reload browser (Ctrl+F5).

 

1 Like

Thanks again for detailed advice.
However, it seems to me that something has gone wrong.
After refreshing the browser window it looks like this:


Unfortunately, it cannot be regulated at this point.
Even if I change the page layout, the Gain selection is disabled:

I can easily regulate the Gain at the link: http://192.168.1.21/skyaware/gain.php

The edited file looks like this:

How to fix it?

 

You have inserted 3 lines of code at wrong place (i.e. BELOW <div class="buttonContainer">)
Delete these 3 lines, and insert these 3 lines JUST ABOVE <div class="buttonContainer">
Please see image below.

 

Here the 3 code lines are inserted at right location

buttonContainer

1 Like

Great. Everything is working perfectly now:


Thank you for the exact explanation. If you can, please tell me how to choose the best gain now?
As you look at the weekly stats there was a fluctuation in quantity. How can I most precisely check at which amplification I receive the most?
rb
seen

I choose it by trial-and-error.
I start with gain 60, note plane count & message rate, then change gain to say 48.0 and after waiting for few minutes again check message rate and plane count. I keep on decreasing gain and noting message rate and plane count, then see where I got the best performance and set the gain at that value.

1 Like

I see. It looks nice here:
pi@piaware:~$ sudo ./optimize-gain.py
test 1 of 5
gain= 49.6 messages= 8142 positions= 958 planes= 40
gain= 48.0 messages= 7694 positions= 1006 planes= 39
gain= 44.5 messages= 7717 positions= 1094 planes= 35
gain= 43.9 messages= 8051 positions= 1140 planes= 38
gain= 43.4 messages= 8226 positions= 1261 planes= 42
gain= 42.1 messages= 7808 positions= 1268 planes= 41
gain= 40.2 messages= 8344 positions= 1275 planes= 37
gain= 38.6 messages= 8625 positions= 1426 planes= 41
gain= 37.2 messages= 9462 positions= 1502 planes= 42
gain= 36.4 messages= 9559 positions= 1597 planes= 38
gain= 33.8 messages= 9148 positions= 1630 planes= 42
gain= 32.8 messages= 9694 positions= 1635 planes= 40
gain= 29.7 messages= 10399 positions= 1845 planes= 42
gain= 28.0 messages= 9807 positions= 1639 planes= 38
gain= 25.4 messages= 9589 positions= 1572 planes= 38
gain= 22.9 messages= 8963 positions= 1451 planes= 33
gain= 20.7 messages= 7941 positions= 1273 planes= 30
However, after typing this command, I have the message “not found”. Should I understand that I need to install something?
pi@raspberrypi:~ $ sudo ./optimize-gain.py
sudo: ./optimize-gain.py: command not found

This is a very old method and most likely it wont work on current version 6.1 of dump 1090-fa.

You got the “not found” message because this method requires a file named “optimized-gain.py” to be present on your RPi. This file is to be created by you. Please see this post.

TWEAK-3: Gain Optimization Scripts

 

 

1 Like

Of course. Then I won’t install it. I’m afraid something will go wrong. I suspect this script was reading data from some logs. Will I find one on RPi? If so, where to look for them? I want it to look similar to this script.

 

Dont be afraid. Running the script “optimize-gain.py” wont cause any harm, but it may not work properly with current version of dump1090-fa. However there is no harm in trying it.

There is nothing to be installed. Download the Word file (Optimize-Gain-dump-fa-on-Raspbian-Jessie.docx ) on your Desktop or Laptop, create a blank file named “optimize-gain.py” in your RPi, and copy-paste the code from the downloaded Word file, and save the file. Follow the instructions in the TWEAKS post I have linked in my post above.

If file “optimize-gain.py” does not work properly, simply delete it.

EDIT:

Tested the file linked above. It does NOT work on current versions of Raspbian, Python, and dump1090-fa. Needs modifications to make it compatible to current versions of OS, Python, and dump1090-fa.

 

1 Like