The method posted on the RTL-SDR Blog is applicable to dump1090-fa only.
It does not apply to dump1090-mutability v1.15~dev, as ALL the dump1090-mutability service files (dump1090-mutability.service
) are automatically generated by systemd-sysv-generator, and all the changes made by user are overwritten at restart / reboot.
However as the systemd-sysv-generator
generates dump1090-mutability.service
by reading from file `/etc/init.d/dump1090-mutability, I have added bias-t start and logging script in that file, and it works OK.
STEP-1
Build package rtl_biast
#First installed Packages needed to build and to fulfill dependencies
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install libusb-1.0
#Now build rtl_biast
git clone https://github.com/rtlsdrblog/rtl_biast
cd rtl_biast
mkdir build
cd build
cmake ..
make
#TEST-1
cd src
./rtl_biast -b 1
usb_claim_interface error -6
#TEST-2
sudo systemctl stop dump1090-mutability
./rtl_biast -b 1
Found Rafael Micro R820T tuner
STEP-2:
(1) Open file /etc/init.d/dump1090-mutability
in editor.
sudo nano /etc/init.d/dump1090-mutability
(2) In the file opened, scroll down to following portion of code
(You can quickly reach there by pressing Ctrl+w
, then typing do_start
, then pressing Enter Key).
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
(3) Insert following 2 lines
/home/pi/rtl_biast/build/src/rtl_biast -b 1 >> /var/log/biast.log 2>&1
date >> /var/log/biast.log
The lines should be inserted at location shown below:
# Function that starts the daemon/service
#
do_start()
{
/home/pi/rtl_biast/build/src/rtl_biast -b 1 >> /var/log/biast.log 2>&1
date >> /var/log/biast.log
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
(4) Save file (Ctrl+o) and Close editor (Ctrl+x)
(5) Reload daemon to incorporate changes, then restart dump1090-mutability.
sudo systemctl daemon-reload
sudo systemctl restart dump1090-mutability
Check log
cat /var/log/biast.log
Found Rafael Micro R820T tuner
Tue May 1 14:25:06 EDT 2018
.
Explanation of code:
"/home/pi/rtl_biast/build/src/rtl_biast -b 1
" switches on the bias t
“>> /var/log/biast.log 2>&1
” sends output (stdout+stderr) to file /var/log/biast.log
“date >> /var/log/biast.log
” timestamps the log
.
If you are interested only in switching-on the bias-t, and are not interested in creating biast log, then only one short line (i.e. /home/pi/rtl_biast/build/src/rtl_biast -b 1
) need to be added as shown below:
# Function that starts the daemon/service
#
do_start()
{
/home/pi/rtl_biast/build/src/rtl_biast -b 1
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started