Setting Up Virtual Radar Server

Virtual Radar Server is an alternative way to visualize and consume information that is extruded by devices like PiAware (written about here ).

There is documentation on the VRS website for setting up mono/Linux, but this shows how to do it on FreeBSD.

Install FreeBSD

Nothing fancy. Basic FreeBSD installation. I skipped all the pkg customization stuff and just installed binary packages for this experiment. The following pkgs ended up being installed:

  1accessibility/atk
  2accessibility/atkmm
  3converters/fribidi
  4converters/libiconv
  5databases/gdbm
  6databases/sqlite3
  7devel/autoconf
  8devel/autoconf-wrapper
  9devel/automake
 10devel/automake-wrapper
 11devel/bison
 12devel/cscope
 13devel/dbus
 14devel/dbus-glib
 15devel/gettext-runtime
 16devel/gettext-tools
 17devel/glib20
 18devel/glibmm
 19devel/gmake
 20devel/gmake-lite
 21devel/gobject-introspection
 22devel/icu
 23devel/libdaemon
 24devel/libdevq
 25devel/libedit
 26devel/libevent2
 27devel/libffi
 28devel/libglade2
 29devel/libnotify
 30devel/libpciaccess
 31devel/libpthread-stubs
 32devel/libsigc++20
 33devel/llvm37
 34devel/m4
 35devel/mono-addins
 36devel/p5-Locale-gettext
 37devel/pcre
 38devel/pkgconf
 39dns/libidn
 40editors/vim
 41emulators/open-vm-tools
 42emulators/tpm-emulator
 43graphics/cairo
 44graphics/cairomm
 45graphics/dri
 46graphics/gbm
 47graphics/gdk-pixbuf2
 48graphics/giflib
 49graphics/graphite2
 50graphics/gtk-update-icon-cache
 51graphics/jasper
 52graphics/jbigkit
 53graphics/jpeg-turbo
 54graphics/libEGL
 55graphics/libGL
 56graphics/libdrm
 57graphics/libepoxy
 58graphics/libglapi
 59graphics/libglesv2
 60graphics/png
 61graphics/tiff
 62lang/mono
 63lang/perl5.20
 64lang/python
 65lang/python2
 66lang/python27
 67lang/ruby22
 68math/gmp
 69misc/help2man
 70misc/hicolor-icon-theme
 71misc/pciids
 72misc/shared-mime-info
 73net/avahi-app
 74net/avahi-sharp
 75net/libdnet
 76net/mono-zeroconf
 77net/rsync
 78ports-mgmt/dialog4ports
 79ports-mgmt/pkg
 80ports-mgmt/portmaster
 81print/cups
 82print/freetype2
 83print/harfbuzz
 84print/indexinfo
 85print/libpaper
 86security/ca_root_nss
 87security/gnutls
 88security/libtasn1
 89security/nettle
 90security/p11-kit
 91security/sudo
 92security/trousers
 93shells/bash
 94sysutils/fusefs-libs
 95sysutils/gnome_subr
 96sysutils/mono-kmod
 97sysutils/tmux
 98textproc/expat2
 99textproc/libxml++26
100textproc/libxml2
101textproc/libyaml
102textproc/p5-XML-LibXML
103textproc/p5-XML-NamespaceSupport
104textproc/p5-XML-SAX
105textproc/p5-XML-SAX-Base
106textproc/xmlcatmgr
107x11-clocks/xclock
108x11-drivers/xf86-input-keyboard
109x11-drivers/xf86-input-mouse
110x11-drivers/xf86-video-ati
111x11-drivers/xf86-video-intel
112x11-drivers/xf86-video-mach64
113x11-drivers/xf86-video-nv
114x11-drivers/xf86-video-openchrome
115x11-drivers/xf86-video-r128
116x11-drivers/xf86-video-vesa
117x11-drivers/xorg-drivers
118x11-fonts/dejavu
119x11-fonts/encodings
120x11-fonts/font-adobe-100dpi
121x11-fonts/font-adobe-75dpi
122x11-fonts/font-adobe-utopia-100dpi
123x11-fonts/font-adobe-utopia-75dpi
124x11-fonts/font-adobe-utopia-type1
125x11-fonts/font-alias
126x11-fonts/font-arabic-misc
127x11-fonts/font-bh-100dpi
128x11-fonts/font-bh-75dpi
129x11-fonts/font-bh-lucidatypewriter-100dpi
130x11-fonts/font-bh-lucidatypewriter-75dpi
131x11-fonts/font-bh-ttf
132x11-fonts/font-bh-type1
133x11-fonts/font-bitstream-100dpi
134x11-fonts/font-bitstream-75dpi
135x11-fonts/font-bitstream-type1
136x11-fonts/font-cronyx-cyrillic
137x11-fonts/font-cursor-misc
138x11-fonts/font-daewoo-misc
139x11-fonts/font-dec-misc
140x11-fonts/font-ibm-type1
141x11-fonts/font-isas-misc
142x11-fonts/font-jis-misc
143x11-fonts/font-micro-misc
144x11-fonts/font-misc-cyrillic
145x11-fonts/font-misc-ethiopic
146x11-fonts/font-misc-meltho
147x11-fonts/font-misc-misc
148x11-fonts/font-mutt-misc
149x11-fonts/font-schumacher-misc
150x11-fonts/font-screen-cyrillic
151x11-fonts/font-sony-misc
152x11-fonts/font-sun-misc
153x11-fonts/font-util
154x11-fonts/font-winitzki-cyrillic
155x11-fonts/font-xfree86-type1
156x11-fonts/fontcacheproto
157x11-fonts/fontconfig
158x11-fonts/fontsproto
159x11-fonts/libFS
160x11-fonts/libXfont
161x11-fonts/libXfontcache
162x11-fonts/libXft
163x11-fonts/libfontenc
164x11-fonts/mkfontdir
165x11-fonts/mkfontscale
166x11-fonts/xorg-fonts
167x11-fonts/xorg-fonts-100dpi
168x11-fonts/xorg-fonts-75dpi
169x11-fonts/xorg-fonts-cyrillic
170x11-fonts/xorg-fonts-miscbitmaps
171x11-fonts/xorg-fonts-truetype
172x11-fonts/xorg-fonts-type1
173x11-servers/xorg-server
174x11-themes/xcursor-themes
175x11-toolkits/gtk-sharp20
176x11-toolkits/gtk20
177x11-toolkits/gtkmm24
178x11-toolkits/libXaw
179x11-toolkits/libXmu
180x11-toolkits/libXt
181x11-toolkits/libgdiplus
182x11-toolkits/pango
183x11-toolkits/pangomm
184x11-wm/fluxbox
185x11-wm/twm
186x11/appres
187x11/bitmap
188x11/compositeproto
189x11/damageproto
190x11/dmxproto
191x11/dri2proto
192x11/fixesproto
193x11/glproto
194x11/iceauth
195x11/inputproto
196x11/kbproto
197x11/libICE
198x11/libSM
199x11/libX11
200x11/libXScrnSaver
201x11/libXTrap
202x11/libXau
203x11/libXcomposite
204x11/libXcursor
205x11/libXdamage
206x11/libXdmcp
207x11/libXevie
208x11/libXext
209x11/libXfixes
210x11/libXi
211x11/libXinerama
212x11/libXp
213x11/libXpm
214x11/libXrandr
215x11/libXrender
216x11/libXres
217x11/libXtst
218x11/libXv
219x11/libXvMC
220x11/libXxf86dga
221x11/libXxf86misc
222x11/libXxf86vm
223x11/libdmx
224x11/liboldX
225x11/libxcb
226x11/libxkbfile
227x11/libxkbui
228x11/libxshmfence
229x11/luit
230x11/pixman
231x11/printproto
232x11/randrproto
233x11/recordproto
234x11/renderproto
235x11/scrnsaverproto
236x11/sessreg
237x11/setxkbmap
238x11/smproxy
239x11/trapproto
240x11/videoproto
241x11/x11perf
242x11/xauth
243x11/xbacklight
244x11/xbitmaps
245x11/xcalc
246x11/xcb-util
247x11/xcb-util-renderutil
248x11/xcmsdb
249x11/xconsole
250x11/xcursorgen
251x11/xdpyinfo
252x11/xdriinfo
253x11/xev
254x11/xextproto
255x11/xf86dga
256x11/xf86dgaproto
257x11/xf86miscproto
258x11/xf86vidmodeproto
259x11/xgamma
260x11/xgc
261x11/xhost
262x11/xineramaproto
263x11/xinit
264x11/xinput
265x11/xkbcomp
266x11/xkbevd
267x11/xkbutils
268x11/xkeyboard-config
269x11/xkill
270x11/xlsatoms
271x11/xlsclients
272x11/xmessage
273x11/xmodmap
274x11/xorg
275x11/xorg-apps
276x11/xorg-docs
277x11/xorg-libraries
278x11/xpr
279x11/xprop
280x11/xproto
281x11/xrandr
282x11/xrdb
283x11/xrefresh
284x11/xset
285x11/xsetmode
286x11/xsetroot
287x11/xterm
288x11/xtrans
289x11/xvinfo
290x11/xwd
291x11/xwininfo
292x11/xwud

With this, I ended up with a graphical (capable) system, running fluxbox . The point of this system is to run VRS, headless, so I don’t need a fancy interface. I’d be happy of VRS didn’t need a gui, but I digress.

Mono and friends

Download the mono version of the VRS tarball from the VRS site (mentioned in the footnotes).

Once you have mono installed, you can fetch the tarball for VRS (don’t get the windows installer). Unpack it into a directory (by default, it unpacks into the current directory, which is messy). I chose VRS. Because reasons, you need to create a ‘VirtualRadar.exe.config’ file in the same directory as your VirtualRadar.exe file. The contents are:

 1<?xml version="1.0"?>
 2<configuration>
 3    <configSections>
 4    </configSections>
 5    <startup>
 6        <supportedRuntime version="v2.0.50727"/>
 7    </startup>
 8    <runtime>
 9        <assemblyBinding  xmlns="urn:schemas-microsoft-com:asm.v1">
10            <dependentAssembly>
11                <assemblyIdentity name="Mono.Data.Sqlite"
12                                  publicKeyToken="0738eb9f132ed756"
13                                  culture="neutral" />
14                <bindingRedirect oldVersion="2.0.0.0"
15                                 newVersion="4.0.0.0" />
16            </dependentAssembly>
17        </assemblyBinding>
18    </runtime>
19</configuration>

This fixes some mono/.net version mismatch/compat stuff.

You should now be able to run

1mono VirtualRadar.exe

Most of the options are pretty straight forward. If you don’t know the lat/long of your basestation (PiAware?) you can use Google Maps to find your location.

  • Download the Silhouette Logos : Unzip this into your VRS directory that has the VirtualRadar.exe.config
  • Download the Country Flags : Unzip this into your VRS directory that has the VirtualRadar.exe.config
  • Download the Operator Logos (1-4) : I made a directory for this called Logos and then unzipped all four of the archives into the directory (There may be some overwriting, I just said ‘yes’). The logos directory is in the VRS directory that contains the VirtualRadar.exe.config.

Once you get it connected, it should look similar to this.

I’ve noticed that it seems to crash if I attempt to go into options or plugins more than once. Annoying, but only at the beginning. Once things are configured, it seems moderately stable.

Virtual Radar Server Addons

Download the SQB files

Unzip this into your VRS directory that has the VirtualRadar.exe.config Download the Database Writer Plugin

This is used for keeping a history of the planes you see. When you load VRS, under Tools -> Plugins, you should s

Sample screenshots

You can point your browser at http://<your_vrs_ip>:8080/VirtualRadar/ and you should see something similar to this (Depending on where you live and how busy your skys are).

I periodically add to the gallery below as I see interesting things.

Reporting

All this is fun, but really, who has time to watch this 24/7? Since the BaseStation.sqb file is just an SQLite database, you can script queries and generate reports for yourself. A script like this will find all the flights in the last 24hrs that have an owner that starts with ‘United States’. It will then print out a collection of fields. It looks like this:

 1ModeS    Country        Registration  Owner                           Callsign    ICAO   Type                            Oper   Last Seen          
 2-------  -------------  ------------  ------------------------------  ----------  -----  ------------------------------  -----  -------------------
 3AE26A7   United States  6581          United States Coast Guard       CG6581      AS65   Aerospatiale MH-65D Dolphin            2016-10-09 00:07:35
 4AE1E6A   United States  166012        United States Navy              BOILERUP    TEX2   Raytheon Aircraft Company T-6B         2016-10-09 00:21:10
 5AE14AA   United States  160854        United States Navy                          BE9L   Beech T-44A Pegasus                    2016-10-09 00:22:07
 6AE26BA   United States  6603          United States Coast Guard       C6603       AS65   Aerospatiale MH-65D Dolphin            2016-10-09 00:45:23
 7ADFFC8   United States  64-13304      United States Air Force                     T38    Northrop T-38A Talon                   2016-10-09 00:55:04
 8AE4EAD   United States  166196        United States Navy                          TEX2   Raytheon Aircraft Company T-6B         2016-10-09 01:13:29
 9AE147A   United States  166693        United States Navy              CNV4584     B737   Boeing C-40A                           2016-10-09 01:14:38
10AE1ED9   United States  166084        United States Navy                          TEX2   Raytheon Aircraft Company T-6B         2016-10-09 01:20:27
11AE0478   United States  58-0046       United States Air Force         ZOMBE23     K35R   Boeing KC-135T                  RCH    2016-10-09 01:24:51
12AE4C5F   United States  10-0729       United States Air Force         RAIL11      B350   Hawker Beechcraft Corp MC-12W          2016-10-09 01:30:34
13A92FB5   United States  07-0691       United States Air Force                     PC12   Pilatus PC-XII U-28B                   2016-10-09 01:32:02
14AE26BA   United States  6603          United States Coast Guard       C6603       AS65   Aerospatiale MH-65D Dolphin            2016-10-09 02:13:59
15ADFCCB   United States  93-0651       United States Air Force                     BE40   Beech T-1A Jayhawk                     2016-10-09 02:26:52
16AE145D   United States  06-6159       United States Air Force         RCH111      C17    Boeing C-17A Globemaster III    RCH    2016-10-09 02:29:56
17ADFCB1   United States  93-0625       United States Air Force                     BE40   Beech T-1A Jayhawk                     2016-10-09 02:37:31
18AE1E85   United States  166039        United States Navy                          TEX2   Raytheon Aircraft Company T-6B         2016-10-09 02:46:17
19AE1E79   United States  166027        United States Navy                          TEX2   Raytheon Aircraft Company T-6B         2016-10-09 02:47:08
20AE1E6A   United States  166012        United States Navy              BOILERUP    TEX2   Raytheon Aircraft Company T-6B         2016-10-09 02:49:45
21AE059C   United States  60-0350       United States Air Force         OILER47     K35R   Boeing KC-135R                  RCH    2016-10-09 03:10:36
22AE4C5F   United States  10-0729       United States Air Force         RAIL11      B350   Hawker Beechcraft Corp MC-12W          2016-10-09 03:41:04
23AE0478   United States  58-0046       United States Air Force         ZOMBE23     K35R   Boeing KC-135T                  RCH    2016-10-09 03:53:49
24AE1494   United States  97-0100       United States Air Force         DRACO21            Boeing E-8C Joint STARS         RCH    2016-10-09 10:31:46
25AE2EE4   United States  166103        United States Navy                          TEX2   Raytheon Aircraft Company T-6B         2016-10-09 14:07:11
26ADFF57   United States  68-8112       United States Air Force                     T38    Northrop T-38C Talon                   2016-10-09 15:01:32
27AE4C5F   United States  10-0729       United States Air Force         RONIN20     B350   Hawker Beechcraft Corp MC-12W          2016-10-09 15:13:48
28AE04F1   United States  84-00161      United States Army              PAT571      BE20   Beech C-12U-3 Huron                    2016-10-09 15:18:44
29AE57C7   United States  169002        United States Navy              VVLL811     P8     Boeing P-8A Poseidon                   2016-10-09 15:32:17
30AE14CD   United States  161076        United States Navy                          BE9L   Beech T-44A Pegasus                    2016-10-09 15:52:49
31ADFE8A   United States  61-2666       United States Air Force         SAME40      C135   Boeing NC-135W                  RCH    2016-10-09 15:56:48
32AE04D7   United States  165829        United States Navy              CNV4601     B737   Boeing C-40A                           2016-10-09 16:00:19
33AE1E5A   United States  07-3890       United States Air Force                     TEX2   Hawker Beechcraft Corp T-6A Te         2016-10-09 16:44:42
34AE4BEE   United States  2314          United States Coast Guard                   CN35   CASA HC-144A Ocean Sentry              2016-10-09 16:46:48
35ADFE8A   United States  61-2666       United States Air Force         SAME40      C135   Boeing NC-135W                  RCH    2016-10-09 17:23:33
36AE0566   United States  85-0009       United States Air Force         RCH148      C5M    Lockheed C-5M Galaxy            RCH    2016-10-09 17:36:18
37AE4EBA   United States  168436        United States Navy              MADFX22     P8     Boeing P-8A Poseidon                   2016-10-09 17:59:29
38AE14CB   United States  161074        United States Navy                          BE9L   Beech T-44A Pegasus                    2016-10-09 18:00:17
39AE0570   United States  86-0019       United States Air Force                     C5M    Lockheed C-5M Galaxy            RCH    2016-10-09 18:00:58
40A3522F   United States  N313CG        United States Dept of Justice               AT43   Avions de Transport Regional A  DOJ    2016-10-09 18:20:24
41AE04F1   United States  84-00161      United States Army              PAT571      BE20   Beech C-12U-3 Huron                    2016-10-09 18:21:31
42AE4C5F   United States  10-0729       United States Air Force         RONIN20     B350   Hawker Beechcraft Corp MC-12W          2016-10-09 18:26:27
43AE01E3   United States  96-3011       United States Air Force                     TEX2   Raytheon Aircraft Company T-6A         2016-10-09 18:27:03
44ADFC69   United States  90-0407       United States Air Force                     BE40   Beech T-1A Jayhawk                     2016-10-09 18:31:31
45AE2EE4   United States  166103        United States Navy                          TEX2   Raytheon Aircraft Company T-6B         2016-10-09 18:31:49
46ADFF57   United States  68-8112       United States Air Force                     T38    Northrop T-38C Talon                   2016-10-09 18:32:00
47ADFE8A   United States  61-2666       United States Air Force         SAME40      C135   Boeing NC-135W                  RCH    2016-10-09 18:48:16
48AE03EB   United States  165314        United States Navy                          C130   Lockheed C-130T Hercules               2016-10-09 19:23:31
49AE0577   United States  86-0026       United States Air Force         RCH622      C5M    Lockheed C-5M Galaxy            RCH    2016-10-09 19:26:40
50AE1E5A   United States  07-3890       United States Air Force                     TEX2   Hawker Beechcraft Corp T-6A Te         2016-10-09 19:40:21
51AE05DA   United States  85-0041       United States Air Force         HANK41      C130   Lockheed C-130H Hercules        RCH    2016-10-09 20:00:25
52AE020F   United States  79-1951       United States Air Force         PRIMO85     DC10   Douglas KC-10A Extender         RCH    2016-10-09 20:02:48
53ADFE8A   United States  61-2666       United States Air Force         SAME40      C135   Boeing NC-135W                  RCH    2016-10-09 20:10:07
54AE14CB   United States  161074        United States Navy                          BE9L   Beech T-44A Pegasus                    2016-10-09 20:13:42
55AE0429   United States  62-3530       United States Air Force         MASH63      K35R   Boeing KC-135R                  RCH    2016-10-09 20:25:26
56AE04F1   United States  84-00161      United States Army              PAT571      BE20   Beech C-12U-3 Huron                    2016-10-09 20:53:47
57AE2EE4   United States  166103        United States Navy                          TEX2   Raytheon Aircraft Company T-6B         2016-10-09 21:02:31
58AE03E7   United States  165159        United States Navy                          C130   Lockheed C-130T Hercules               2016-10-09 21:05:54
59AE2F6A   United States  09-0659       United States Air Force         SAME90      B350   Hawker Beechcraft Corp MC-12W          2016-10-09 21:16:42
60ADFEA1   United States  94-7321       United States Air Force         DAWG88      C130   Lockheed C-130H Hercules        RCH    2016-10-09 21:21:44
61AE12B7   United States  87-0023       United States Air Force         CHAIN21     C130   Lockheed MC-130H Hercules       RCH    2016-10-09 21:41:37
62AE0484   United States  62-3509       United States Air Force         BACKY91     K35R   Boeing KC-135R                  RCH    2016-10-09 21:54:38
63AE4AF2   United States  08-3177       United States Air Force         HAVOC63     C30J   Lockheed C-130J-30 Hercules     RCH    2016-10-09 21:58:23
64AE0859   United States  59-1506       United States Air Force         E91506      K35R   Boeing KC-135R                  RCH    2016-10-09 22:14:29
65ADFC69   United States  90-0407       United States Air Force                     BE40   Beech T-1A Jayhawk                     2016-10-09 22:19:55
66AE04F1   United States  84-00161      United States Army              PAT571      BE20   Beech C-12U-3 Huron                    2016-10-09 22:29:15
67ADFCBE   United States  93-0638       United States Air Force                     BE40   Beech T-1A Jayhawk                     2016-10-09 22:29:44
68ADFCCA   United States  93-0650       United States Air Force                     BE40   Beech T-1A Jayhawk                     2016-10-09 22:30:59
69AE03E1   United States  164994        United States Navy                          C130   Lockheed C-130T Hercules               2016-10-09 22:58:00
70AE0566   United States  85-0009       United States Air Force         RCH148      C5M    Lockheed C-5M Galaxy            RCH    2016-10-09 23:11:07
71AE1E84   United States  166038        United States Navy                          TEX2   Raytheon Aircraft Company T-6B         2016-10-09 23:13:57
72AE4AF1   United States  08-3176       United States Air Force         E83176      C30J   Lockheed C-130J-30 Hercules     RCH    2016-10-09 23:23:26
73AE14D0   United States  161079        United States Navy                          BE9L   Beech T-44A Pegasus                    2016-10-09 23:27:55
74AE1258   United States  166376        United States Navy              VV100       GLF5   Gulfstream Aerospace C-37B             2016-10-09 23:29:50

The script looks like this:

 1#!/usr/bin/env bash
 2set -e
 3date=`date -v -24H +%Y-%m-%d`
 4dbfile=/path/to/BaseStation.sqb
 5mailto='user@domain.tld'
 6output_file="/tmp/flights_$$.txt"
 7
 8
 9touch ${output_file}
10if [ -e ${output_file} ] ; then
11	SQL="select Aircraft.ModeS, Aircraft.ModeSCountry as Country, Aircraft.Registration, Aircraft.RegisteredOwners as Owner, Flights.Callsign, Aircraft.ICAOTypeCode as 'ICAO', Aircraft.Type, Aircraft.OperatorFlagCode as 'Oper', Flights.EndTime as 'Last Seen' from Aircraft INNER JOIN Flights ON (Aircraft.AircraftID=Flights.AircraftID) where Flights.EndTime like '${date}%' and Owner like 'United States%' order by Flights.EndTime ASC;"
12	sqlite3 -header -column -cmd '.width 7 0 0 30 0 5 30 5' ${dbfile} "${SQL}" \
13		> ${output_file} 2>/dev/null
14	echo "${date}" | /usr/local/bin/mutt -s "Interesting flights from yesterday" -a "${output_file}" \
15		-- "${mailto}"
16fi

You can cause it to run once a day (midnight?) and email you the output. If there is something you want to get more information about, you can always come back to VRS and use its reporting to show any additional information, potentially overlayed on a map.

Summary

Everything pretty much works as advertised. I noticed that you don’t get the option to display receiver range on the map if you use merged feeds (more than one basestation contributing to the same VRS instance) which makes sense. Reports work. Its an SQLite database, so you can run your own queries against it, and even automate text based reports if you want. All in all, pretty slick.

Footnotes and References

Copyright

Comments