Announcement

Collapse
No announcement yet.

Gain Optimization Script

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

  • #31
    sudo crontab -e will edit roots crontab. In there you don't need sudo but it doesn't hurt either. Just checking.

    A little confused how -36.4 could end up in there.

    But if you want the changed gain to be displayed correctly maybe just use another method to change the gain (that only works because you already have that map changing gain):

    Code:
    echo "36.4" > /usr/local/sbin/gain/newgain
    With the script you already installed that should work just fine, also the map should correctly show the new gain.
    (Otherwise the map doesn't even know which gain is the gain now, still have no idea why it would display -36.4)

    Comment


    • #32
      Originally posted by Oblivian View Post
      Gains should be entered in +, dump1090 default amounts passed are positive. -10 is the only one that should appear -. So you are probably triggering that somewhere with an invalid value?

      Which makes too many chars to display on the line with "s

      Sent from my EML-L09 using Tapatalk
      I am using valid positive values and the config file shows that it is updating as expected. I think I need to also update a map setting but not sure how, possible something like:-

      sudo sed -n 's/\GAIN=//p' /etc/default/dump1090-mutability > /usr/local/sbin/gain/currentgain

      but when I run that I get "Permission denied"

      Comment


      • #33
        Also note that using

        echo "36.4" > /usr/local/sbin/gain/newgain

        in the crontab to change gain, you don't even need a separate line for restarting dump1090 because the setgain script already takes care of that.

        After thinking about it.... the only valid reason for the gain to be -36.4 is if you somehow got an minus into the crontab, probably after the = sign. (which is an easy typo as those two keys are close to each other.)
        Last edited by wiedehopf; 2019-03-09, 22:47.

        Comment


        • #34
          Code:
          0 0 * * * echo "36.4" > /usr/local/sbin/gain/newgain
          0 6 * * * echo "33" > /usr/local/sbin/gain/newgain
          Use this as your crontab and it should just work in my opinion

          Comment


          • #35
            echo "36.4" > /usr/local/sbin/gain/newgain works perfectly!

            Thanks

            Comment


            • #36
              I am getting this error, could you suggest pls. 10x
              Attached Files

              Comment


              • #37
                I've been testing a new antenna and been running the gain optimizing script "sudo ./optimize-gain-mut.py" as I have many times in the past but now I get this error, either at the end or sometimes a few tests in:-

                [ ok ] Restarting dump1090-mutability (via systemctl): dump1090-mutability.service.
                Traceback (most recent call last):
                File "./optimize-gain-mut.py", line 28, in <module>
                s.connect(('localhost',30003))
                File "/usr/lib/python2.7/socket.py", line 228, in meth
                return getattr(self._sock,name)(*args)
                socket.error: [Errno 111] Connection refused

                The odd thing is that it sometimes completes normally - the error seems totally random.

                Any thoughts

                Scroggie

                Comment


                • #38
                  [QUOTE=- If there are too many entries for > -3 dBfs, reduce gain by 3 dB [/QUOTE]

                  Newbee.... >-3dBfs is -2dBfs then?

                  Comment


                  • #39
                    Originally posted by naturekid72 View Post

                    Newbee.... >-3dBfs is -2dBfs then?
                    Did you istall graphs? If not, do it now


                    After graphs are installed and working for 24 hrs or more (to collect sufficient data), look at bottom of top hraph, you will see:
                    Messages > -3 dBfs (xxx% of messages).

                    If that % is greater than 5%, reduce gain by 3 dB, and leave graphs for 24 hours to collect data with reduced gain. After 24 hours, check the % again. Repeat this till that figure becomes about 5%

                    20200828_080318.png
                    Last edited by abcd567; 2020-08-28, 12:13.

                    Comment


                    • #40
                      It's 0.0% for the last 30 days. Do I then start with 12 or 49.6 or even -10 ?

                      Comment


                      • #41
                        0% is too low, you will miss distant planes.

                        What is your current gain setting? Increade it by say about5 or 6 dB and check % after one day.

                        Check current 24 hrs graph, do not check 30 days graph

                        Comment


                        • #42
                          I ran the excellent Gain Optimisation Script and found I got variable results based on the time of day:

                          Capture.JPG

                          I've assumed that it's number of aircraft that I'm trying to maximise?

                          I also installed the Wiedehopf graphs and ran for 24 hours with 0.0% of messages > -3dBFS. I'm assuming from what's been said before that the gain is too high (it was set to the default of -10). Would I be correct in setting the gain to an initial (say) 38.6 and run again for 24 hours and see what that does to the percentage of messages > -3dBFS and then adjust up or down depending on the results?
                          Last edited by Burton_Ped; 2020-09-12, 08:31.

                          Comment


                          • #43
                            HOWTO: gain This guide assumes you have console access to your Raspberry Pi (For Beginners - How-to SSH to RPi - Setup Putty in Windows) and know how to change the gain. (For Beginners - How to Set / Change Gain) Use this command to get the percentage of strong messages: awk "$(cat /run/dump1090*/stats.json| grep total | sed 's/.*accepted":\[\([0-9]*\).*strong_signals":\([0-9]*\).*/BEGIN {printf "\\nPercentage of strong messages: %.3f \\n" , \2 * 100 \/ \1}/')" Percentages around 5 are wh...


                            Don't assume your gain is too high because it is for some others.

                            Comment


                            • #44
                              Might that explain the drop in messages received when I changed the gain from -10 to 38 at 0900 on Saturday?

                              Capture.JPG

                              Comment


                              • #45
                                I'd recommend either reading the thread or just experimenting.

                                If you have 0 percent with -10 .... reducing the gain is not the way to go.

                                Reducing the gain is usually only necessary when having an amplifier either integrated or external.
                                Likely you don't have one.

                                Comment

                                Working...
                                X