FlightAware Discussions

Tips on installing dump1090-fa on Opensuse

This is an installation to use dump1090-fa and tar1090 on a notebook for a self contained adsb decoder, that is not running on a SBC like a R Pi. Basically for portable operation.

I’m not going to do step by step instructions. My assumption is this is for a person familiar with Opensuse and perhaps Redhat. That is Linux OS where the debian-esque scripts provided won’t work.

rtlsdr is in the Opensuse repository. It is also easy enough to pull from github and build.
https://osmocom.org/projects/rtl-sdr/wiki
I used the cmake build technique. Use this option:
cmake …/ -DDETACH_KERNEL_DRIVER=ON
I built it in /usr/local/src .

I used this as a test:
rtl_fm -M wbfm -f 88.5M | play -r 32k -t raw -e s -b 16 -c 1 -V1 -
You may have to unplug and replug the usb dongle. Or maybe boot.

For dump1090-fa, I needed nucurses-devel. (pull with yast)
git clone https://github.com/adsbxchange/dump1090-fa.git
Again do this in /usr/local/src . Don’t use any of the installation scripts. You just need make or make BLADERF=no . You can test the binary doing
./dump1090

It should start dumping data to the screen. If it doesn’t start, you may need unplug then plug the dongle or reboot. I had a buffer usb overload. That could be a freak. You can increase the size of the buffer at
/sys/module/usbcore/parameters/usbfs_memory_mb
The default was 16. I upped it to 128. Probably overkill. I have no idea when this file is read so reboot.

There is no make install. Just copy dump1090-fa to /usr/local/bin . I also put view1090 there.

Nginx on opensuse uses /src/www/htdocs for the webserver files. The nginx.conf is located in /etc/nginx

Get tar1090 at
git clone https://github.com/wiedehopf/tar1090.git
and put it in usr/local/src. As far as opensuse is concerned, all you need are the html documents. I set up the PC to run a few different local websites. I placed the tar1090 html files at
/srv/www/htdocs/public_html/tar1090/
Copy the directory in whatever manner you like, i.e. Dolphin cut and paste or a cp command. The cp command will need a -r so that the subdirectories are copied. Dolphin is far less confusing.

Dump1090-fa is designed to write to a tmpfs. Create /run/dump1090/data . I had to chmod 777 this directory to make the system work. You should never 777 anything. There is some nuance to set up with dump1090-fa running on a user terminal while /run/dump1090/data is owned by root. I will mentally abuse myself some day and solve this.

Now the html for tar1090 expects a directory called data. I did a symbolic link to place this directory.

ln -s /run/dump1090/data /srv/www/htdocs/public_html/tar1090/data

The nice thing about this scheme is you can create a number of html directories and place this data file in them all. I added a few lines to the default nginx.conf leaving in all the commented lines. For clarity, I deleted the commented lines in the text below.

Blockquote
server_name localhost;

    #charset koi8-r;

    access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /srv/www/htdocs/public_html/piaware;
        index  index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /srv/www/htdocs/;
    }

}

    server {
    listen       8081;
    server_name  localhost;

    #charset koi8-r;

    access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /srv/www/htdocs/public_html/tar1090;
        index  index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /srv/www/htdocs/;
    }

}


include vhosts.d/*.conf;

}

Blockquote


To run everything, open a terminal and run dump1090
dump1090 --no-fix --write-json /run/dump1090/data

No networking is needed since tar1090 reads the data file.

Start nginx.
systemctl start nginx

In your browser, go to 127.0.0.1:8081

I also copied the piaware html files for yucks. You will need to place them in the www area in a similar manner to how tar1090 files were placed. Basically create /srv/www/htdocs/public_html/piaware . The data file needs to be linked.

ln -s /run/dump1090/data /srv/www/htdocs/public_html/piaware/data

This is run in 127.0.0.1:8080

1 Like

Without the bash script running, you don’t get the extended history tar1090 was meant to provide when first hacked together :wink:

The page also loads quicker using this history in gzipped chunks compared to the historyXXX.json files from dump1090-fa.

If you don’t care too much about that, what you did will indeed work.
As far as using symbolic links for the /data folders, you can just define a location in the nginx config file.
Have a look at the provided nginx file if you want to know how to do it.
But if the symlinks works for you … who am i to argue :slight_smile:

You could just chown /run/dump1090-fa so it’s owned by the user you are running dump1090-fa as.
That is normally all accomplished by the systemd service providing the /run directory.
It sets up a run directory for the correct user, then starts the binary.

I will go back and look for a bash script to run. The scripting I noticed just transferred files, but there is a lot to examine. I understand how this is set up for turnkey R Pi use so there isn’t much info on how it works since the idea is to not think too much!

I don’t believe nginx likes to go outside the web root for security purposes, hence the symbolic link. I get the occasional dotdotpwn hack on my “real” webserver and they are snagged by nginx. On a real webserver, all the files are owned by the user nginx (no login). If you do it correctly, only files owned by nginx can be read by the outside world. As you probably know, file permissions are a classic security error.

Well that should have worked. That is what I tried. However there is always pilot error. For something internet facing, I would never 777 anything. For a desktop or notebook, well…

What I should do is set things up so systemd can start dump1090 and get around the ownership issue.

As long as it can read the folder, nginx will do whatever you tell it to.
Otherwise it couldn’t follow the symlink either.

Actually you normally don’t even want it following symlinks and rather tell it which directories to serve directly.

Not really, it packs them up as chunks and removes unnecessary information.
That improves load time.
But if you are on localhost … load time is probalby not your concern.
Longer and finer grained tracks is something you might want though.

Well, it works on any debian or ubuntu system.
Which is the majority of linux systems around.

Apart from using apt to install packages, the rest of the scripting would probably work as long as you have systemd.
So you could remove that part from the install script and then run it.

Granted the install script has become rather big and hard to read.

I see you are using a subfolder for /run/dump1090?
Why not just use /run/dump1090-fa as the systemd service does?
In case you create those two folders as root, you might need to chown them both i think.

In any case good luck with your endeavors :wink:

I think the easiest thing to tweak my notebook setup is simply to do an installation on a R Pi and observe how it works. I have one laying around.

To be clear here, is all I need to do to use nginx on the R Pi is to have nginx installed before installing dump1090-f and tar1090?

I’m not sure how that would help you.
Well i suppose it could.

The nginx integration isn’t automatic, the install script just copies nginx.conf to a new path and modifies it.
It then prints a line you can add to the nginx config that will include that config file.

Really, as long as all the required software is installed, the tar1090 install script should work on opensuse as well.
So you’ll need systemd.
Then you’ll need these commands to work:

git
jq
7za

last one is 7zip, not sure what the opensuse package for that is called.
With those commands being there, the install script should work on opensuse i think.

Anyhow, you can just modify the nginx.conf yourself and then include it in the correct configuration file, normally this one:
/etc/nginx/sites-enabled/default

include /usr/local/share/tar1090/nginx-tar1090.conf;

This is what the install script normally shows.

# nginx configuration for tar1090
location /tar1090/data/ {
  alias /run/readsb/;
  location ~ aircraft\.json$ {
    add_header Cache-Control "public, max-age=0";
  }
  location /tar1090/data/traces/ {
    location ~ trace_recent {
      gzip off;
      add_header Cache-Control "public, max-age=10";
      add_header Content-Encoding "gzip";
    }
    location ~ trace_full {
      gzip off;
      add_header Cache-Control "public, max-age=60";
      add_header Content-Encoding "gzip";
    }
  }
  location ~ globe_.*\.json$ {
    gzip off;
    add_header Cache-Control "public, max-age=0";
    add_header Content-Encoding "gzip";
  }
}

location /tar1090/globe_history/ {
  alias /var/globe_history/;
  gzip off;
  add_header Cache-Control "public, max-age=600";
  add_header Content-Encoding "gzip";
}

location /tar1090/chunks/ {
  alias /run/tar1090/;
  location ~ chunk_.*\.gz$ {
    add_header Cache-Control "public, max-age=1209600";
    add_header Content-Type "application/json";
    add_header Content-Encoding "gzip";
  }
  location ~ current_.*\.gz$ {
    add_header Cache-Control "must-revalidate";
    add_header Content-Type "application/json";
    add_header Content-Encoding "gzip";
  }
  location ~ .*\.json$ {
    add_header Cache-Control "public, max-age=0";
  }
}

location /tar1090 {
  alias /usr/local/share/tar1090/html/;
  try_files $uri $uri/ =404;
}

Now you normally don’t need quite all of that …

I just want to make the point here that my goal was to set up dump1090-fa and tar1090 similar to how I ran dump1090-mutability on my previous notebook. That is I wanted something I could use mobile without internet access. To feed FA, just use a R Pi and be done with it. My solution doesn’t even use networking since tar1090 just reads a directory.

I have done some sitting under the flightline near military bases to link hex codes with tail numbers often in areas with poor internet access.

1 Like