Announcement

Collapse
No announcement yet.

Two instances of FR24feed on the same linux box?

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

  • Two instances of FR24feed on the same linux box?

    After using the Windows feeder for several years, I have successfully migrated to feeding using the Linux/generic/i686/1.0.18-5 feeder. Many thanks to users abcd567 and others for the easy to follow instructions. I am also grateful that it was much less 'painful' than I anticipated.

    While leaving that feed running as it is, I want to create a new feed to track an experimental antenna installation, without disturbing the original. Obviously the new feed will require a separate sharing key and a separate installation of the feeder software.

    Is it possible/practical to run two instances of the FR24feed software on the same Linux box? This would be JUST the feeder, since the decoding would be handled by dump1090 running on a separate box and sent over the network. The two instances would each need to be using their own configuration files and ports.

    So my question isn't how to feed data to multiple tracking sites, but rather how to run multiple instances of FR24feed on one Linux box?

    Thanks
    yxespotter
    Saskatoon, Canada

  • #2
    I think the path to the config file is hardcoded into the application (/etc/fr24feed.ini)

    You could write a service file i suppose that copies a separate configuration to that location before each instance is started.
    Then you should of course ensure they are not started at the same time so the starting should probably be handled by the same service/script.

    Anyway good luck.

    Comment


    • #3
      Hi Yxespotter

      Nice to hear from you after a long gap

      Some years ago, you have successfully run two instances of dump1090-mutability on one RPi. On same lines, it is possible to run two instances of fr24feed. The main problem in case of fr24feed has been pointed out by @wiedehopf: the init file name and path is hard coded in the fr24feed binary.

      Have a look here:

      One Pi, Two Dongles, Two Maps

      .
      Last edited by abcd567; 2019-04-14, 23:11.

      Comment


      • #4
        How about running the second instance on a linux VM on your linux machine?

        Comment


        • #5
          You can actually run up to 3 RTL tv tuner dongles at the same time on a Pi 3 board. I've done it before as a multi channel network tv tuner.

          Check out this thread... these guys are doing it.
          https://forums.liveatc.net/feed-setu...tuner-dongles/
          www.ADS-B.ca

          Comment


          • #6
            Method in followin post may be used:

            https://forum.flightradar24.com/thre...l=1#post117129


            However for two instances of fr24feed it will require following differences:

            (Method below is untested. This is a concept only.)

            (1) In step (4), create TWO fr24feed service files, with different names, for example these can be named "fr24feedA.service" and "fr24feedB.service".

            (2) passing all config options with the following line in service file:

            ExecStart=/usr/bin/fr24feed

            To be changed to

            ExecStart=/usr/bin/fr24feed --fr24key xxxxx --receiver dvbt
            OR
            ExecStart=/usr/bin/fr24feed --fr24key xxxxx --receiver beast-tcp --host 127.0.0.1:30005

            I will give it a try when I find time.
            Last edited by abcd567; 2019-04-15, 21:36.

            Comment


            • #7
              OBJECTIVE
              On one Linux machine, we have to setup two feeders with two feeder id
              fr24feed-1 with fr24key=xxxxxxxxxxxxxxxx
              fr24feed-2 with fr24key=yyyyyyyyyyyyyyyy

              STEP-1
              Follow the steps in this post

              One Pi, Two Dongles, Two Maps


              This will install dump1090-mutability with following two instances running simutaneosly (requires 2 dvb-t dongles)
              • dump1090-mutability, uses dongle 0. outputs Beast format data on port 30005
              • dump1090-mut-2, uses dongle 1. outputs Beast format data on port 31005



              STEP-2
              Follow steps given below to install two instances of FR24 FEEDER
              • fr24feed-1, uses fr24key=xxxxxxxxxxxxxxxx, gets data from dump1090-mutability on port 30005
              • fr24feed-2, uses fr24key=yyyyyyyyyyyyyyyy, gets data from dump1090-mutability-2 on port 31005


              2.1 - Download, extract, and install fr24feed binary

              Code:
              sudo wget https://repo-feed.flightradar24.com/linux_x86_64_binaries/fr24feed_1.0.18-5_amd64.tgz 
              sudo tar -xzf fr24feed_1.0.18-5_amd64.tgz
              cd fr24feed_amd64
              sudo install fr24feed /usr/bin/

              2.2 - Add system user fr24 to run the binary through fr24feed.service
              Code:
              sudo useradd --system fr24

              2.3 - Create fr24feed-1 service
              2.3.1 - Create a blank file fr24feed-1.service
              Code:
              sudo nano /lib/systemd/system/fr24feed-1.service
              2.3.2 - Copy-paste following code in blank file fr24feed-1.service
              Save file (Ctrl+o) and close file (Ctrl+x)
              Code:
              [Unit]
              Description=Flightradar24 Feeder
              After=network-online.target
              
              [Service]
              Type=simple
              Restart=always
              LimitCORE=infinity
              RuntimeDirectory=fr24feed
              RuntimeDirectoryMode=0755
              ExecStartPre=/bin/mkdir -p /var/log/fr24-1
              ExecStartPre=/bin/chown fr24 /var/log/fr24-1
              ExecStart=/usr/bin/fr24feed --fr24key=xxxxxxxxxxxxxxxx --receiver=beast-tcp --host=127.0.0.1:30005 --logmode=1 --logpath=/var/log/fr24-1/
              User=fr24
              PermissionsStartOnly=true
              StandardOutput=null
              
              [Install]
              WantedBy=multi-user.target
              2.3.3 - Enable fr24feed-1 service
              Code:
              sudo systemctl enable fr24feed-1


              2.4 - Create fr24feed-2 service
              2.4.1 - Create a blank file fr24feed-2.service
              Code:
              sudo nano /lib/systemd/system/fr24feed-2.service
              2.4.2 - Copy-paste following code in blank file fr24feed-2.service
              Save file (Ctrl+o) and close file (Ctrl+x)

              Code:
              [Unit]
              Description=Flightradar24 Feeder
              After=network-online.target
              
              [Service]
              Type=simple
              Restart=always
              LimitCORE=infinity
              RuntimeDirectory=fr24feed
              RuntimeDirectoryMode=0755
              ExecStartPre=/bin/mkdir -p /var/log/fr24-2
              ExecStartPre=/bin/chown fr24 /var/log/fr24-2
              ExecStart=/usr/bin/fr24feed --fr24key=yyyyyyyyyyyyyyyy --receiver=beast-tcp --host=127.0.0.1:31005 --logmode=1 --logpath=/var/log/fr24-2/
              User=fr24
              PermissionsStartOnly=true
              StandardOutput=null
              
              [Install]
              WantedBy=multi-user.target
              2.4.3 - Enable fr24feed-2 service
              Code:
              sudo systemctl enable fr24feed-2

              2.5 - Start feeders. (these two feeders will automatically start at boot)
              Code:
              sudo systemctl restart fr24feed-1  
              sudo systemctl restart fr24feed-2

              2.6 - Check status

              Feeder-1
              Code:
              abcd@debian:~$ sudo systemctl status fr24feed-1
              ● fr24feedA.service - Flightradar24 Feeder
                 Loaded: loaded (/lib/systemd/system/fr24feed-1.service; enabled; vendor preset: enabled)
                 Active: active (running) since Tue 2019-04-16 03:33:06 EDT; 1h 22min ago
               Main PID: 9871 (fr24feed)
                  Tasks: 9 (limit: 4915)
                 CGroup: /system.slice/fr24feed-1.service
                         └─9871 /usr/bin/fr24feed --fr24key=yyyyyyyyyyyyyyyy --receiver=beast-tcp --host=127.0.0.1:30005
              
              Apr 16 03:33:06 debian systemd[1]: Started Flightradar24 Feeder.

              Feeder-2
              Code:
              abcd@debian:~$ sudo systemctl status fr24feed-2
              ● fr24feedB.service - Flightradar24 Feeder
                 Loaded: loaded (/lib/systemd/system/fr24feed-2.service; enabled; vendor preset: enabled)
                 Active: active (running) since Tue 2019-04-16 03:33:27 EDT; 1h 19min ago
               Main PID: 9897 (fr24feed)
                  Tasks: 8 (limit: 4915)
                 CGroup: /system.slice/fr24feed-2.service
                         └─9897 /usr/bin/fr24feed --fr24key=xxxxxxxxxxxxxxxx --receiver=beast-tcp --host=127.0.0.1:31005
              
              Apr 16 03:33:27 debian systemd[1]: Started Flightradar24 Feeder.
              2.7 - Check Log files

              Code:
              cat /var/log/fr24-1/fr24feed.log
              
              cat /var/log/fr24-2/fr24feed.log
              PENDING:
              Log file. (Done on 16/04/2019 by modifying .service files)
              Resolve conflict between two instances for web page "localhost:8754"

              .
              Last edited by abcd567; 2019-04-16, 23:31.

              Comment


              • #8
                Do you just delete the /etc/fr24feed.ini when you give the parameters on the command line?

                Or do the command line parameters take precedence anyway?

                Also maybe you should mention that you can get a second feed key by using:
                Code:
                sudo fr24feed --signup
                It will put the share key into /etc/fr24feed.ini, so you need to note down your key before doing that.

                You can look up the feed keys you already have on the fr24 website:
                https://www.flightradar24.com/account/data-sharing
                Last edited by wiedehopf; 2019-04-16, 10:16.

                Comment


                • #9
                  I just tried running a second instance on the command line for testing.

                  It seems you should disable MLAT on one receiver because the ports are probably hard coded and the two UDP connections get in each others way.

                  Adding --mlat=no to one of the command lines should be sufficient.

                  Comment


                  • #10
                    For troubleshooting it might not hurt to specify:
                    Code:
                    --logmode=1 --logpath=/var/log/fr24-1
                    and
                    --logmode=1 --logpath=/var/log/fr24-2
                    after creating both directories:
                    sudo mkdir /var/log/fr24-1
                    sudo mkdir /var/log/fr24-2
                    sudo chown fr24 /var/log/fr24-1
                    sudo chown fr24 /var/log/fr24-2
                    That way you can check the logs in both directories to make sure both instances are running correctly.

                    Comment


                    • #11
                      UPDATED POST #7
                      Log file functionally added by modifying service files

                      Added code in red
                      Code:
                      ExecStartPre=/bin/mkdir -p /var/log/fr24-1
                      ExecStartPre=/bin/chown fr24 /var/log/fr24-1
                      ExecStart=/usr/bin/fr24feed --fr24key=xxxxxxxxxxxxxxxx --receiver=beast-tcp --host=127.0.0.1:30005 --logmode=1 --logpath=/var/log/fr24-1/
                      Last edited by abcd567; 2019-04-16, 18:41.

                      Comment


                      • #12
                        That might fail because mkdir reports an error.
                        You can use a minus sign before the command to ignore the return code of the command.

                        Or you can use the -p option for mkdir so it doesn't report an error if the directory already exists.

                        Otherwise the whole service might show an error.
                        (On first run it will work as the directory doesn't exist yet)

                        Also it's not necessary to run these commands on every start because the directories will remain with their permissions.
                        (In case of dump1090-mutability using touch and chown that's different because the file needs to be overwritten on each start. In the directories though as soon as they are owned by fr24, the program can do whatever it wants inside of these directories)

                        Comment


                        • #13
                          Originally posted by wiedehopf View Post
                          Or you can use the -p option for mkdir so it doesn't report an error if the directory already exists.
                          Thanks for the tip.
                          Added -p with mkdir command

                          Comment


                          • #14
                            Originally posted by wiedehopf View Post
                            Do you just delete the /etc/fr24feed.ini when you give the parameters on the command line?

                            Or do the command line parameters take precedence anyway?
                            The binary does not create the fr24feed.ini, but searches for it if vital parameters (fr24key, receiver, host & port) are not added to start command as arguments, and if does not find the vital parameters, finally fails

                            For single instance use, I create the file fr24feed.ini manually by touch command, then do chmod a+rw on it.

                            If installation is done by .deb package, the .deb package creates the fr24feed.ini
                            Last edited by abcd567; 2019-04-16, 19:39.

                            Comment


                            • #15
                              OK, if you dont want to edit the service file every time you want to change parameters, then create a .ini file, and add some code in service file to get data from the .ini file

                              STEP-1:
                              Prepare fr24feed-1.ini and fr24feed-2.ini files

                              1.1 - Feeder-1

                              Code:
                              sudo touch /etc/fr24feed-1.ini
                              sudo chmod a+rw /etc/fr24feed-1.ini
                              sudo nano /etc/fr24feed-1.ini
                              Copy-paste following code, then save file (Ctrl+o) and (Ctrl+x)

                              Code:
                              RECEIVER="--receiver=beast-tcp"
                              KEY="--fr24key=xxxxxxxxxxxxxxxx"
                              HOST="--host=127.0.0.1:30005"
                              OUTPUT="--bs=no --raw=no"
                              LOG="--logmode=1 --logpath=/var/log/fr24-1"
                              MLAT="--mlat=yes --mlat-without-gps=yes"
                              CONNECTION="--use-http=yes  --http-timeout=20"

                              1.2 - Feeder-2

                              Code:
                              sudo touch /etc/fr24feed-2.ini
                              sudo chmod a+rw /etc/fr24feed-2.ini
                              sudo nano /etc/fr24feed-2.ini
                              Copy-paste following code

                              Code:
                              RECEIVER="--receiver=beast-tcp"
                              KEY="--fr24key=yyyyyyyyyyyyyyyy"
                              HOST="--host=127.0.0.1:31005"
                              OUTPUT="--bs=no --raw=no"
                              LOG="--logmode=1 --logpath=/var/log/fr24-2"
                              MLAT="--mlat=yes --mlat-without-gps=yes"
                              CONNECTION="--use-http=yes  --http-timeout=20"
                              Save file (Ctrl+o) and (Ctrl+x)






                              STEP-2:
                              Change fr24feed-1.service and fr24feed-2.service files to become like this. (changes shown in red)

                              1.1 Feeder-1
                              Code:
                              sudo nano /lib/systemd/system/fr24feed-1.service
                              Code:
                              [Unit]
                              Description=Flightradar24 Feeder
                              After=network-online.target
                              
                              [Service]
                              Type=simple
                              Restart=always
                              LimitCORE=infinity
                              EnvironmentFile=/etc/fr24feed-1.ini
                              RuntimeDirectory=fr24feed
                              RuntimeDirectoryMode=0755
                              ExecStartPre=/bin/mkdir -p /var/log/fr24-1
                              ExecStartPre=/bin/chown fr24 /var/log/fr24-1
                              ExecStart=/usr/bin/fr24feed  $RECEIVER $KEY $HOST $OUTPUT $LOG $MLAT $CONNECTION
                              User=fr24
                              PermissionsStartOnly=true
                              StandardOutput=null
                              
                              [Install]
                              WantedBy=multi-user.target
                              Save file (Ctrl+o) then (Ctrl+x)


                              1.2 Feeder-2
                              Code:
                              sudo nano /lib/systemd/system/fr24feed-2.service
                              Code:
                              [Unit]
                              Description=Flightradar24 Feeder
                              After=network-online.target
                              
                              [Service]
                              Type=simple
                              Restart=always
                              LimitCORE=infinity
                              EnvironmentFile=/etc/fr24feed-2.ini
                              RuntimeDirectory=fr24feed
                              RuntimeDirectoryMode=0755
                              ExecStartPre=/bin/mkdir -p /var/log/fr24-2
                              ExecStartPre=/bin/chown fr24 /var/log/fr24-2
                              ExecStart=/usr/bin/fr24feed  $RECEIVER $KEY $HOST $OUTPUT $LOG $MLAT $CONNECTION
                              User=fr24
                              PermissionsStartOnly=true
                              StandardOutput=null
                              
                              [Install]
                              WantedBy=multi-user.target
                              Save file (Ctrl+o) then (Ctrl+x)

                              STEP-3:
                              Implement the changes made in .service files

                              Code:
                              sudo systemctl daemon-reload 
                              sudo systemctl restart fr24feed-1
                              sudo systemctl restart fr24feed-1
                              Last edited by abcd567; 2019-04-19, 05:54.

                              Comment

                              Working...
                              X