Alternate to ModeSMixer2 on Bookworm

The authour (@sergsero) of ModeSMixer2 has stopped maintaining ModeSMixer2, ModeSDeco2, AcarSDeco2 etc and has pulled down his site Xdeco.org since about two years. His last releases were for Debian 10 (Buster). These continued to work on Debian 11 Bullseye.

However when I tried to install ModeSMixer2 on Debian 12 Bookworm, it failed saying “failed to find libssl.so.1.1 and libcrypto.so.1.1”. The reason is that libssl-dev-1.1.1, which was installable in Buster and Bullseye, is no more available in Bookworm and only libssl-dev-3.0.9-1 is installable. Since @sergsero has abandoned his Xdeco project, Bookworm is sad demise of his work.

Since I was using ModeSMixer2 to mix feeds from all my receivers and push this mixed feed to variuos sites, I decided to assemble my own Mixer by combining following components:

(1) dump1090-mutability as mixing software, as well as display of mixed inputs on its map (IP/dump1090/gmap.html)

(2) First bash script to create SOCAT uni-directional pipes to pull data from various receivers to the input ports of dump1090-mutability.

(3)Second bash script to create SOCAT uni-directional pipes to push the mixed feed from dump1090-mutability output ports to various aggregator sites

(4) A third bash script to start the above two scripts.

(5) A systemd Service file to automatically run the start scrip at boot, creating SOCAT pull and push pipes. The dump1090-mutability has it’s own systemd service file and starts automatically at boot.

(1) Install dump1090-mutability

Run following commands to install dump1090-mutability:

sudo apt update  

sudo apt install dump1090-mutability   

The dump1090-mutability can be installed and run simultaneously with dump1090-fa on same RPi.

However installing dump1090-mutability on a RPi which is already running dump1090-fa causes Lighttpd to crash with an error message. As a result web browser fail to display skyaware, skyaware978, piaware-web and graphs1090. Restarting lighttpd, or rebooting does not fix this problem.

The FIX for this problem is that after installing dump1090-mutability, open following file

sudo nano /etc/lighttpd/conf-available/89-dump1090.conf  

Scroll down to bottom where you will see following line.

server.stat-cache-engine = "disable"

Comment out this line by placing # at it’s start, so line becomes

#server.stat-cache-engine = "disable"

Save file, and REBOOT Pi

sudo reboot

(2) Configure dump1090-mutability

(2.1) Open dump1090-mutability’s config file for editing:

sudo nano /etc/default/dump1090-mutability

Make following changes:

(2.1.1) Make sure the item START_DUMP1090 is yes, like this:

START_DUMP1090="yes"

(2.1.2) Configure it to run in --net-only mode by changing RECEIVER="" to:

RECEIVER="none".

(2.1.3) To avoid port conflict with dump1090-fa, change dump1090-mutability’s port numbers as follows:

Change 30001 to 40001
Change 30002 to 40002
Change 30003 to 40003
Change 30004,30104 to 40004,40104
Change 30005 to 40005

Please see screenshot below which shows the config file after above noted port number changes were done.

image

 

(2.1.4) To enable connection to other Pi’s, empty NET_BIND_ADDRESS="127.0.0.1" so that it became:

NET_BIND_ADDRESS=""

(2.1.5) For Range Rings to appear, add latitude & longitude values in LAT="" and LON="", so that it becomes:

LAT="xx.xxxx"
LON="yy.yyyy"

(3) Create Scripts

(3.1) Install package socat

sudo apt install socat    

(3.2) Create dedicated folder to hold all script files at one place

sudo mkdir /usr/share/mixer   

(3.3) Creat script pull.sh

sudo touch /usr/share/mixer/pull.sh   

sudo chmod +x /usr/share/mixer/pull.sh  

sudo nano /usr/share/mixer/pull.sh    

In the new blank file pull.sh created above, copy-paste following code

NOTE:
(1) Full file contents are not displayed by forum. Please scroll down and and scrol right to see and copy full contents.

(2) After copy-paste, replace source IPs 10.0.0.21, 10.0.0.22, 10.0.0.23, and 10.0.0.50 by your receiver’s Local IP addresses

(3) Following lines starting with:

#CMD_1_3="TCP
#CMD_2_3="TCP
#CMD_3_3="TCP
#CMD_4_3="TCP

are for feeding Adsbexchange mlat-results to the mixer, but are disabled by placing a # at their start. If you have installed Adsbexchange feeder on any of your receivers, then remove # from start of the line pertaining to that receiver, to feed it’s Adsbexchange mlat-results to the mixer.

#!/bin/bash

OPTIONS="keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15"

SOURCE1="10.0.0.21"
SOURCE2="10.0.0.22"
SOURCE3="10.0.0.23"
SOURCE4="10.0.0.50"

CMD_1_1="TCP:${SOURCE1}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_1_2="TCP:${SOURCE1}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
#CMD_1_3="TCP:${SOURCE1}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_2_1="TCP:${SOURCE2}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_2_2="TCP:${SOURCE2}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
#CMD_2_3="TCP:${SOURCE2}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"


CMD_3_1="TCP:${SOURCE3}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_3_2="TCP:${SOURCE3}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
#CMD_3_3="TCP:${SOURCE3}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_4_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_4_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
#CMD_4_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"


while true
do
echo "CONNECTING MIXER TO SOURCE:"

socat -dd -u ${CMD_1_1} | socat -dd -u ${CMD_1_2} | socat -dd -u ${CMD_1_3} | \
socat -dd -u ${CMD_2_1} | socat -dd -u ${CMD_2_2} | socat -dd -u ${CMD_2_3} | \
socat -dd -u ${CMD_3_1} | socat -dd -u ${CMD_3_2} | socat -dd -u ${CMD_3_3} | \
socat -dd -u ${CMD_4_1} | socat -dd -u ${CMD_4_2} | socat -dd -u ${CMD_4_3}
      
echo "LOST CONNECTION OF MIXER AND SOURCE:"
echo "RE-CONNECTING MIXER TO SOURCE:"

sleep 60
done

 

Save and Close file pull.sh

 

(3.4) Creat script push.sh

sudo touch /usr/share/mixer/push.sh   

sudo chmod +x /usr/share/mixer/push.sh  

sudo nano /usr/share/mixer/push.sh    

In the new blank file pull.sh created above, copy-paste following code

NOTE:
(1) Full file contents are not displayed by forum. Please scroll down and and scrol right to see and copy full contents.

(2) After copy-paste, replace target IPs and port numbers by your aggregator site’s IP addresses and port numbers.

#!/bin/bash

SOURCE_BEAST="127.0.0.1:40005"
SOURCE_MSG="127.0.0.1:40003"

TARGET_1="sky.bup.mx:xxxxx"
TARGET_2="data.adsbhub.org:xxxx"
TARGET_3="skyfeed.hpradar.com:xxxxx"
#TARGET_4=""

OPTIONS="keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15"

CMD_1="TCP:${SOURCE_BEAST},${OPTIONS} TCP:${TARGET_1},${OPTIONS}"
CMD_2="TCP:${SOURCE_MSG},${OPTIONS} TCP:${TARGET_2},${OPTIONS}"
CMD_3="TCP:${SOURCE_BEAST},${OPTIONS} TCP:${TARGET_3},${OPTIONS}"
#CMD_4="TCP:${SOURCE_BEAST},${OPTIONS} TCP:${TARGET_4},${OPTIONS}"


while true
   do
      echo "CONNECTING:"

      socat -dd -u ${CMD_1} | \
      socat -dd -u ${CMD_2} | \
      socat -dd -u ${CMD_3} | \
      socat -dd -u ${CMD_4}

      echo "LOST CONNECTION TO TARGETS:"
      echo "RE-CONNECTING TO TARGETS:"
      sleep 60
   done

 

Save and Close file push.sh

 

(3.5) Creat script start.sh

sudo touch /usr/share/mixer/start.sh   

sudo chmod +x /usr/share/mixer/start.sh  

sudo nano /usr/share/mixer/start.sh    

In the new blank file start.sh created above, copy-paste following code

#!/bin/bash

/bin/bash /usr/share/mixer/pull.sh & /bin/bash /usr/share/mixer/push.sh

 

Save and Close file push.sh

 

(4) Create Systemd Service file for Mixer to start at boot. The dump1090-mutability has it’s own Systemd service file and starts automatically at boot.

(4.1) Create blank Systemd service file by following command

sudo nano /lib/systemd/system/mixer.service   

 

(4.2) In above blank file, copy-paste following code

# adsb mixer service - by abcd567

[Unit]
Description=mixes adsb data from various sources and forwards to various targets
Wants=network.target
After=network.target

[Service]
User=mixer
RuntimeDirectory=mixer
RuntimeDirectoryMode=0755
ExecStart=/bin/bash /usr/share/mixer/start.sh
SyslogIdentifier=mixer
Type=simple
Restart=on-failure
RestartSec=30
RestartPreventExitStatus=64
#Nice=-5

[Install]
WantedBy=default.target

 

Save and Close file mixer.service

 

(4.3) Create user mixer to run the service

sudo adduser --system --no-create-home mixer  

 

(4.4) Enable mixer service by following command. After enabling, it will start automatically on boots.

sudo systemctl enable mixer.service   

(4.5) Manually start mixer by following command, or reboot to start it automatically

sudo systemctl start mixer  

(4.6) Check status

sudo systemctl status mixer   

(4.7) Check Map of mixed feed in browser

IP/dump1090/gmap.html

Click on Screenshot to See Larger Size

 

 

3 Likes

I’ve been trying to get this up and running, just the pull script and not the push script, don’t need a reporting function to the aggregator but I’m getting connection refused on port 30157
The map stays empty with a error fetching data from dump1090

The scripts are installed on a seperate Debian12 Thinclient with no dump1090-fa running.

Here are the modified scripts:

Dump1090-mutabilty config, port setting modified as by your post,

# Port to listen on for raw (AVR-format) input connections. 0 disables.
RAW_INPUT_PORT="40001"

# Port to listen on for raw (AVR-format) output connections. 0 disables.
RAW_OUTPUT_PORT="40002"

# Port to listen on for SBS-format output connections. 0 disables.
SBS_OUTPUT_PORT="40003"

# Port to listen on for Beast-format input connections. 0 disables.
BEAST_INPUT_PORT="40004,40104"

# Port to listen on for Beast-format output connections. 0 disables.
BEAST_OUTPUT_PORT="40005"

# TCP heartbeat interval in seconds. 0 disables.
NET_HEARTBEAT="60"

# Minimum output buffer size per write, in bytes.
NET_OUTPUT_SIZE="500"

# Maximum buffering time before writing, in seconds.
NET_OUTPUT_INTERVAL="1"

# TCP buffer size, in bytes
NET_BUFFER="262144"

# Bind ports on a particular address. If unset, binds to all interfaces.
# This defaults to binding to localhost. If you need to allow remote
# connections, change this.
NET_BIND_ADDRESS=""
# Allows access to the static files that provide the dump1090 map view,
# and also to the dynamically-generated json parts that contain aircraft
# data and are periodically written by the dump1090 daemon.

url.redirect += (
  "^/dump1090/$" => "/dump1090/gmap.html",
  "^/dump1090$" => "/dump1090/gmap.html"
)

alias.url += (
  "/dump1090/data/" => "/run/dump1090-mutability/",
  "/dump1090/" => "/usr/share/dump1090-mutability/html/"
)

# The stat cache must be disabled, as aircraft.json changes
# frequently and lighttpd's stat cache often ends up with the
# wrong content length.
#server.stat-cache-engine    = "disable"

pull script.sh (the socat commands contain all 14 receivers but it displays not the whole line

#!/bin/bash

OPTIONS="keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15"

SOURCE1="192.168.2.235"
SOURCE2="192.168.2.237"
SOURCE3="192.168.2.226"
SOURCE4="192.168.2.224"
SOURCE5="192.168.2.228"
SOURCE6="192.168.2.225"
SOURCE7="192.168.2.227"
SOURCE8="192.168.2.223"
SOURCE9="192.168.2.231"
SOURCE10="192.168.2.229"
SOURCE11="192.168.2.222"
SOURCe12="192.168.2.219"
SOURCE13="192.168.2.217"
SOURCE14="192.168.2.242"


CMD_1_1="TCP:${SOURCE1}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_1_2="TCP:${SOURCE1}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_1_3="TCP:${SOURCE1}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_2_1="TCP:${SOURCE2}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_2_2="TCP:${SOURCE2}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_2_3="TCP:${SOURCE2}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"


CMD_3_1="TCP:${SOURCE3}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_3_2="TCP:${SOURCE3}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_3_3="TCP:${SOURCE3}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_4_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_4_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_4_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_5_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_5_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_5_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_6_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_6_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_6_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_7_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_7_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_7_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_8_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_8_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_8_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_9_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_9_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_9_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_10_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_10_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_10_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_11_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_11_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_11_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_12_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_12_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_12_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_13_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_13_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_13_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_14_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_14_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
CMD_14_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

while true
   do
      echo "CONNECTING MIXER TO SOURCE:"
      socat -dd -u ${CMD_1_1} | socat -dd -u ${CMD_1_2} | socat -dd -u ${CMD_1_3} | socat -dd -u ${CMD_2_1} | socat -dd -u ${CMD_2_2} | socat -dd -u ${CMD_2_3} | socat -dd -u ${CMD_3_1} | socat -dd -u ${CMD_3_2} | socat -dd -u ${CMD_3_3>
      echo "LOST CONNECTION OF MIXER AND SOURCE:"
      echo "RE-CONNECTING MIXER TO SOURCE:"
      sleep 60
   done

starting script

#!/bin/bash

/bin/bash /usr/share/mixer/pull.sh

result of status command

Oct 01 10:15:53 TC620Debian12 mixer[1200]: 2023/10/01 10:15:53 socat[1200] E connect(8, AF=2 127.0.0.1:40004, 16): Connection refused
Oct 01 10:15:53 TC620Debian12 mixer[1200]: 2023/10/01 10:15:53 socat[1200] N exit(1)
Oct 01 10:15:53 TC620Debian12 mixer[1205]: 2023/10/01 10:15:53 socat[1205] E connect(7, AF=2 192.168.2.224:30157, 16): Connection refused
Oct 01 10:15:53 TC620Debian12 mixer[1205]: 2023/10/01 10:15:53 socat[1205] N exit(1)
Oct 01 10:15:53 TC620Debian12 mixer[1202]: 2023/10/01 10:15:53 socat[1202] E connect(7, AF=2 192.168.2.226:30157, 16): Connection refused
Oct 01 10:15:53 TC620Debian12 mixer[1202]: 2023/10/01 10:15:53 socat[1202] N exit(1)
Oct 01 10:15:53 TC620Debian12 mixer[1199]: 2023/10/01 10:15:53 socat[1199] E connect(7, AF=2 192.168.2.237:30157, 16): Connection refused

Any idea what might be wrong ?

@tomvdhorst

(1) Did you make following setting in dump1090-mutability config file?

RECEIVER="none"

 

(2) Port 30157 is mlat results from Adsbexchange. If you do not have adsbexchange feeder installed, you have to remove from socat these 14 items

| socat -dd -u ${CMD_1_3}
| socat -dd -u ${CMD_2_3}
| socat -dd -u ${CMD_3_3}
… …
… …
| socat -dd -u ${CMD_13_3}
| socat -dd -u ${CMD_14_3}

 

@abcd567

Receiver options

RECEIVER=“none”

This seems to be set correctly.

Removed the socat for cmd_x_3 and did the same in the commandline.
No more errors in the status, just opening connections.

Device set to none as well after this the ajax error is gone

RTLSDR device index or serial number to use

If set to “none”, dump1090 will be started in --net-only mode

DEVICE=“none”

pi@TC620Debian12:~$ sudo systemctl status mixer
● mixer.service - mixes adsb data from various sources and forwards to various targets
     Loaded: loaded (/lib/systemd/system/mixer.service; enabled; preset: enabled)
     Active: active (running) since Sun 2023-10-01 11:45:42 CEST; 3min 41s ago
   Main PID: 487 (bash)
      Tasks: 30 (limit: 8761)
     Memory: 28.5M
        CPU: 1.104s
     CGroup: /system.slice/mixer.service
             ├─487 /bin/bash /usr/share/mixer/start.sh
             ├─495 /bin/bash /usr/share/mixer/pull.sh
             ├─752 socat -dd -u TCP:192.168.2.235:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─753 socat -dd -u TCP:192.168.2.235:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─754 socat -dd -u TCP:192.168.2.237:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─755 socat -dd -u TCP:192.168.2.237:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─756 socat -dd -u TCP:192.168.2.226:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─757 socat -dd -u TCP:192.168.2.226:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─758 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─759 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─760 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─761 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─762 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─763 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─764 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─765 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─766 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─767 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─768 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─769 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─770 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─771 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─772 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─773 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─774 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─775 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─776 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─777 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             ├─778 socat -dd -u TCP:192.168.2.224:30005,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40004,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>
             └─779 socat -dd -u TCP:192.168.2.224:30105,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15 TCP:127.0.0.1:40104,keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,inte>

Oct 01 11:48:58 TC620Debian12 mixer[778]: 2023/10/01 11:48:58 socat[778] N opening connection to AF=2 192.168.2.224:30005
Oct 01 11:48:58 TC620Debian12 mixer[777]: 2023/10/01 11:48:58 socat[777] N opening connection to AF=2 127.0.0.1:40104
Oct 01 11:48:58 TC620Debian12 mixer[778]: 2023/10/01 11:48:58 socat[778] N opening connection to AF=2 127.0.0.1:40004
Oct 01 11:48:58 TC620Debian12 mixer[773]: 2023/10/01 11:48:58 socat[773] N opening connection to AF=2 192.168.2.224:30105
Oct 01 11:48:58 TC620Debian12 mixer[779]: 2023/10/01 11:48:58 socat[779] N opening connection to AF=2 127.0.0.1:40104
Oct 01 11:48:58 TC620Debian12 mixer[775]: 2023/10/01 11:48:58 socat[775] N opening connection to AF=2 127.0.0.1:40104
Oct 01 11:48:58 TC620Debian12 mixer[771]: 2023/10/01 11:48:58 socat[771] N opening connection to AF=2 127.0.0.1:40104
Oct 01 11:48:58 TC620Debian12 mixer[772]: 2023/10/01 11:48:58 socat[772] N opening connection to AF=2 127.0.0.1:40004
Oct 01 11:48:58 TC620Debian12 mixer[774]: 2023/10/01 11:48:58 socat[774] N opening connection to AF=2 127.0.0.1:40004
Oct 01 11:48:58 TC620Debian12 mixer[773]: 2023/10/01 11:48:58 socat[773] N opening connection to AF=2 127.0.0.1:40104

It als seems to connect multiple time to 192.168.2.224 number 4 on the list( and not numer 5 or higer) so I still have to figure out what happens there.

After fixing the Ajax error it starts to populate the map, just need to know how to check it is calling on all sites instead of the first 4 :wink:
Number on the map are almost equal ( less then 10 variation in numbers) to the number on skyaware anywhere so it seems to be right :slight_smile:

@tomvdhorst
Use journalctl to display full log. To avoid display of too many old logs, reboot computer, then give journalctl command with -b (since boot) parameter.

I have 4 receivers which the mixer combines. I rebooted Pi which has dump1090-mutability and mixer files. After reboot, when planes appeared on mixer map, waited for a minute, then gave following command:

sudo journalctl -u mixer -b

Here is the output. All 4 receiver are shown:

Click on Screenshot to See Larger Size

 

My file start.sh

#!/bin/bash

#/bin/bash /usr/share/mixer/pull.sh & /bin/bash /usr/share/mixer/push.sh
/bin/bash /usr/share/mixer/pull.sh

 

My file pull.sh

#!/bin/bash

OPTIONS="keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15"

SOURCE1="10.0.0.21"
SOURCE2="10.0.0.22"
SOURCE3="10.0.0.23"
SOURCE4="10.0.0.50"

CMD_1_1="TCP:${SOURCE1}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_1_2="TCP:${SOURCE1}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
#CMD_1_3="TCP:${SOURCE2}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_2_1="TCP:${SOURCE2}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_2_2="TCP:${SOURCE2}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
#CMD_2_3="TCP:${SOURCE2}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"


CMD_3_1="TCP:${SOURCE3}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_3_2="TCP:${SOURCE3}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
#CMD_3_3="TCP:${SOURCE3}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"

CMD_4_1="TCP:${SOURCE4}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS}"
CMD_4_2="TCP:${SOURCE4}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"
#CMD_4_3="TCP:${SOURCE4}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS}"


while true
   do
      echo "CONNECTING MIXER TO SOURCE:"

      socat -dd -u ${CMD_1_1} | socat -dd -u ${CMD_1_2} | \
      socat -dd -u ${CMD_2_1} | socat -dd -u ${CMD_2_2} | \
      socat -dd -u ${CMD_3_1} | socat -dd -u ${CMD_3_2} | \
      socat -dd -u ${CMD_4_1} | socat -dd -u ${CMD_4_2}

      echo "LOST CONNECTION OF MIXER AND SOURCE:"
      echo "RE-CONNECTING MIXER TO SOURCE:"
      sleep 60
   done

 

Click on Screenshot to See Larger Size

 

1 Like

Found the issue :crazy_face: | copied the command but didn’t modify the source number in the command from 4 upward so it was repeating itself due to my own stupidity.

Check the pull script in my previous posting, the error is in there :wink:
After modifying all stations are connecting and reporting.

Thanks for your help and guidance, nice to have a local combined source next to Skyaware Anywhere.

@tomvdhorst

I don’t like the very big sizes of aircraft in dump1090-mutability map. The aircraft sizes in dump1090-fa are more pleasant.

. If you are running the mixer & dump1090-mutab on a machine which do NOT have dump1090-fa installed, then instead of installing dump1090-mutab, there is a possibility to install and use dump1090-fa as mixer, after properly re-configuring it. I will give it a try on a Debian12 install on Oracle VM in Windows machine.

Yep that might be a better option, looking forward to your results. Maybe dump1090-fa is a better suited for the job, didn’t try it yet, already pleased with this result but let’s see what your test brings

(1) dump1090-fa: Installation and configuring

1.1 Installed dump1090-fa

1.2. Opened config file for editing

abcd@debian12:~$ sudo nano /etc/default/dump1090-fa

1.3. Ensured that ENABLED=yes

1.4. Changed RECEIVER=rtlsdr to RECEIVER=none

1.5. Fiiled values in RECEIVER_LAT= and RECEIVER_LON= , so these became
RECEIVER_LAT=xx..xxxx
RECEIVER_LON=yy.yyyy

1.6. Changed port numbers to start by 4 instead of starting by 3. So it became like screenshot below;

1.7. Saved and Closed config file

image

 

2. Creating Folder & Files

Created folder /usr/share/mixer, created user mixer to run the service, and created files start.sh, pull.sh, push.shand mixer.service` same way as was done for mixer with dump1090-mutability

Click on Screenshot to See Larger Size

Thanks, trying to set it up now.
Does it also need Piaware as the interface ?

Edit never mind, already figured out.

Maybe you want to point how to get to the map with Dump1090-fa installed

http://IP.adress.of.pi/pc/skyaware/

up and running with dump1090-fa :wink:

Answer for others:
No, piaware is not required.

Due to port number modifications I have done, even if you install piaware, the piaware wont be able to feed mixed data to Flightaware. Avoiding feeding mixed data to Flightaware has been recommended by @obj several times in the past.

Also with port number modifications I have done, the mixed mlat results will only be displayed on local map, and these wont be sent to other sites by the push.sh script`. This is also as per requirement of Flightaware.

1 Like

@tomvdhorst
@byraspi

In files pull.sh and push.sh, the single-line socat command becomes too long and difficult to see and edit if number of receivers are more than 3. Greater the number of receivers, longer the socat line becomes.

I have solved this problem by using \ to break it into pieces, one line per receiver, like below.

NOTE: Take care that \ is (1) the last character in every line, (2) there is no blank space after \, and (3) last socat line do NOT have | and \ at its end.

while true
   do
      echo "CONNECTING MIXER TO SOURCE:"

      socat -dd -u ${CMD_1_1} | socat -dd -u ${CMD_1_2} | \
      socat -dd -u ${CMD_2_1} | socat -dd -u ${CMD_2_2} | \
      socat -dd -u ${CMD_3_1} | socat -dd -u ${CMD_3_2} | \
      socat -dd -u ${CMD_4_1} | socat -dd -u ${CMD_4_2}

      echo "LOST CONNECTION OF MIXER AND SOURCE:"
      echo "RE-CONNECTING MIXER TO SOURCE:"
      sleep 60
   done
1 Like

Works like a charm and makes it much more readable indeed, thanks.

1 Like

@tomvdhorst

Things on my “to do” agenda:

(1) add a blank file receivers.ip

Instead of adding his receiver’s IP addresses in file pull.sh, he will add these in new file as shown below:

sudo nano /usr/share/mixer/receivers.ip


192.168.2.235
192.168.2.237
192.168.2.226
192.168.2.224
192.168.2.228
192.168.2.225
192.168.2.227
192.168.2.223
192.168.2.231
192.168.2.229
192.168.2.222
192.168.2.219
192.168.2.217
192.168.2.242

 

(2) Add another script inside pull.sh script to read these IPs and generate required number of socat -dd -u TCP..... commands

This will make it very easy for user to creare script pull.sh. Simply copy-paste the contents, and that is all. No need to create CMD_1_1=... lines, and no need to create socat -dd -u TCP lines manually. If I succeed, then all will be done by the script after reading receiver IPs from file receiver.ip :slightly_smiling_face:

2 Likes

You are on a roll there :+1:t2: If you need a tester let me know :innocent:

1 Like

I think I have done and tested it.
Need testers. Please do this:

(1) Enter folder /usr/share/mixer, and stay in it during all following steps.

cd /usr/share/mixer/

(2) Rename current file pull.sh to pull.old. This will make it ineffective, but still preserve it, so that in case you want to revert, you can rename it to pull.sh

sudo mv pull.sh pull.old

(3) Create new blank file pull.sh

sudo touch pull.sh  

sudo chmod +x pull.sh  

sudo nano pull.sh  

(4) Copy-paste following code in new blank file pull.sh:

CAUTION: Make sure no blank line is left above #!/bin/bash (i.e #!/bin/bash should be the very first line of the bash files)

#!/bin/bash

OPTIONS="keepalive,keepidle=30,keepintvl=30,keepcnt=2,connect-timeout=30,retry=2,interval=15"
CMD=""
while read -r line; do CMD="${CMD} \
  socat -dd -u TCP:${line}:30005,${OPTIONS} TCP:127.0.0.1:40004,${OPTIONS} | \
  socat -dd -u TCP:${line}:30105,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS} | \
  socat -dd -u TCP:${line}:30157,${OPTIONS} TCP:127.0.0.1:40104,${OPTIONS} | \
  ";  done < /usr/share/mixer/receivers.ip


while true
do
      echo "CONNECTING MIXER TO SOURCE:"

      eval "${CMD%|*}"

      echo "LOST CONNECTION OF MIXER AND SOURCE:"
      echo "RE-CONNECTING MIXER TO SOURCE:"
      sleep 60
done

 

Save & Close file

(5) Create a blank file receivers.ip

sudo touch receivers.ip  

sudo nano receivers.ip  

(6) Type IP addresses of your receivers in this new blank file, one address per line, like example below:
CAUTION: Do NOT leave any blank lines above the first line and between the IP lines.

EXAMPLE:

192.168.2.235
192.168.2.237
192.168.2.226
192.168.2.224
192.168.2.228
192.168.2.225
192.168.2.227
192.168.2.223
192.168.2.231
192.168.2.229
192.168.2.222
192.168.2.219
192.168.2.217
192.168.2.242

(7) Restart mixer, and check status

sudo systemctl restart mixer  

sudo systemctl status mixer  

sudo journalctl -u mixer -e

(8) Check dump1090 Map

 

1 Like

It works flawless, all stations are connecting.
No errors in the logging, map displays correctly
I’'ve removed the socat line for ADSBexchange MLAT data (not feeding to them)

Great work @abcd567 ! :ok_hand:

Also a nice enhancement, the local view is reporting more aircraft than the Skyaware Anywhere view of the combined receivers. It has been doing that since day one so there’s no relation to the script but on average I have 5-7 more aircaft visible in number in the combined local view.
Added bonus is that the combined local view is reporting distance from my home and that isn’t the case with the Skyaware Anywhere view.

2 Likes

Thanks for testing. :+1:

 

Great!
Shows that you fully understand the script.:+1:

1 Like

@tomvdhorst

One More Step:
Install and configure 2nd copy of dump1090-fa on a Pi which already has dump1090-fa running as ADS-B receiver with dongle. Install mixer as in above posts, and instead of dump1090-mutability, install 2nd copy of dump1090-fa by running the script given below… This 2nd copy with its own map is for dedicated use by mixer.

MAP:
IP-of-Pi/mixeraware/
IP-of-Pi:8585

sudo systemctl restart mixer-dump   
sudo systemctl status mixer-dump   

How-To:

(1) Create blank file install-mixer-dump.sh.

sudo touch install-mixer-dump.sh  

sudo chmod +x install-mixer-dump.sh  

sudo nano install-mixer-dump.sh  

(2) Copy-pate following code in above newly created file:

IMPORTANT: Scroll down and also to right to see and copy full code. Only upper half of code is directly visible.

#!/bin/bash

## This script copies executeable binary,files & folders pertaining to dump1090-fa
## renaming files/foldrs for dump1090-fa to mixer-dump
## and renaming files/folders for skyaware to mixeraware
## and renumbering the ports of dump1090-fa
## above is essential to avoid conflict

## sudo systemctl restart | stop | status mixerdump
## See mixer map at ip-of-pi/mixeraware/  OR ip-of-pi:8585

set -e
trap 'echo "[ERROR] Error in line $LINENO when executing: $BASH_COMMAND"' ERR

cp /usr/bin/dump1090-fa /usr/bin/mixer-dump
mkdir -p /usr/share/mixeraware
cp -R /usr/share/skyaware/html /usr/share/mixeraware/html
mkdir -p /usr/share/mixer-dump/
cp -R /usr/share/dump1090-fa/* /usr/share/mixer-dump/
cp /lib/systemd/system/dump1090-fa.service /lib/systemd/system/mixer-dump.service
sed -i 's/dump1090-fa/mixer-dump/g' /lib/systemd/system/mixer-dump.service
grep -rl 'dump1090-fa' /usr/share/mixer-dump | xargs sudo sed -i 's/dump1090-fa/mixer-dump/g'
mv /usr/share/mixer-dump/dump1090-fa.default /usr/share/mixer-dump/mixer-dump.default
mv /usr/share/mixer-dump/start-dump1090-fa /usr/share/mixer-dump/start-mixer-dump
cp /etc/default/dump1090-fa /etc/default/mixer-dump
sed -i '/RECEIVER=/c\RECEIVER=none' /etc/default/mixer-dump
sed -i '/NET_RAW_INPUT_PORTS=/c\NET_RAW_INPUT_PORTS=40001' /etc/default/mixer-dump
sed -i '/NET_RAW_OUTPUT_PORTS=/c\NET_RAW_OUTPUT_PORTS=40002' /etc/default/mixer-dump
sed -i '/NET_SBS_OUTPUT_PORTS=/c\NET_SBS_OUTPUT_PORTS=40003' /etc/default/mixer-dump
sed -i '/NET_BEAST_INPUT_PORTS=/c\NET_BEAST_INPUT_PORTS=40004,40104' /etc/default/mixer-dump
sed -i '/NET_BEAST_OUTPUT_PORTS=/c\NET_BEAST_OUTPUT_PORTS=40005' /etc/default/mixer-dump
cp /etc/lighttpd/conf-available/89-skyaware.conf /etc/lighttpd/conf-available/89-mixeraware.conf 
sed -i '/skyaware978/c\ ' /etc/lighttpd/conf-available/89-mixeraware.conf
sed -i 's/skyaware/mixeraware/g' /etc/lighttpd/conf-available/89-mixeraware.conf
sed -i 's/dump1090-fa/mixer-dump/g' /etc/lighttpd/conf-available/89-mixeraware.conf
sed -i 's/8080/8585/g' /etc/lighttpd/conf-available/89-mixeraware.conf 
ln -sf /etc/lighttpd/conf-available/89-mixeraware.conf  /etc/lighttpd/conf-enabled/89-mixeraware.conf 
service lighttpd force-reload
systemctl enable mixer-dump
systemctl start mixer-dump
systemctl restart mixer

 

(4) Run the installation file

sudo bash install-mixer-dump.sh  

(5) The script will take few minutes to do everything. Now go to your browser and see the map of MIXER at following address:

IP-of-Pi/mixeraware/
OR
IP-of-Pi:8585

That is all :slightly_smiling_face:

 

Click on Screenshot to See Larger Size

 

1 Like

I get an error running the bash script:
pi@TC620Dietpi1:/usr/share/mixer$ sudo bash install-mixer-dump.sh
cp: cannot create regular file ‘/usr/bin/mixer-dump’: Text file busy
[ERROR] Error in line 15 when executing: cp /usr/bin/dump1090-fa /usr/bin/mixer-dump

this is line 15
cp /usr/bin/dump1090-fa /usr/bin/mixer-dump

Seems a file is busy and not accessible at that copy command