FlightAware Discussions

Dump1090-fa instead of combine1090

Hi @ wiedehopf

I saw your script https://github.com/wiedehopf/combine1090 and it is excellent.

I have a very old laptop running Ubuntu, and I have installed dump1090-fa and piaware, thinking in run there like “local server” receiving 5 RPis data; this laptop don’t have an ADSB decoder.

I was thinking that maybe is possible run a “combine1090 script” version that not create a new instance, and modified the original “dump1090-fa” service. Do you have steps or another script for this situation?

Thanks a lot!

It’s just a different URL, so what’s the problem?

Otherwise i’d just advise you to understand the dump1090-fa configuration file and combine1090 conifguration file.
You can change it so it does what you want (the extra instance will still run but that doesn’t matter, it’s not doing anything).

Basically you adjust the target port and configure the main dump1090-fa net-only.

If you dont have to feed data to flightaware from Laptop, then no need for piaware, you can uninstall it. The dump1090-fa is enough to combine and serve/display data.

If you have dump1090-fa, you have an adsb decoder, as the dump1090-fa has a built-in decoder. It’s decoder can be disabled by running it in --net-only mode. In the --net-only mode it can act as combiner (mixer) of several feeds.

Basically what you want can be achieved by properly re-configuring it to change it from default decoder to mixer (combiner) of feeds from 5 RPis.

EDIT:
Most likely you will need to establish data pipes between each RPi and the Laptop (5 data pipes for 5 RPis). This can be done using socat.

I’d recommend feeding the data from the individual receivers, that way MLAT works.
Feeding the combined data will disable MLAT.

Anyway if you really want to do it, just change receiver-host to localhost and receiver-port to 29005 with piaware-config.
29005 is the port combine1090 with the default configuration offers the data.

Of course using automated script by @wiedehopf is the easiest method.

Just to try, I have manually done it on my Debian x64 in VM on Desktop as follows.

## Stopped Piaware
abcd@debian:~$ sudo systemctl stop piaware

Unplugged the Dongle from Desktop

## Changed the dump1090-fa config to --net-only

abcd@debian:~$ sudo nano /etc/default/dump1090-fa
## Added  --net-only in the line starting with NET_OPTIONS=

## Restarted dump1090-fa with new config
abcd@debian:~$ sudo systemctl restart dump1090-fa
## Installed socat
abcd@debian:~$ sudo apt install socat
## Created Data Pipe to Pi-1
abcd@debian:~$ sudo socat -u  TCP:192.168.0.21:30005 TCP:localhost:30004 &
[1] 1187

## Created Data Pipe to Pi-2
abcd@debian:~$ sudo socat -u  TCP:192.168.0.22:30005 TCP:localhost:30004 &
[2] 1189

.

RESULT

EDIT:

I forgot to create data pipe for MLAT feedback. Additional data pipes, one from each Pi, are required for MLAT. This can be done by following commands:

## To Creat MLAT Data Pipe to Pi-1
sudo socat -u  TCP:192.168.0.21:30105 TCP:localhost:30104 &

## To Creat MLAT Data Pipe to Pi-2
sudo socat -u  TCP:192.168.0.22:30105 TCP:localhost:30104 &

Excellent…It works…

Do you have any script for load that at laptop start, and for working when one o more links down?

No I dont have any script in hand to do it, but it can be done by:

  • adding @boot entries in cron
    or
  • creating startup files, and adding their entries in file /etc/rc.local
    or
  • by creating & enabling service files which will do startup at boot through systemd.

P.S.
Why dont you use @wiedehopf’s “combine”? This is the easiest method.

Thanks for your help!

I tried with @wiedehopf script but doesn’t works for me, because i am trying get merged map data with 8080 port for upload this map to internet.

Using systemd service (this is untested)
You have to create 2 services for each Pi, one for adsb and other for mlat, as shown below. This means for 5 Pis, it will be a total of 5 x 2 = 10 services :slightly_frowning_face:

(1) ADSB pipe to Pi1

1. Create a file
sudo nano /lib/systemd/system/pi1-adsb.service

2. Copy-paste this code:

#pi1-adsb service for systemd

[Unit]
Description=pi1-adsb
Wants=network.target
After=network.target

[Service]
RuntimeDirectory=pi1-adsb
RuntimeDirectoryMode=0755
ExecStart=/usr/bin/socat -u TCP:192.168.0.21:30005 TCP:localhost:30004  
SyslogIdentifier=pi1-adsb
Type=simple
Restart=on-failure
RestartSec=30
RestartPreventExitStatus=64
Nice=-5

[Install]
WantedBy=default.target

3. Enable service

sudo systemctl enable pi1-adsb
sudo systemctl start pi1-adsb

.
.

(2) MLAT pipe to Pi1

1. Create a file
sudo nano /lib/systemd/system/pi1-mlat.service

2. Copy-paste this code:

#pi1-mlat service for systemd

[Unit]
Description=pi1-mlat
Wants=network.target
After=network.target

[Service]
RuntimeDirectory=pi1-mlat
RuntimeDirectoryMode=0755
ExecStart=/usr/bin/socat -u TCP:192.168.0.21:30105 TCP:localhost:30104 
SyslogIdentifier=pi1-mlat
Type=simple
Restart=on-failure
RestartSec=30
RestartPreventExitStatus=64
Nice=-5

[Install]
WantedBy=default.target

NOTE:

(1) In above service file it is assumed socat is installed in /usr/bin folder. Some installs socat may be in a different folder. Determine it’s location by following command:

whereis socat

(2) First create above two pipes and test if it works. These are both for Pi1 (adsb & mlat).

(3) If it works ok, then you have to repeat this for each Pi, changing pi1-adsb and pi1-mlat to piX-adsb and piX-mlat, where X is the pi number 2, 3, 4, or 5. Also change IP address in the service file according to IP address of each Pi.

I am away from my Desktop, so cannot test this. Good luck :slight_smile:

If it does not work, remove using following

sudo systemctl stop pi1-adsb
sudo systemctl disable pi1-adsb

sudo systemctl stop pi1-mlat
sudo systemctl disable pi1-mlat
1 Like

@idoleo200
There was & at the end of following line in pi1-adsb.service and pi1-mlat.service files which caused failure

.

pi1-adsb.service

ExecStart=/usr/bin/socat -u TCP:192.168.0.21:30005 TCP:localhost:30004 &

pi1-mlat.service

ExecStart=/usr/bin/socat -u TCP:192.168.0.21:30105 TCP:localhost:30104 &

Removed & from the end of line, and it started working OK.
I have now updated my last post by removing &

abcd@debian:~$ sudo systemctl status pi1-adsb
● pi1-adsb.service - pi1-adsb
   Loaded: loaded (/lib/systemd/system/pi1-adsb.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-09-08 01:03:43 EDT; 3s ago
 Main PID: 1304 (socat)
    Tasks: 1 (limit: 2348)
   Memory: 640.0K
   CGroup: /system.slice/pi1-adsb.service
           └─1304 /usr/bin/socat -u TCP:192.168.0.21:30005 TCP:localhost:30004

Sep 08 01:03:43 debian systemd[1]: Started pi1-adsb.

.
.

abcd@debian:~$ sudo systemctl status pi1-mlat
● pi1-mlat.service - pi1-mlat
   Loaded: loaded (/lib/systemd/system/pi1-mlat.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-09-08 01:13:01 EDT; 13s ago
 Main PID: 1333 (socat)
    Tasks: 1 (limit: 2348)
   Memory: 636.0K
   CGroup: /system.slice/pi1-mlat.service
           └─1333 /usr/bin/socat -u TCP:192.168.0.21:30105 TCP:localhost:30104

Sep 08 01:13:01 debian systemd[1]: Started pi1-mlat.

You may want to look at systemd’s template file support (documented in man systemd.unit). Essentially this lets you write a single service file, say mlat@.service, and then run instances named mlat@pi1, mlat@pi2 etc. The part of the service name after the @ is available for substitution as %i in the service file. You may need to run a helper script that reads config for the instance then runs the appropriate command if you need more than the simple substitution of %i

1 Like

So you reconfigure combine1090 …
As you already have your main dump1090-fa in net-only mode, you only need to change the TARGET in /etc/default/combine1090
Should currently read:

TARGET=127.0.0.1:29004

Change it to

TARGET=127.0.0.1:30004

Then the redirect will be to the main dump1090-fa.
That’s what i already wrote before.

Much easier than recreating the whole thing with individual services for every socat.

@obj

Thanks Oliver for the very useful tip. Will try this shortly.

I tried days ago with this setup and It doesn’t works… however today i delete default data associated with “SOURCES” and “PORTS” (they are now without data), and all works fine!

Thanks a lot!

Where did you put your source then? The CUSTOM line?

Maybe you just fortot to restart combine1090 via systemctl?
Because without any sources combine1090 can’t possibly work.

Yes you can (for show in /dump1090 that was my original request)

File

Now I’m working in show traffic on ground (each individual RPi shows that traffic, but in merged instance doesn’t show).

Thanks!

Well you have your source data coming from CUSTOM.
If you have your stuff there, no entries in SOURCES are needed.
The default entries in sources and ports are just examples.

Normally you would put for example 3 IPS in SOURCES, and have the default ports 30005 for ADS-B and 30105 for MLAT in PORTS.

I thought it was clear that you don’t need an IP in SOURCES if you already get the data via CUSTOM.
Maybe that needs a better comment.

1 Like

Thanks for your help!

Do you know why happened this?

Traffic on ground in a feeder
1

For merged map doesn’t shows traffic on ground (using last feeder)
2

And with another traffic:

Feeder (shows on ground traffic)

Merged map (doesn’t shows on ground traffic)

Probably just takes a moment to receive a position. Wait a bit?

Does it show a distance for those flights? If not, it doesn’t have a position yet.

.
Thanks a lot Oliver.
Following your guide line, done using single service file connect@.service

.

STEP-1

abcd@debian:~$ sudo nano /lib/systemd/system/connect@.service

.
Copy-pasted following code

#data pipe service for systemd

[Unit]
Description=%i
Wants=network.target
After=network.target

[Service]
RuntimeDirectory=%i
RuntimeDirectoryMode=0755
ExecStart=/usr/share/connect/tunnel.sh %i
SyslogIdentifier=%i
Type=simple
Restart=on-failure
RestartSec=30
RestartPreventExitStatus=64
Nice=-5

[Install]
WantedBy=default.target

.

STEP-2

sudo mkdir /usr/share/connect
sudo nano /usr/share/connect/tunnel.sh

.

Copy-pasted following code

#!/bin/bash
if [[ $1 == "pi1-adsb" ]]; then /usr/bin/socat -u TCP:192.168.0.21:30005 TCP:localhost:30004
elif [[ $1 == "pi1-mlat" ]]; then /usr/bin/socat -u TCP:192.168.0.21:30105 TCP:localhost:30004
elif [[ $1 == "pi2-adsb" ]]; then /usr/bin/socat -u TCP:192.168.0.22:30005 TCP:localhost:30004
elif [[ $1 == "pi2-mlat" ]]; then /usr/bin/socat -u TCP:192.168.0.22:30105 TCP:localhost:30004
elif [[ $1 == "pi3-adsb" ]]; then /usr/bin/socat -u TCP:192.168.0.23:30005 TCP:localhost:30004
elif [[ $1 == "pi3-mlat" ]]; then /usr/bin/socat -u TCP:192.168.0.23:30105 TCP:localhost:30004
else echo "this pipe is not listed"
fi

.

STEP3

abcd@debian:~$ sudo systemctl enable connect@pi1-adsb.service 
abcd@debian:~$ sudo systemctl start connect@pi1-adsb.service 

abcd@debian:~$ sudo systemctl enable connect@pi1-mlat.service 
abcd@debian:~$ sudo systemctl start connect@pi1-mlat.service

abcd@debian:~$ sudo systemctl enable connect@pi2-adsb.service 
abcd@debian:~$ sudo systemctl start connect@pi2-adsb.service 

abcd@debian:~$ sudo systemctl enable connect@pi2-mlat.service 
abcd@debian:~$ sudo systemctl start connect@pi2-mlat.service 

abcd@debian:~$ sudo systemctl enable connect@pi3-adsb.service 
abcd@debian:~$ sudo systemctl start connect@pi3-adsb.service 

abcd@debian:~$ sudo systemctl enable connect@pi3-mlat.service 
abcd@debian:~$ sudo systemctl start connect@pi3-mlat.service 

.

STEP-4

abcd@debian:~$ sudo systemctl status connect@pi1-adsb.service

● connect@pi1-adsb.service - pi1-adsb
   Loaded: loaded (/lib/systemd/system/connect@.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-09-08 17:05:35 EDT; 19min ago
 Main PID: 1395 (tunnel.sh)
    Tasks: 2 (limit: 2348)
   Memory: 992.0K
   CGroup: /system.slice/system-connect.slice/connect@pi1-adsb.service
           ├─1395 /bin/bash /usr/share/connect/tunnel.sh pi1-adsb
           └─1396 /usr/bin/socat -u TCP:192.168.0.21:30005 TCP:localhost:30004

Sep 08 17:05:35 debian systemd[1]: Started pi1-adsb.
Sep 08 17:05:35 debian pi1-adsb[1395]: pi1-adsb

.

abcd@debian:~$ sudo systemctl status connect@pi1-mlat.service

● connect@pi1-mlat.service - pi1-mlat
   Loaded: loaded (/lib/systemd/system/connect@.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-09-08 17:05:59 EDT; 19min ago
 Main PID: 1410 (tunnel.sh)
    Tasks: 2 (limit: 2348)
   Memory: 1008.0K
   CGroup: /system.slice/system-connect.slice/connect@pi1-mlat.service
           ├─1410 /bin/bash /usr/share/connect/tunnel.sh pi1-mlat
           └─1411 /usr/bin/socat -u TCP:192.168.0.21:30105 TCP:localhost:30004

Sep 08 17:05:59 debian systemd[1]: Started pi1-mlat.
Sep 08 17:05:59 debian pi1-mlat[1410]: pi1-mlat

.

abcd@debian:~$ sudo systemctl status connect@pi2-adsb.service

● connect@pi3-adsb.service - pi2-adsb
   Loaded: loaded (/lib/systemd/system/connect@.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-09-08 17:05:48 EDT; 21min ago
 Main PID: 1405 (tunnel.sh)
    Tasks: 2 (limit: 2348)
   Memory: 1000.0K
   CGroup: /system.slice/system-connect.slice/connect@pi2-adsb.service
           ├─1405 /bin/bash /usr/share/connect/tunnel.sh pi2-adsb
           └─1406 /usr/bin/socat -u TCP:192.168.0.22:30005 TCP:localhost:30004

Sep 08 17:05:48 debian systemd[1]: Started pi2-adsb.
Sep 08 17:05:48 debian pi2-adsb[1405]: pi2-adsb

.

abcd@debian:~$ sudo systemctl status connect@pi2-mlat.service

● connect@pi3-mlat.service - pi2-mlat
   Loaded: loaded (/lib/systemd/system/connect@.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2019-09-08 17:06:10 EDT; 23min ago
 Main PID: 1420 (tunnel.sh)
    Tasks: 2 (limit: 2348)
   Memory: 1004.0K
   CGroup: /system.slice/system-connect.slice/connect@pi2-mlat.service
           ├─1420 /bin/bash /usr/share/connect/tunnel.sh pi2-mlat
           └─1421 /usr/bin/socat -u TCP:192.168.0.22:30105 TCP:localhost:30004

Sep 08 17:06:10 debian systemd[1]: Started pi2-mlat.
Sep 08 17:06:10 debian pi2-mlat[1420]: pi2-mlat

.
.

1 Like