CASE-1
Piaware SD Card image written to microSD card
(Piaware Image downloaded from PiAware - build your own ADS-B ground station for integration with FlightAware - FlightAware )
(a) In this example gain is set to 30. Instead of 30 use the gain value you want to set
(b) Gain is set to 29.7 instead of 30 as shown in last line. This is due to fact that dongle cannot be set to any value, but to one of the permissible values nearest to the value you specify in the gain setting command.
Step-1:
Set gain to value 30 by giving following command:
pi@piaware:~$ sudo piaware-config rtlsdr-gain 30
#The above command will output following:
Set rtlsdr-gain to 30 in /boot/piaware-config.txt:60
.
Step-2:
Restart dump1090-fa to implement the newly set gain value
pi@piaware:~$ sudo systemctl restart dump1090-fa
.
Step-3:
Verify that the new value of gain is actually implemented
pi@piaware:~$ sudo systemctl status dump1090-fa -l
Last line of output of above command
piaware dump1090-fa[1254]: rtlsdr: tuner gain set to 29.7 dB
.
CASE-2
Raspbian image written to microSD card, then Piaware Add-on Package and dump1090-fa Add-on package installed
(Raspbian image downloaded from Raspberry Pi OS ā Raspberry Pi
Piaware and dump1090-fa Add-on packages installed as per instructions on PiAware - dump1090 ADS-B integration with FlightAware - FlightAware )
(a) In this example gain is set to 30. Instead of 30 use the gain value you want to set
(b) Gain is set to 29.7 instead of 30 as shown in last line. This is due to fact that dongle cannot be set to any value, but to one of the permissible values nearest to the value you specify in the gain setting command.
Step-1:
Open file /etc/default/dump1090-fa in nano to edit it
sudo nano /etc/default/dump1090-fa
Above command will open file /etc/default/dump1090-fa which has following content:
# dump1090-fa configuration
# This is read by the systemd service file as an environment file,
# and evaluated by some scripts as a POSIX shell fragment.
# If you are using a PiAware sdcard image, this config file is regenerated
# on boot based on the contents of piaware-config.txt; any changes made to this
# file will be lost.
RECEIVER_OPTIONS="--device-index 0 --gain -10 --ppm 0 --net-bo-port 30005"
DECODER_OPTIONS="--max-range 360"
NET_OPTIONS="--net --net-heartbeat 60 --net-ro-size 1000 --net-ro-interval 1 --net-ri-port 0 --net-ro-port 30002 --net-sbs-port 30003 --net-bi-port 30004,30104 --net-bo-port 30005"
JSON_OPTIONS="--json-location-accuracy 1"
.
Step-2:
In the line starting with RECEIVER_OPTIONS, change the gain value from -10 to the required value. In this example it will be changed to 30.
Line before change:
RECEIVER_OPTIONS=āādevice-index 0 āgain -10 --ppm 0 --net-bo-port 30005ā
Line after change:
RECEIVER_OPTIONS=āādevice-index 0 āgain 30 --ppm 0 --net-bo-port 30005ā
After changes are made as above, save changes (Ctrl+o) and close file (Ctrl+x)
Step-3:
Restart dump1090-fa to implement the newly set gain value
pi@raspberrypi:~ $ sudo systemctl restart dump1090-fa
.
Step4:
Verify that the new value of gain is actually implemented
pi@raspberrypi:~ $ sudo systemctl status dump1090-fa -l
The last line of output of above command will show gain actually set
piaware dump1090-fa[1254]: rtlsdr: tuner gain set to 29.7 dB