Announcement

Collapse
No announcement yet.

How to set up a feeder using 64-bit Ubuntu Linux on Intel platform

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

  • How to set up a feeder using 64-bit Ubuntu Linux on Intel platform

    Update: Configuration for dump1090 status page added. Comments added.
    Update: Changed a few instructions for Debian users.
    Update: Moved from dump1090-mutability to dump1090-fa.

    My Story:
    As for many others, my interest in tracking flights started out as a "what is it, flying over my head?". After a couple of years subscribing to the Flightradar24 service, I came across the "Build your own ADS-B receiver" article and decided to order a dongle and antenna.

    Being a system operator in a midsize company for many years, I have seen too many problems running long term services on the Raspberry Pi due to malfunctioning SD cards caused by the limited number of write operations allowed on this type of storage. The only right solution for me, was to run the feeder on a virtual Linux on my home VMware server. But soon the struggles began to show, as no-one seems to run ADS-B receivers on anything but ARM platforms. So - For anyone out there wanting to run fr24feed on a 64-bit Intel-based Linux, I have made the compact how-to guide below. It is not meant to be a detailed step-by-step guide with a lot of explanations, but as a quick-guide for the experienced Linux operator needing a hint or two.


    My Hardware:
    Receiver RTL-SDR R820T2 TCXO Dongle
    Antenna A3 ADS-B Antenna (1090 MHz)
    Computer Intel® NUC Kit NUC6i7KYK (Skull Canyon)
    Hypervisor VMware ESXi 6.7
    OS Ubuntu 18.04.2 LTS Server

    How I did it:

    == Preparing a mint Ubuntu Server (18.04 LTS) ==

    Install packages needed
    sudo apt install build-essential git rtl-sdr librtlsdr-dev libbladerf-dev libncurses5-dev libncursesw5-dev pkg-config nginx

    Download software from Flightradar24 and GitHub
    wget https://repo-feed.flightradar24.com/rpi_images/fr24-raspberry-pi-latest.img.gz
    wget https://repo-feed.flightradar24.com/linux_x86_64_binaries/fr24feed_1.0.18-5_amd64.tgz
    git clone https://github.com/flightaware/dump1090

    Unpack the software we have downloaded
    gunzip --keep fr24-raspberry-pi-latest.img.gz
    tar xzf fr24feed_1.0.18-5_amd64.tgz

    Compile dump1090
    cd dump1090
    make
    cd ..


    == Configuring the feeder ==

    Switch to super user mode
    sudo su

    Create the users and groups we need for running the software (Change GIDs and UIDs as needed)
    groupadd -g 1992 fr24
    useradd -g fr24 -u 1992 fr24 -d /home/fr24 -m -s /bin/bash

    groupadd -g 1993 dump1090
    useradd -g dump1090 -u 1993 dump1090 -d /home/dump1090 -m -s /bin/bash

    Create a mount point for the Raspberry Pi image
    mkdir ./fr24

    List the contents of the Raspberry Pi image
    fdisk --list fr24-raspberry-pi-latest.img
    Code:
        Disk fr24-raspberry-pi-latest.img: 1.8 GiB, 1866465280 bytes, 3645440 sectors
        Units: sectors of 1 * 512 = [COLOR="#FF0000"][B]512[/B][/COLOR] bytes
        Sector size (logical/physical): 512 bytes / 512 bytes
        I/O size (minimum/optimal): 512 bytes / 512 bytes
        Disklabel type: dos
        Disk identifier: 0xee25660b
    
        Device                        Boot Start     End Sectors  Size Id Type
        fr24-raspberry-pi-latest.img1       8192   97889   89698 43.8M  c W95 FAT32 (LBA)
        fr24-raspberry-pi-latest.img2      [COLOR="#FF0000"][B]98304[/B][/COLOR] 3645439 3547136  1.7G 83 Linux
    Mount the Raspberry Pi image using starting point of img2 multiplied with unit size for offset
    mount --options loop,offset=50331648 fr24-raspberry-pi-latest.img ./fr24

    Copy stuff from the Raspberry Pi image
    cp ./fr24/etc/fr24feed.ini /etc/fr24feed.ini
    cp ./fr24/etc/default/dump1090-mutability /etc/default/dump1090-mutability
    cp ./fr24/etc/logrotate.d/dump1090-mutability /etc/logrotate.d/dump1090-mutability
    cp ./fr24/etc/logrotate.d/fr24feed /etc/logrotate.d/fr24feed
    cp ./fr24/etc/systemd/system/fr24feed.service /etc/systemd/system/fr24feed.service
    cp -n ./fr24/etc/udev/rules.d/rtl-sdr.rules /etc/udev/rules.d/rtl-sdr.rules
    cp ./fr24/usr/bin/fr24feed-status /usr/bin/fr24feed-status
    mkdir -p /usr/share/doc/dump1090-mutability
    cp -R ./fr24/usr/share/doc/dump1090-mutability/* /usr/share/doc/dump1090-mutability
    mkdir -p /usr/lib/fr24/public_html/coolclock
    cp -R ./fr24/usr/lib/fr24/* /usr/lib/fr24
    mkdir -p /usr/share/fr24/licences
    cp -R ./fr24/usr/share/fr24/* /usr/share/fr24

    Unmount the Raspberry Pi image
    umount ./fr24

    Copy fr24feed and dump1090
    cp ./fr24feed_amd64/fr24feed /usr/bin/fr24feed
    cp ./dump1090/dump1090 /usr/bin/dump1090-mutability
    cp ./dump1090/view1090 /usr/bin/view1090-mutability
    mkdir -p /usr/share/dump1090-mutability/html
    cp -R ./dump1090/public_html/* /usr/share/dump1090-mutability/html

    Add dump1090 config the server section of nginx default site
    vi /etc/nginx/sites-available/default

    In vi, do this:
    Position the cursor on the line before the closing bracket of the server block
    Insert these lines
    Code:
      # rewrite ^/dump1090/$ /dump1090/gmap.html permanent;
      # rewrite ^/dump1090$ /dump1090/gmap.html permanent;
    
      location /dump1090/ {
         alias /usr/share/dump1090-mutability/html/;
      }
      location /dump1090/data/ {
         alias /run/dump1090-mutability/;
      }
    Press ':wq' to save and exit vi

    Edit the fr24feed service
    vi /etc/systemd/system/fr24feed.service
    ExecStartPre=-/usr/lib/fr24/install_dump1090.sh <== Remove this line (just to be safe)

    Blacklist the default driver that is automatically loaded for using the dongle as a TV device (Important: remove leading blanks)
    cat <<EOF >>/etc/modprobe.d/blacklist-rtl.conf
    blacklist dvb_usb_rtl28xxu
    EOF

    Reboot the system
    reboot now


    == Wrapping it all up ==

    Signup for feeding (if you are not already signed up)
    sudo fr24feed --signup

    Edit the fr24feed configuration
    sudo vi /etc/fr24feed.ini
    procargs="--gain -10 --write-json /run/dump1090-mutability/ --lat YY.yyyy --lon XX.xxxx"
    logpath="/var/log/fr24feed"
    fr24key="xxxxxxxxxxxxxxxx"

    Edit the dump1090 configuration
    sudo vi /etc/default/dump1090-mutability
    LAT="YY.yyyy"
    LON="XX.xxxx"

    Enable and start the fr24feed service
    sudo systemctl enable fr24feed.service
    sudo systemctl start fr24feed.service

    Restart the nginx service
    sudo systemctl restart nginx.service


    == Checking the feeder status ==

    Check status of the feeder
    fr24feed-status

    Check status of services
    sudo systemctl status fr24feed.service
    sudo systemctl status nginx.service

    Check status from remote
    http://mylinux.mydomain.com:8754/
    http://mylinux.mydomain.com/dump1090/
    Last edited by erpomik; 2019-10-16, 10:00. Reason: Tested on Debian 10.1

  • #2
    GREAT!

    If I understand correctly, basically this is what you did:

    (1) Used two binaries obtained by:
    • tar xzf fr24feed_1.0.18-5_amd64.tgz
    • cloned source code of dump1090-mutability ver1.15~dev, and then ran command "make" to create binary.



    (2) extracted & copied over configuration, systemd, service files/folders, and Map folder "html" from Pi24 image.


    (3) You missed lighttpd

    == Preparing a mint Ubuntu Server ==
    sudo apt install build-essential rtl-sdr librtlsdr-dev pkg-config
    Last edited by abcd567; 2019-02-14, 04:10.

    Comment


    • #3
      Basically - Yes, that was exactly what I ended up doing (after many hours of research)

      Originally posted by abcd567 View Post
      (3) You missed lighttpd
      I would rather say I ignored it. Being a feeder newbie, I just wanted to build a raw feeder without all the fancy stuff.

      In the Pi24 image I can see that dump1090 is started as a separate service so you can view your tracked flights on a map, and this of course would require lighttpd or Apache httpd. For now I am satisfied with the status I can get from port 8754.

      Please feel welcome to add information about which files from the Pi24 image needs copying/configuring to make it work.

      Comment


      • #4
        I might actually try it myself, in near future

        Comment


        • #5
          @erpomik:

          The method you have used is very fundamental, and is commonly known as "built by hand".
          It is very good for learning Linux.

          However if someone wants an easy solution, then using .deb package is the way as it includes binary as well as all configuration.

          There is no .deb package available for x64 either for dump1090-mutability or FR24. However we have following available, which can be used for .deb package:

          (1) Source code of dump1090-mutability: Instead of building dump1090 binary by "make" command, build .deb package using "dpkg-buildpackage -b" command.
          (2) The package "fr24feed_1.0.18-5_i386.deb" is availsble, and can be installed on x86_x64 by adding architecture i386 (sudo dpkg --add-architecture i386)

          Few hours ago I have installed both the dump1090-mutability & fr24feed on Ubuntu 18.04 on my Intel PC on (VM on Windows).

          Ubuntu-1.png . Ubuntu-2.png



          The detailed method is given below:


          ================================================== ==
          DUMP1090-MUTABILITY ver 1.15~dev
          ================================================== ==

          Code:
          sudo apt update
          sudo apt install -y git build-essential debhelper rtl-sdr   
          sudo apt install -y librtlsdr-dev libusb-1.0-0-dev pkg-config   
          sudo apt install -y fakeroot curl cron lighttpd

          Code:
          sudo git clone https://github.com/mutability/dump1090.git dump1090-1.15   
          cd dump1090-1.15   
          sudo dpkg-buildpackage -b

          Code:
          cd ../
          sudo dpkg -i dump1090-mutability_1.15~dev_*.deb   
          
          sudo lighty-enable-mod dump1090   
          sudo /etc/init.d/lighttpd force-reload 
          
          sudo wget -O /etc/udev/rules.d/rtl-sdr.rules "https://raw.githubusercontent.com/osmocom/rtl-sdr/master/rtl-sdr.rules" 
          
          sudo reboot

          Code:
          # To configure/reconfigure 
          sudo dpkg-reconfigure dump1090-mutability
          ================================================== ==
          FR24FEED
          ================================================== ==
          Code:
          wget https://repo-feed.flightradar24.com/linux_x86_binaries/fr24feed_1.0.18-5_i386.deb
          
          uname -m
          # If command "uname -m" outputs "x86_64", then give following two commands
          sudo dpkg --add-architecture i386
          sudo apt install libc6:i386 libudev1:i386 zlib1g:i386 libusb-1.0-0:i386 libstdc++6:i386 dirmngr
          
          
          # If command "uname -m" does NOT output "x86_64", then give following command
          sudo apt install libc6 libudev1 zlib1g libusb-1.0-0 libstdc++6 dirmngr
          
          
          # After installing dependencies as above, install the downloaded fr24feed
          sudo dpkg -i fr24feed_1.0.18-5_i386.deb

          Code:
          #fr24feed configuration
          sudo nano /etc/fr24feed.ini
          
          # In the blank file, copy-paste following lines
          # Replace xxxxxxxxxxx by your actual key
          
          receiver="beast-tcp"
          host="127.0.0.1:30005"
          fr24key="xxxxxxxxxxxxxxxx"
          
          # Save file and close it
          
          sudo systemctl restart fr24feed
          CHECK
          Code:
          apt-cache policy dump1090-mutability
          dump1090-mutability:
            Installed: 1.15~dev
            Candidate: 1.15~dev
            Version table:
           *** 1.15~dev 100
                  100 /var/lib/dpkg/status

          Code:
          apt-cache policy fr24feed
          fr24feed:i386:
            Installed: 1.0.18-5
            Candidate: 1.0.18-5
            Version table:
           *** 1.0.18-5 100
                  100 /var/lib/dpkg/status
          Last edited by abcd567; 2019-02-14, 11:35.

          Comment


          • #6
            @abcd567:

            Great post, thanks!

            My personal opinion as a long term operations guy would be: Avoid installing i386 architecture on a new Ubuntu Server if possible. I know saying so might initiate a religious battle which is absolutely not my intention.

            Another thing is, that the fr24feed_1.0.18-5_i386.deb package is based on System V init scripts that most *nix distributions are moving away from.

            Maybe someone closer to FR24 than I am, could convince them to update the fr24feed binaries and also make an updated .deb 64-bit package?
            Last edited by erpomik; 2019-02-15, 19:17. Reason: double wording

            Comment


            • #7
              @erpomik

              Yes, you are right. I agree with you.

              It will be very convenient for users if FR24 developers make .deb package for x64 also.

              Comment


              • #8
                @erpomik

                Just occurred to me that the method I described (build/use .deb package) is only applicable to Debian based Operating Systems.

                The .deb package wont install on OS like Fedora, FreeBSD, and ArchLinux. On these OS, your approach to make/use linux binary, and do the configuration "by hand" (by extracting configuration from Pi24 image and copying to the target distro) seems a viable solution.

                Have you tried your method on Fedora, FreeBSD, and ArchLinux?

                Comment


                • #9
                  @abcd567

                  No, not yet. But I have recently ordered an extra RTL-SDR kit for a lab/demo environment. So I might try running it in CentOS or RHEL in a week or two.

                  Comment


                  • #10
                    @erpomik

                    These may be a good read for you:

                    I have been feeding data to FlightRadar24 for some years now, using a cheap DVB-T USB stick plugged into a Windows PC that gets used less and less. For that reason, the data feed w


                    Hi people, I thought some of you might be interested in the how-to I've drawn up, which explains how to feed using FreeBSD as an OS. Please let me know if you do! Cheers, netraam


                    .

                    Comment


                    • #11
                      Wow, nicely done.

                      If you get around to running FR24 on CentOS or RHEL, perhaps it's worth looking into packaging your solution into an .rpm file and sharing it with the community. :-)

                      Comment


                      • #12
                        Originally posted by JohnnyBravo View Post
                        If you get around to running FR24 on CentOS or RHEL, perhaps it's worth looking into packaging your solution into an .rpm file and sharing it with the community. :-)
                        I have made a guide similar to this one called "How to set up a feeder using 64-bit RedHat Linux on Intel platform". The walk through was made using RHEL 8.0 beta, but I believe it should work on CentOS and other downstream ditros as well.

                        As making .deb or .rpm packages would require thorough testing on numerous platforms, I think it will be difficult for me to find the time it requires to make them.

                        Comment


                        • #13
                          Thanks for that manuals!
                          I want to install the feed also on an existing Debian 9 Linux x64 machine.

                          That machine does not have a GUI/Desktop, so will I also have to install that DUMP1090 or would that only be for GUI?

                          I am still not sure, which manuel I should use? That one from post #1 or from post #5. Please help me, I would really like to start

                          Comment


                          • #14
                            Hello again,

                            I tried now the (easier) installation method of post #5, but I ran into errors already at the first steps under FR24FEED!
                            Can you please help me to get that installed?

                            Code:
                            Linux Server 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u1 (2019-09-20) x86_64
                            
                            The programs included with the Debian GNU/Linux system are free software;
                            the exact distribution terms for each program are described in the
                            individual files in /usr/share/doc/*/copyright.
                            
                            Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
                            permitted by applicable law.
                            Last login: Tue Oct 15 12:24:25 2019 from 192.168.1.10
                            root@Server:~# wget xxx://repo-feed.flightradar24.com/linux_x86_binaries/fr24feed_1.0.18-5_i386.deb
                            --2019-10-15 12:27:15--  xxx://repo-feed.flightradar24.com/linux_x86_binaries/fr24feed_1.0.18-5_i386.deb
                            Resolving repo-feed.flightradar24.com (repo-feed.flightradar24.com)... 104.17.44.52, 104.17.45.52, 104.17.46.52, ...
                            Connecting to repo-feed.flightradar24.com (repo-feed.flightradar24.com)|104.17.44.52|:443... connected.
                            HTTP request sent, awaiting response... 200 OK
                            Length: 478596 (467K) [application/x-debian-package]
                            Saving to: ‘fr24feed_1.0.18-5_i386.deb’
                            
                            fr24feed_1.0.18-5_i386.deb                                  100%[========================================================================================================================================>] 467.38K  --.-KB/s    in 0.04s
                            
                            2019-10-15 12:27:15 (12.5 MB/s) - ‘fr24feed_1.0.18-5_i386.deb’ saved [478596/478596]
                            
                            root@Server:~# uname -m
                            x86_64
                            root@Server:~# sudo dpkg --add-architecture i386
                            root@Server:~# sudo apt install libc6:i386 libudev1:i386 zlib1g:i386 libusb-1.0-0:i386 libstdc++6:i386 dirmngr
                            Reading package lists... Done
                            Building dependency tree
                            Reading state information... Done
                            Package libc6:i386 is not available, but is referred to by another package.
                            This may mean that the package is missing, has been obsoleted, or
                            is only available from another source
                            However the following packages replace it:
                              libdb1-compat tzdata
                            
                            Package zlib1g:i386 is not available, but is referred to by another package.
                            This may mean that the package is missing, has been obsoleted, or
                            is only available from another source
                            
                            E: Package 'libc6:i386' has no installation candidate
                            E: Unable to locate package libudev1:i386
                            E: Package 'zlib1g:i386' has no installation candidate
                            E: Unable to locate package libusb-1.0-0:i386
                            E: Couldn't find any package by glob 'libusb-1.0-0'
                            E: Couldn't find any package by regex 'libusb-1.0-0'
                            E: Unable to locate package libstdc++6:i386
                            E: Couldn't find any package by regex 'libstdc++6'
                            root@Server:~# sudo apt install libc6 libudev1 zlib1g libusb-1.0-0 libstdc++6 dirmngr
                            Reading package lists... Done
                            Building dependency tree
                            Reading state information... Done
                            libstdc++6 is already the newest version (6.3.0-18+deb9u1).
                            libc6 is already the newest version (2.24-11+deb9u4).
                            dirmngr is already the newest version (2.1.18-8~deb9u4).
                            libusb-1.0-0 is already the newest version (2:1.0.21-1).
                            libusb-1.0-0 set to manually installed.
                            libudev1 is already the newest version (232-25+deb9u12).
                            zlib1g is already the newest version (1:1.2.8.dfsg-5).
                            The following packages were automatically installed and are no longer required:
                              linux-headers-4.9.0-8-amd64 linux-headers-4.9.0-8-common linux-image-4.9.0-7-amd64 linux-image-4.9.0-8-amd64
                            Use 'sudo apt autoremove' to remove them.
                            0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
                            root@Server:~# sudo dpkg -i fr24feed_1.0.18-5_i386.deb
                            Selecting previously unselected package fr24feed:i386.
                            (Reading database ... 133238 files and directories currently installed.)
                            Preparing to unpack fr24feed_1.0.18-5_i386.deb ...
                            Unpacking fr24feed:i386 (1.0.18-5) ...
                            dpkg: dependency problems prevent configuration of fr24feed:i386:
                             fr24feed:i386 depends on libc6 (>= 2.11.3-4).
                             fr24feed:i386 depends on libstdc++6 (>= 4.4.5-8).
                             fr24feed:i386 depends on zlib1g (>= 1.2.7).
                             fr24feed:i386 depends on libusb-1.0-0 (>= 1.0.11-1).
                            
                            dpkg: error processing package fr24feed:i386 (--install):
                             dependency problems - leaving unconfigured
                            Processing triggers for systemd (232-25+deb9u12) ...
                            Errors were encountered while processing:
                             fr24feed:i386

                            Comment


                            • #15
                              Hello @mensa

                              You don't need to run any of these things on a Desktop (or GUI) Linux. All the graphics you need comes from using a browser.

                              My personal opinion, as mentioned in post #6, is to avoid installing i386 architecture on a 64-bit system. It's only cluttering up things.
                              As you said, you're on a 64-bit Debian, so I would suggest post #1 if you are familiar with compiling stuff yourselves.

                              Best of luck!
                              /Ernst

                              Comment

                              Working...
                              X