In past posts, I’ve explained ways that you can run more than one virtual radar application at the same time. It was an ugly, complicated process. Now, with ModeSMixer2, it’s much simpler.

Some things you need to know before you start:

  • If you want all of your ADS-B applications running on the same PC, then the only IP address you need to worry about is 127.0.0.1. (This is known as loopback address, so it tells your PC to connect to itself.) If you’re running apps on different PCs across your network, then you’ll need to know the IP addresses of all of the involved machines, and in the instructions below substitute those IP addresses for 127.0.0.1 where appropriate.
  • Computer networks are comprised of a number of ports. Applications access these ports basically in one of two ways: they either listen for data, or they serve data. Think of it like a radio station: only one transmitter can broadcast on any given frequency, but any number of people can listen in.

Men usually do not open up about their sexual health they must keep some male enhancing medicines like Kamagra without prescription viagra in spite of having those humiliating moments in the bed. But when it comes to the medicines that these Kamagra suppliers have in stock, they not only have these ingredients that cure the disorders the right way, viagra uk selling here but also act as sex drive boosters. Erectile dysfunction is the failure to achieve erection, mood changes, night sweats, constant fatigue or sildenafil cheapest tiredness, and also irritability and depression. When a patient is no longer able pharmacy online viagra http://appalachianmagazine.com/category/history/appalachian-history/?filter_by=featured to satisfy his ladylove during the love-making activity.
With those things in mind, let’s look at the common ADS-B receiver and decoder applications and the ports they broadcast on.

[csv src=http://sonicgoose.com/wp-content/uploads/2015/05/decoder_ports.csv disable=css unsortable=1,2,3,4,5]

 

You’ll notice that ModeSDeco2 doesn’t have a port number associated with it. That’s because ModeSDeco2 doesn’t use any ports by default, so when you set it up you can specify any port number you want. I’ve substituted the variable a to represent this. So it doesn’t matter what port number you use (provided that another application isn’t already using it) as long as you use that same number in the subsequent steps where you need to replace the variable. (I’m going to use 32000 but you can use a different number if you like.)

So how do we tell ModeSMixer2 to listen to the data being served by our decoder apps? Well, ModeSMixer2 is a command-line utility (meaning it doesn’t have a graphical interface) that runs on Windows, Mac OS X, Linux, RaspberryPi and a bunch of other operating systems. It works the same no matter which OS you use, except for the very first part of the command.

To simplify the instructions that follow, I’m going to preface everything with just:

modesmixer2

But in Windows you should substitute that with:

c:\path\to\application\modesmixer2.exe

And in everything else, substitute this instead:

/path/to/application/modesmixer2

Data Input

To tell ModeSMixer2 to listen to a port, we have to use the --inConnect argument, which needs two arguments: IP address and port number. We don’t need to tell ModeSMixer2 which decoder application we want it to listen to – it’s smart enough to figure that out for itself – but we do have to tell it where to find that application. Here’s how to do that for each of the four decoder apps listed in the table above…

For RTL1090:

modesmixer2 --inConnect 127.0.0.1:31001

For dump1090:

modesmixer2 --inConnect 127.0.0.1:30002

For ADSB#:

modesmixer2 --inConnect 127.0.0.1:47806

For ModeSDeco2:

modesmixer2 --inConnect 127.0.0.1:a

Remember we talked about the variable a earlier? I said I was going to use port 32000 for ModeSDeco2, so that becomes:

modesmixer2 --inConnect 127.0.0.1:32000

Make sense? Good.

Now here’s the absolutely beautiful thing about ModeSMixer2: you can specify more than one source, and you can mix and match the types of decoder applications used. So, assuming I have four computers on my network, something like this would be perfectly valid:

modesmixer2 --inConnect 127.0.0.1:31001 --inConnect 192.168.1.10:30002 --inConnect 192.168.1.11:47806 --inConnect 192.168.1.12:32000

With that command, I’m telling ModeSMixer2 that I have an instance of RTL1090 running on the same PC as ModeSMixer, and once instance each of dump1090, ADSB# and ModeSDeco2 running on three other computers on my home network. I could just as easily have only two computers, both running dump1090:

modesmixer2 --inConnect 127.0.0.1:30002 --inConnect 192.168.1.10:30002

You get the idea, I hope.

Data Output

ModeSMixer2 can output the data in a variety of different formats for use with many of the available virtual radar applications. Notable exceptions are the commercially available Aurora Virtual Radar and AirNav RadarBox. Still, that gives you at least five other applications that you can use, including BaseStation, PlanePlotter, Virtual Radar Server, ADSBScope and Globe-S RTL Edition. And, as an added bonus, ModeSMixer2 includes it’s own optional web server, which can display statistics, charts, a list of tracked flights, and a map with aircraft positions plotted. What more could you need?

To tell ModeSMixer2 to serve data, we need to use the --outServer parameter, which needs two arguments: format and port. The available formats are beast, avr, avrmlat, msg (also known as BaseStation 30003 format), sbs30006, sbs10001 (also known as Kinetic Raw format) and fatsv (for FlightAware’s piAware app). Globe-S requires a unique parameter, which I’ll cover in a moment.

I’m going to use variables again here, because for most of these formats you can use whatever port numbers you want (as long as they aren’t used by any other app). For the first one, though, I’ll give you a port number. I’m also going to substitute <inConnect> for whatever actual inConnect parameters you’ve selected to use.

For BaseStation:

modesmixer2 <inConnect> --outServer sbs10001:10001

This tells modesmixer2 to output data on port 10001 in Kinetic’s Raw format, sbs10001. I’ve obviously selected port 10001 because it matches the name of the output format. That makes it easy to remember.

For PlanePlotter:

modesmixer2 <inConnect> --outServer beast:b

Substitute your chosen port number for b, but remember what you’ve picked because you’ll need to tell PlanePlotter that same port number. See below.

For Virtual Radar Server:

modesmixer2 <inConnect> --outServer avr:c

VRS can accept a few different formats, but AVR is my preferred and recommended one. Again, substitute your chosen port number for c and remember it to enter in VRS.

For ADSBScope:

modesmixer2 <inConnect> --outServer beast:b

Hey, wait a minute, that’s the same command parameter we used for PlanePlotter. Remember the radio station analogy? One broadcaster and many listeners. Remember the port number you substituted for b.

For Globe-S RTL Edition we have to use a special parameter that requires three arguments. We need a port number, which I’m going to replace here with the variable e; we need a table 2 name, which is a name you make up; and lastly we need a location name, which you also make up. This could be “home,” or “work,” or “cottage.”

(An aside here: the table 2 name stems from the http server built into the latest versions of RTL1090. Within RTL1090, a name must be defined for each of the four tables that RTL1090 serves. For more information, see 5. HTTP server for Mode-S and ADS-B data and pay close attention to sections 5.3.1 and 5.3.2.)

So to output data from ModeSMixer2 for Globe-S RTL Edition, the parameter is:

modesmixer2 <inConnect> --globes e:table2name:location

As an example, if I decided to use port 40000, named my table2 “s0n1cg00s3” and this receiver was at my cottage, I would use:

modesmixer2 <inConnect> --globes 40000:s0n1cg00s3:cottage

It sounds more complicated that it really is. And just like the --inConnect arguments, you can mix and match the --outServer and --globes arguments, like this:

modesmixer2 <inConnect> --outServer sbs10001:10001 --outServer beast:40001 --outServer avr:40002 --globes 40000:s0n1cg00s3:cottage

Web Server

ModeSMixer2 includes a built-in web server so you can view statistics, charts, flight list and a map with the aircraft plotted on it. Activating this web server requires that you add the --web parameter to the command line, which requires a port number. Web servers typically run on ports 80, 8000, 8080 or 8888, so try to use one of these four. It would look like this, for example:

modesmixer2 <inConnect> <outServer> <globes> --web 8888

Notice I’ve replaced the potentially lengthy list of output servers with <outServer> and <globes>, just for simplicity here.

Adding Aircraft Info and Routes

Note: To use ModeSMixer2 with the database files listed below, you must install the sqlite3 library. See http://www.sqlite.org for download versions and instructions.

Aircraft output a hex code to identify themselves. In order to translate that into a registration, model, operator, etc., that you can see through the built-in web server, you need a database. The de facto standard has become the basestation.sqb file that originated with Kinetic’s BaseStation virtual radar application. If you’re not using BaseStation, don’t worry: you can download a pre-populated file off the Internet. Once you have a file, you can tell ModeSMixer2 to use it with the following:

modesmixer2 --db /path/to/file/basestation.sqb

Be warned: if you are using BaseStation, you may want to make a copy of basestation.sqb to use solely with ModeSMixer2. The reason is that ModeSMixer2 will both read from and write to the database. Having more than one application trying to write to the database at the same could lead to conflicts and/or duplicate data.

You can display flight routes in a similar fashion. Again, pre-populated databases, typically name flightroute.sqb, can be downloaded from the Internet. Once you have a database file, you can tell ModeSMixer2 to use with the following:

modesmixer2 --frdb /path/to/file/flightroute.sqb

Here’s the thing with starting out with a pre-populated basestation.sqb or flightroute.sqb: they’re static databases, meaning data about new aircraft, re-registered aircraft, aircraft sold to different operators or written off in accidents aren’t being added to your database. The pre-populated databases are essentially snapshots in time. Instructions for adding data to the databases is way beyond the scope of this tutorial, so I recommend searching the Internet for solutions.

Adding Logos and Silhouettes

With a populated basestation.sqb file in place, you can also add logos, silhouettes and operator flags to the web server display. You can download these from the Internet as well. Traditionally these are placed in a folder called OperatorFlags. To use them, add the following parameter:

modesmixer2 --silhouettes /path/to/folder/OperatorFlags

Create a Batch File or Shell Script

Typing a lengthy command in each time you want to run it is a real pain, but if you create a batch file (Windows) or a shell script (every other OS), then it becomes a much simpler process to run the utility.

In Windows, create a file called modesmixer2.bat using Notepad and save it in the same folder as modesmixer2. In the file, type in:

@echo off
cmd /c c:/path/to/application/modesmixer2.exe <inConnect> <outServer> <globes> --web 8888 --db c:/path/to/file/basestation.sqb --frdb c:/path/to/file/flightroute.sqb --silhouettes c:/path/to/folder/OperatorFlags
PAUSE
exit

My own personal modesmixer2.bat file looks like this:

@echo off
cmd /c c:/modesmixer2/modesmixer2.exe --inConnect 192.168.0.105:30005 --inConnect 127.0.0.1:30005 --outServer beast:31001 --outServer sbs10001:10001 --outServer msg:30003 --outServer avr:10002 --outServer msg:10003 --globes 32000:table2:home --web 8888 --db c:/modesmixer2/basestation.sqb --frdb c:/modesmixer2/flightroute.sqb --silhouettes c:/Kinetic/BaseStation/OperatorFlags
PAUSE
exit

(Note: because of the potential security hole, I’ve replaced my table2name with simply table2 in the example above.)

In any of the *nix operating systems (Mac OS X, Linux, RaspberryPi, you’ll need to create a shell script. Using a command-line or terminal utility, navigate to the directory where you have the modesmixer2 executable file and type:

touch modesmixer2.sh

That creates the file. Then type:

pico modesmixer2.sh

You can also use vi or nano or your favourite text editor to do this. Then enter your commands and save and exit from the file.

\path\to\application\modesmixer2 <inConnect> <outServer> <globes> --web 8888 --db \path\to\file\basestation.sqb --frdb \path\to\file\flightroute.sqb --silhouettes \path\to\folder\OperatorFlags

A real world example might be:

\usr\bin\modesmixer2 --inConnect 192.168.0.105:30005 --inConnect 127.0.0.1:30005 --outServer beast:31001 --outServer sbs10001:10001 --outServer msg:30003 --outServer avr:10002 --outServer msg:10003 --globes 32000:table2:home --web 8888 --db ~\Documents\basestation.sqb --frdb ~\Documents\flightroute.sqb --silhouettes ~\Documents\OperatorFlags

Once you’ve saved the file and exited from your editor, make your file executable:

chmod +x modesmixer2.sh

To run this, just type:

./modesmixer.sh

And that’s it. With the web server running, you can access it from any web browser on your network. Just type in http://ipaddress:port. If you’re on the same machine as ModeSMixer2 and used port 8888 like I did, try this link to load the web page.

modesmixer2screens

You can see a full list of all command-line parameters for ModeSMixer2 by running:

modesmixer2 -h
Program options:
  -h [ --help ]           This help message
 --inConnect arg          Input connector. Format: host:port
 --inServer arg           Input server. Format: port
 --inServerUdp arg        Input udp server. Format: port
 --inSerial arg           Input serial.
                          Format: port[:speed[:flow_control]]
                          FlowControl: none,software,hardware
 --outConnect arg         Output connector.
                          Format: type:host:port
                          Types: beast,avr,avrmlat,msg,sbs30006
 --outConnectId arg       Output connector with Id.
                          Format: host:port[:name:lat:lon:TEXT:freq]
 --outConnectUdp arg      Output udp connector.
                          Format: type:host:port
                          Types: beast,avr,avrmlat,msg,sbs30006
 --outServer arg          Output server.
                          Format: type:port
                          Types: beast,avr,avrmlat,msg,
                                 sbs30006,sbs10001,fatsv
 --globes arg             Enable Globe-S server. Format 
                          port:tablename:stationid
 --web arg                Enable Web Interface on port
 --silhouettes arg        Set Silhouettes directory
 --pictures arg           Set Aircraft Pictures directory
 --db arg                 Set DB Filename
 --frdb arg               Set FlightRoute DB Filename
 --localtime              Local Time in MSG format output
                          (default: UTC)
 --filter-expire arg      Filter expire time, sec (default: 20)
 --filter-count arg       Filter min count (default: 6)
 --filter-time arg        Filter min time, sec (default: 60)
 --filter-nocountry       Disable ICAO Country filter (default: on)
 --flight-expire-time arg Flight expire time, sec (default: 3600)
 --log-noconsole          Disable logging to console (default: on)
 --log-file arg           Enable logging to file (default: off)
 --log-level arg          Set logging level 0..5 (default: 4)
                          0 disabled, 1 error, 2 warning,
                          3 notice, 4 info, 5 debug

 

18 replies on “Combining and rebroadcasting ADS-B feeds with ModeSMixer2”

  1. Hi thanks for tutorial but for me dont works, when i do modesmixer2 –db /home/pi/BaseStation.sqb

    modesmixer2 command not found

    when i make ./modesmixer2 –db /home/pi/BaseStation.sqb

    2015-05-06 15:28:26.993 INFO ModeSMixer2 20150323
    2015-05-06 15:28:27.015 INFO Magnetic declinations coefficient file wmm.cof load successful

    and nothing more happens with basestation…. what im doing wrong?

    1. My apologies. During the editing process I inadvertently deleted a very important paragraph. To use ModeSMixer2 with the database files listed below, you must install the sqlite3 library. See http://www.sqlite.org for download versions and instructions.

  2. man… man,,, copy paste its crazy hein?….. i have sql3 instaled this not work, do you realy know what you are doing? please check your copy paste again…..

  3. Hi i would like to combine a RTL dongle and kinetic sbs1 which would be running on the same computer into 1 feed to be displayed on Basestation could you please advise what coding i would have to put in the bat file please.Many thanks Ian.S

    1. Ian, Kinetic says this will work only if you have an “…SBS-1eR, an SBS-1e or an SBS-1EM add-on Ethernet module for your SBS-1…” Assuming that’s what you have, and assuming you’ve got your box connected to your network with an ethernet cable, then your .bat file would contain “–inConnect xxx.xxx.xxx.xxx:10001” (replace the x’s with the ip address of your SBS-1 box).

      1. Thanks for your response Rob but the SBS1e i have is connected via usb cable and the RTL dongle is running through Modesdeco what i want to do is have the SBS and the RTL streams to combine into 1 stream which i want to view on sbs Basestation.I have the RTL data on Modesdeco via port 10001 going into Basestation just fine but is it possible to merge the SBS own data input with the RTL and to have the combined data show in Basestation.Cheers Ian.S

        1. While ModeSMixer2 has a –inSerial parameter, I’m not sure it will work in Windows because of the bizarre addressing system Microsoft uses for USB ports. I don’t have an SBS1e to test with either. I am, however, trying to find an answer for you so please just be a little patient. Thanks

  4. Hi

    Every time I run this command on my Rpi 2, no matter what output port I give, it always get the same error
    terminate called after throwing an instance of ‘boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector >’
    what(): bind: Address already in use
    ./modesmixer2.sh: line 1: 2722 Aborted

    Any ideas as to why this is happening and how to fix would be appreciated please.

    Thanks

  5. Hello,

    Can someone tell me difference between ModeSDeco 2 and ModesMixer2??
    I like to experiment with both, but can’t tell what the difference is 🙂

    Thanks!

    Mark.

    1. Hi, Mark. While there are some similarities between the two apps, the names of the apps offer a clue to the differences.
      ModeSDeco2 is a DECOder: it connects to an rtl-sdr USB stick and interprets the data being received from aircraft. It decodes it and can display it overlaid on a Google map via its built-in web server. It can also rebroadcast the data in other formats for display in virtual radar apps like BaseStation, PlanePlotter and ADSBScope, for example.
      ModeSMixer2 is not a decoder; rather it has the ability to MIX together the data streams from multiple decoders (e.g. ModeSDeco2, dump1090, RTL1090) and output them as a single data stream. ModeSMixer2 can display the merged stream on a Google map using its own built in web server, just like ModeSDeco2 can, and it can rebroadcast in various formats just like ModeSDeco2. However, ModeSMixer2 can also output to Globe-S RTL Edition, which ModeSDeco2 cannot do.
      If you have just one USB receiver plugged into one computer, then all you need is ModeSDeco2. However, if you have more than one receiver and you want to combine the data from them into a single stream, then you would need both applications. You would need ModeSDeco2 running once for each receiver, and you would need ModeSMixer2 running just once to combine the data streams into one.
      I hope that clears up any confusion you had.

  6. Hi Rob,
    I use ModeSDeco2 with good result and I want to use ModeSMixer2 for sharing, but I’m not able.
    I read your post and I use this batch file:
    \modesmixer2.exe –web 8088 –inConnect 127.0.0.1:32000 -–outConnect beast:feed.adsbexchange.com:30005
    When I launch it nothing happens.
    I’m asking: what command I have to use in ModeSDeco2 to send data to ModeSMixer2 on port 32000?

      1. Hi Rob,
        I had an help from radarspotting.com forum too and now it work well.
        I would never have thought of using the command “–sbs” to connect the two software, since I use a USB RTL dongle and not an SBS Receiver: I believe I still have a lot to learn!

        Now my basic batch file for ModeSDeco2 is:
        \modesdeco2.exe –freq-correction 60 –gain 48 –web 8088 –sbs10001 10001

        My basic batch file for ModeSMixer2 is:
        \modesmixer2.exe –inConnect 127.0.0.1:10001 –outServer sbs10001:10001 –outConnect beast:feed.adsbexchange.com:30005

        Now I can see my receptions both on my local host and on Global Radar View on adsbexcange.com
        I don’t use MLAT,but in the Global Radar I can see more planes in my coverage that I don’t see on my local host map: I think it is because the triangulation of the data with other feeder, even if there are hundred of kilometers from me to the other.
        Adsbexchange seems to be a good complement to the air traffic monitoring …and it’s free!

        Thanks for your help and compliments for your good blog site.

  7. could one of yous upload flightroute.sqb (ICAO) file somewhere, like on a MediaFire account, for the rest of us that will > n e v e r < open a yahoo account, please?

  8. Rob, thanks, what port for Flightaware output? I have three PIAWare 3.1 units and want to send FA Just one feed. Does your tool dedup entries before output? Lastly, how would I tell my individual PIAWare instants to stop sending to FA as individual feeds?

    Jim

    1. Hi, Jim. The last time I checked with FA a few months ago, a combined feed to them was not possible because of the mlat timestamps. I have multiple PiAware setups as well and am stuck providing multiple feeds to FA as a result.

  9. Hi Rob, Great tutorial!

    Just wanted to warn you that the example start scripts you provided are using wrong slashes/backslashed between the Windows and Linux examples for the paths… (/ for *nix paths and \ for windows paths).

Comments are closed.