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.
With those things in mind, let’s look at the common ADS-B receiver and decoder applications and the ports they broadcast on.
|Default Raw Output Port||31001||30002||47806||a|
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:
But in Windows you should substitute that with:
And in everything else, substitute this instead:
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…
modesmixer2 --inConnect 127.0.0.1:31001
modesmixer2 --inConnect 127.0.0.1:30002
modesmixer2 --inConnect 127.0.0.1:47806
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.
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.
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.
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.
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
--globes arguments, like this:
modesmixer2 <inConnect> --outServer sbs10001:10001 --outServer beast:40001 --outServer avr:40002 --globes 40000:s0n1cg00s3:cottage
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:
That creates the file. Then type:
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:
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.
You can see a full list of all command-line parameters for ModeSMixer2 by running:
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