Announcement

Collapse
No announcement yet.

RTl_SDR v3 bias tee power on/off

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RTl_SDR v3 bias tee power on/off

    Does any body know how to invoke bias tee On/off software commande in startup script for V3 of the rtl-sdr?
    When using terminal ttrl.sdr is being "used" can not activate the bias tee, need to do it before dongle is being used på 1090 software.
    does anybod know where to invoce script
    like power on ./rtl_biast -b 1 or power off ./rtl_biast -b 0

  • #2
    RTl_SDR v3 bias tee power on/off Raspberry pi

    Originally posted by claar View Post
    Does any body know how to invoke bias tee On/off software commande in startup script for V3 of the rtl-sdr?
    When using terminal ttrl.sdr is being "used" can not activate the bias tee, need to do it before dongle is being used på 1090 software.
    does anybod know where to invoce script
    like power on ./rtl_biast -b 1 or power off ./rtl_biast -b 0
    This is A raspberry pi with latest "noob light" and Fr24 install script installed, with minimun effort... just to test the rtl-sdr v3 dongle, but want to test a LNA with filter and see difference...

    Comment


    • #3
      Enabling bias-t is a headache for lot of rtl_sdr v3 users.

      https://discussions.flightaware.com/...re-start/20046

      https://discussions.flightaware.com/...g-bias-t/32896
      Last edited by abcd567; 2018-04-21, 13:57.

      Comment


      • #4
        have changed to FR24 pi image instead
        where is best place to insert "~/rtl_biast/build/src/rtl_biast -b 1" before system claims the rtl-sdr device?
        want to keep it simple ..... if possible

        Comment


        • #5
          Sorry, I dont know for sure. This is only a guess:

          In file fr24feed.service, by inserting a line above "ExecStart=/usr/bin/fr24feed".

          The new line inserted should start with ExecStartPre= , followed by your bias-t command.

          This method is untested, as I don't have RTL-SDR V3 dongle.

          EDIT
          April 23, 2018: I have indirectly tested it (WITHOUT RTL-SDR V3). Please see my Post #6 below.

          Code:
          sudo nano /etc/systemd/system/multi-user.target.wants/fr24feed.service

          The above command will open the file fr24feed.service which has following text, in which I have added line in RED for bias-t:

          Code:
          [Unit]
          Description=Flightradar24 Decoder & Feeder
          After=network-online.target
          
          [Service]
          Type=simple
          Restart=always
          LimitCORE=infinity
          ExecStartPre=-/usr/lib/fr24/install_dump1090.sh
          ExecStartPre=-/usr/lib/fr24/unregister_kernel_modules.sh
          ExecStartPre=-/usr/lib/fr24/create_missing_directories.sh
          ExecStartPre=/home/pi/rtl_biast/build/src/rtl_biast -b 1
          ExecStart=/usr/bin/fr24feed
          User=fr24
          Group=fr24
          PermissionsStartOnly=true
          StandardOutput=null
          
          [Install]
          WantedBy=multi-user.target
          Last edited by abcd567; 2018-04-23, 13:32.

          Comment


          • #6
            @claar:
            My guess seems to be correct.
            Since I do not have RTL-SDR V3, I cannot test it on rtl_biast package.
            Instead I tested my method on rtl_test package. The rtl_test is set to start first, grabs DVBT and tests it, finishes test within few seconds and releases DVBT. Only after this fr24feed is started, which in turn starts dump1090-mutability which grabs the DVBT already freed by rtl_test.

            Following are the details of my test/trial:

            Code:
            cd ~/
            
            sudo mkdir test-dir
            sudo chmod a+rwx test-dir
            
            cd test-dir
            
            sudo touch test-output.txt
            sudo chmod a+rwx test-output.txt
            
            sudo touch test-script.sh
            sudo chmod +x test-script.sh

            Code:
            sudo nano test-script.sh

            Contents of Test Script test-script.sh:
            Code:
            #!/bin/bash
            rtl_test -t  &> /home/pi/test-dir/test-output.txt


            Code:
            sudo nano /etc/systemd/system/multi-user.target.wants/fr24feed.service
            The RED line of code is added by me for script test-script.sh which will run rtl_test
            Please note that it has been added BEFORE line ExecStart=/usr/bin/fr24feed, so that it runs before fr24feed starts (which in turn starts dump1090-mutability).
            Code:
            [Unit]
            Description=Flightradar24 Decoder & Feeder
            After=network-online.target
            
            [Service]
            Type=simple
            Restart=always
            LimitCORE=infinity
            ExecStartPre=-/usr/lib/fr24/install_dump1090.sh
            ExecStartPre=-/usr/lib/fr24/unregister_kernel_modules.sh
            ExecStartPre=-/usr/lib/fr24/create_missing_directories.sh
            ExecStartPre=/home/pi/test-dir/test-script.sh
            ExecStart=/usr/bin/fr24feed
            User=fr24
            Group=fr24
            PermissionsStartOnly=true
            StandardOutput=null
            
            [Install]
            WantedBy=multi-user.target

            Code:
            sudo reboot


            Below is the output of rtl_test which proves that at reboot, the rtl_test did grab DVBT before dump1090-mutability could grab it, conducted the test, and then released DVBT for dump1090-mut.

            Same way rtl_biast will start, grab DVB-T, enable bias-t and after this release the DVBT
            Code:
            cat test-dir/test-output.txt
            
            Found 1 device(s):
              0:  Realtek, RTL2832U, SN: 00000000
            
            Using device 0: Generic RTL2832U
            Found Rafael Micro R820T tuner
            Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 
            
            32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
            [R82XX] PLL not locked!
            Sampling at 2048000 S/s.
            No E4000 tuner found, aborting.
            Now ran command top, which shows dump1090-mutability, fr24feed, piaware, pfclient, rbfeeder are all runnung normally.
            Code:
            top
            
            top - 01:44:16 up 3 min,  1 user,  load average: 0.43, 0.25, 0.10
            Tasks: 127 total,   1 running, 126 sleeping,   0 stopped,   0 zombie
            %Cpu(s):  8.2 us,  3.0 sy,  0.0 ni, 88.4 id,  0.0 wa,  0.0 hi,  0.4 si,  0.0 st
            KiB Mem :   949584 total,   576304 free,    76360 used,   296920 buff/cache
            KiB Swap:        0 total,        0 free,        0 used.   809008 avail Mem
            
              PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
              566 fr24      20   0   25736   7196   2108 S  26.8  0.8   0:46.95 dump1090-mutabi
              611 piaware   20   0   13208   9700   6256 S   7.5  1.0   0:12.58 fa-mlat-client
              541 fr24      20   0   95348   3384   2280 S   2.6  0.4   0:04.00 fr24feed
              454 root      20   0   51104   2228   1744 S   2.3  0.2   0:03.74 pfclient
              731 pi        20   0    8104   3292   2804 R   2.0  0.3   0:00.26 top
              426 piaware   20   0   21672  10112   5436 S   1.0  1.1   0:02.99 piaware
              427 root      20   0  101048   6476   5220 S   1.0  0.7   0:02.21 rbfeeder
            Last edited by abcd567; 2018-04-23, 02:22.

            Comment


            • #7
              OK, I did a closer test:
              Build & used package rtl_biast.
              Dongle used was still DVB-T, as I do not have RTL-SDR V3, hence cannot check with a Voltmeter.
              The log file however showed that the rtl_biast did get hold of the Dongle under command rtl_biast -b 1.
              Finally dump1090-mutability found working OK (checked by command top).


              STEP-1:
              Build package rtl_biast
              Code:
              #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 fr24feed
              sudo systemctl stop dump1090-mutability
              
              ./rtl_biast -b 1
              Found Rafael Micro R820T tuner

              STEP-2:
              Created a script containing:
              (a) Red color part - Command to switch on bias-t
              (b) Green color part - Command to redirect output (stdout + stderr) to a log file biast.log to see what is happening.
              Code:
              cd rtl_biast/build/src
              sudo touch biast-start.sh
              sudo chmod +x biast-start.sh
              
              #Opened file for editing
              sudo nano biast-start.sh
              
              #Added following code in the blank file
              
              #!/bin/bash
              /home/pi/rtl_biast/build/src/rtl_biast -b 1  &> /home/pi/biast.log
              
              #Saved file (Ctrl+o) and closed (Ctrl+x)


              STEP-3:
              Edited file fr24feed.service and ADDED line shown in red, above the line ExecStart=/usr/bin/fr24feed

              Code:
              sudo nano /etc/systemd/system/multi-user.target.wants/fr24feed.service
              
              [Unit]
              Description=Flightradar24 Decoder & Feeder
              After=network-online.target
              
              [Service]
              Type=simple
              Restart=always
              LimitCORE=infinity
              ExecStartPre=-/usr/lib/fr24/install_dump1090.sh
              ExecStartPre=-/usr/lib/fr24/unregister_kernel_modules.sh
              ExecStartPre=-/usr/lib/fr24/create_missing_directories.sh
              ExecStartPre=/home/pi/rtl_biast/build/src/biast-start.sh
              ExecStart=/usr/bin/fr24feed
              User=fr24
              Group=fr24
              PermissionsStartOnly=true
              StandardOutput=null
              
              [Install]
              WantedBy=multi-user.target

              STEP-4:
              Tested by rebooting, then checking contents of log file ~/biast.log
              Code:
              sudo reboot
              
              #After reboot, check log file
              cd ~/
              cat biast.log
              Found Rafael Micro R820T tuner
              
              #BINGO! SUCCESS
              STEP-5:
              Checked dump1090-mutability and fr24feed are running OK. FOUND OK
              Code:
              top
              
              top - 15:23:59 up 31 min,  1 user,  load average: 0.54, 0.46, 0.38
              Tasks: 124 total,   1 running, 123 sleeping,   0 stopped,   0 zombie
              %Cpu(s):  7.7 us,  2.5 sy,  0.0 ni, 89.6 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st
              KiB Mem :   949584 total,   693520 free,    83192 used,   172872 buff/cache
              KiB Swap:        0 total,        0 free,        0 used.   801736 avail Mem
              
                PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
                557 fr24      20   0   26608   7984   2032 S  26.5  0.8   8:07.10 dump1090-mutabi
                613 piaware   20   0   13208   9712   6268 S   7.8  1.0   2:19.65 fa-mlat-client
                535 fr24      20   0   95348   5856   2300 S   2.3  0.6   0:43.09 fr24feed
                448 root      20   0   51368   2808   2140 S   2.0  0.3   0:39.29 pfclient
                905 pi        20   0    8104   3244   2732 R   2.0  0.3   0:00.43 top
                418 root      20   0  101988   7772   5532 S   1.3  0.8   0:23.19 rbfeeder
                417 piaware   20   0   21672  10200   5524 S   1.0  1.1   0:20.61 piaware
              Last edited by abcd567; 2018-04-28, 20:43. Reason: corrected file name: biast-start.sh

              Comment


              • #8
                Have tried, work exelent thx, will now try to put LNA with antenna on roof ( in a IP65 box) and feed in with aprox 7-8 meter good coax) have measured LNA ( RTL-SDR Blog ADS-B Triple Filtered LNA Bias Tee Powered) to 45dB, not 27dB as spec said, one again thx for all help to put scripts where it belong...

                Comment


                • #9
                  F I N A L

                  In my previous post there are several steps.
                  Actually only following two steps are needed to switch-on the bias-t
                  Others steps were meant to test the success WITHOUT actually using a RTL-SDR V3 and measuring Voltage avaialbility.

                  For normal use with RTL-SDR V3, only following 2 steps are required:

                  Please note that STEP-2 below is different from similar steps in my previous posts.
                  The STEP-2 below does NOT start a script to switch-on the bias-t. Instead it uses direct command to switch-on the bias-t.


                  STEP-1:
                  Build package rtl_biast

                  Code:
                  #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 .. -DDETACH_KERNEL_DRIVER=ON
                  make   
                  
                  
                  #TEST-1
                  cd src   
                  ./rtl_biast -b 1   
                  
                  usb_claim_interface error -6
                  
                  
                  #TEST-2
                  sudo systemctl stop fr24feed   
                  sudo systemctl stop dump1090-mutability   
                  
                  ./rtl_biast -b 1   
                  Found Rafael Micro R820T tuner

                  STEP-2:
                  Configure fr24feeder to switch-on bias-t of RTL-SDR V3, BEFORE starting fr24feed (which will start dump1090-mutability).

                  (a) Edit file fr24feed.service and ADD line shown in red, above the line ExecStart=/usr/bin/fr24feed
                  (b) Reboot Pi.
                  (c) After reboot, DC Voltage will be available at RTL-SDR V3 for LNA

                  Code:
                  sudo nano /etc/systemd/system/multi-user.target.wants/fr24feed.service  
                  
                  [Unit]
                  Description=Flightradar24 Decoder & Feeder
                  After=network-online.target
                  
                  [Service]
                  Type=simple
                  Restart=always
                  LimitCORE=infinity
                  ExecStartPre=-/usr/lib/fr24/install_dump1090.sh
                  ExecStartPre=-/usr/lib/fr24/unregister_kernel_modules.sh
                  ExecStartPre=-/usr/lib/fr24/create_missing_directories.sh
                  ExecStartPre=/home/pi/rtl_biast/build/src/rtl_biast -b 1    
                  ExecStart=/usr/bin/fr24feed
                  User=fr24
                  Group=fr24
                  PermissionsStartOnly=true
                  StandardOutput=null
                  
                  [Install]
                  WantedBy=multi-user.target
                  Last edited by abcd567; 2019-07-25, 01:38.

                  Comment


                  • #10
                    O P T I O N A L

                    Logging Bias-T Start:

                    If you do not want to log the bias-t start events, then method given in my post #9 above (Titled: FINAL) is good for you.


                    However if someone want to log the bias-t start events, then DO NOT ADD following line given in my post #9 above
                    Code:
                    ExecStartPre=/home/pi/rtl_biast/build/src/rtl_biast -b 1
                    Instead, ADD this line:
                    Code:
                    ExecStartPre=/bin/bash -c "date >> /var/log/biast.log && /home/pi/rtl_biast/build/src/rtl_biast -b 1 >> /var/log/biast.log 2>&1"  

                    You can check the log file by command given below.

                    Code:
                    cat /var/log/biast.log
                    
                    Mon 30 Apr 11:29:47 EDT 2018
                    Found Rafael Micro R820T tuner
                    Mon 30 Apr 11:34:35 EDT 2018
                    Found Rafael Micro R820T tuner
                    Mon 30 Apr 11:45:17 EDT 2018
                    Found Rafael Micro R820T tuner
                    Mon 30 Apr 11:53:07 EDT 2018
                    Found Rafael Micro R820T tuner
                    Note:
                    (1) I have intentionally restarted fr24feed several times in half an hour period to create the sample log above.
                    (2) On rebooting Pi, the log is cleared, and a fresh log with single entry at last reboot remains.
                    (3) All entries at manual restart of fr24feed are stored as shown above, till Pi is rebooted, which clears all the previous logs.
                    Last edited by abcd567; 2018-04-30, 18:33.

                    Comment


                    • #11
                      I have a setup using dump1090-mutability 1.15 which is not started by fr24feed (I can't get it to take control) and has to be set to start at boot...

                      Code:
                      sudo nano /etc/default/dump1090-mutability
                      #changed "no" to "yes"
                      START_DUMP1090="yes"
                      Is there some alternative way of switching on the bias tee, or alternatively how might fr24feed be encouraged to control the startup of dump1090-mutability?

                      My sincere apologies if this has been covered before but I haven't been able to find a fix so far.
                      Last edited by jackthom; 2018-09-05, 11:12.

                      Comment


                      • #12
                        Copy of my post #103 dated 2018-05-04 in the thread "How to Install dump1090-mutability_1.15~dev on RPi"

                        RTL-SDR V3 Dongle
                        Enabling Auto Switch-ON of Bias-T in dump1090-mutability v1.15~dev.


                        There is a method posted on the RTL-SDR Blog on April 28, 2018, which is applicable to Piaware/dump1090-fa and uses bias-t start command through file dump1090-fa.service.


                        This method does not apply to dump1090-mutability v1.15~dev, as the dump1090-mutability.service files are automatically generated by "systemd-sysv-generator", and all the changes made by user are overwritten at restart / reboot.

                        The dump1090-mutability.service starts dump1090-mutability through the file /etc/init.d/dump1090-mutability, which is not overwritten at reboot/restart. I have therefore added bias-t start and logging script in that file, and it works OK.

                        STEP-1:

                        Build package rtl_biast

                        Code:
                        #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 
                        sudo mkdir build 
                        cd build 
                        sudo cmake .. 
                        sudo 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.

                        Code:
                        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).

                        Code:
                        # 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
                        Code:
                        /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:


                        Code:
                        # 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.
                        Code:
                        sudo systemctl daemon-reload 
                        sudo systemctl restart dump1090-mutability
                        Check log
                        Code:
                        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:

                        Code:
                        # 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

                        Comment


                        • #13
                          LNA working perfectly with bias tee, thank you again abcd567.
                          Last edited by jackthom; 2018-09-06, 11:41.

                          Comment


                          • #14
                            Hello, so it mean the biast-t don't start with RP-Pi?
                            So if my electricity power off, I must into RP to switch on manualy?
                            Thanks

                            Comment


                            • #15
                              For me the thing that worked is:
                              Code:
                              sudo crontab -e
                              And than I added:
                              Code:
                              @reboot sudo service dump1090-fa stop && cd ~/rtl_biast/build/src && ./rtl_bias$
                              This made the setup finally work, even after a power off and reboot.

                              Comment

                              Working...
                              X