Difference between revisions of "How to setup Virtual Radar Server and pingStation for offline use"

From steamWiki
Jump to: navigation, search
(Target your Local OSM Tile Server)
(One intermediate revision by the same user not shown)
Line 9: Line 9:
  
 
=Prereqs=
 
=Prereqs=
#Log in to your Debian 9 server as a user capable of running the "sudo" command
+
#Log in to your Debian 9 server as a user capable of running the '''sudo''' command
#Run "sudo adduser virtradar"
+
#Make sure your system is up to date by running <pre>sudo apt update</pre> and <pre>sudo apt upgrade</pre>
#Run "sudo apt update"
+
#Install the Apache Web Server and Mono Framework by running <pre>sudo apt install apache2 mono-complete</pre>
#Run "sudo apt upgrade"
 
#Run "sudo apt install apache2 mono-complete"
 
 
#*Note: If you're setting this up on an [https://en.wikipedia.org/wiki/LXC LXC] container you'll get an error with ''avahi-daemon'' and ''libnss-mdns:amd64''. This is OK.  For our uses, this won't cause any problems.
 
#*Note: If you're setting this up on an [https://en.wikipedia.org/wiki/LXC LXC] container you'll get an error with ''avahi-daemon'' and ''libnss-mdns:amd64''. This is OK.  For our uses, this won't cause any problems.
 +
#Create a new user for running Virtual Radar Server by running <pre>sudo adduser virtradar</pre>
  
 
=Setup Apache2 HTML Forwards=
 
=Setup Apache2 HTML Forwards=
The following actions will allow your users to visit ''http://MYSERVER'' and ''http://MYSERVER/admin'' to visit the main site and the admin site (respectivley).
+
The following actions will allow your users to visit http://MYSERVER and http://MYSERVER/admin to visit the main site and the admin site (respectively).
#Run "sudo rm /var/www/html/index.html"
+
#Delete Apache's default landing page by running <pre>sudo rm /var/www/html/index.html</pre>
#Run "sudo nano /var/www/html/index.html" and enter the following
+
#Create a new landing page that forwards to the main VRS site by running <pre>sudo nano /var/www/html/index.html</pre> and entering the following <pre><head>&#10;    <meta http-equiv="refresh" content="0; url=http://MYSERVER:8080/VirtualRadar" />&#10;</head></pre>
<nowiki><head>
+
#Create a new page to redirect to the VRS admin site by running <pre>sudo mkdir /var/www/html/admin&#10;sudo nano /var/www/html/admin/index.html</pre> and enter the following <pre><head>&#10;    <meta http-equiv="refresh" content="0; url=http://MYSERVER:8080/VirtualRadar/WebAdmin" />&#10;</head></pre>
    <meta http-equiv="refresh" content="0; url=http://MYSERVER:8080/VirtualRadar" />
 
</head></nowiki>
 
#Run "sudo mkdir /var/www/html/admin"
 
#Run "sudo nano /var/www/html/admin/index.html" and enter the following
 
<nowiki><head>
 
    <meta http-equiv="refresh" content="0; url=http://MYSERVER:8080/VirtualRadar/WebAdmin" />
 
</head></nowiki>
 
  
 
=Setup pingStation=
 
=Setup pingStation=
 
These steps are specific to the uAvionix pingStation.  Other ADS-B receivers will setup slightly differently.
 
These steps are specific to the uAvionix pingStation.  Other ADS-B receivers will setup slightly differently.
#visit ''http://pingstation-abcd'' (where ''abcd'' are the last 4 digits of your pingStation's [https://en.wikipedia.org/wiki/MAC_address MAC Address]
+
#visit http://pingstation-abcd (where ''abcd'' are the last 4 digits of your pingStation's [https://en.wikipedia.org/wiki/MAC_address MAC Address]
 
#set '''Output Formats:''' to ''TCP Compressed VR''
 
#set '''Output Formats:''' to ''TCP Compressed VR''
 
#set '''TCP Push IP Address or Hostname:''' to ''MYSERVER''
 
#set '''TCP Push IP Address or Hostname:''' to ''MYSERVER''
Line 38: Line 30:
  
 
=Install Virtual Radar Server=
 
=Install Virtual Radar Server=
#Run "su virtradar"
+
#Switch to the new virtradar user (starting in their home folder) by running <pre>su - virtradar</pre>
#Run "cd ~"
+
#Create a new directory for VRS, and move into it, by running <pre>mkdir VirtualRadar&#10;cd VirtualRadar</pre>
#Run "mkdir VirtualRadar"
+
#Download the latest copy of VRS by running <pre>wget http://www.virtualradarserver.co.uk/Files/VirtualRadar.tar.gz</pre>
#Run "cd VirtualRadar"
+
#Extract the contents by running <pre>tar -xvzf VirtualRadar.tar.gz</pre>
#Run "wget http://www.virtualradarserver.co.uk/Files/Preview/V3/VirtualRadar.tar.gz"
+
#Delete the compressed file by running <pre>rm VirtualRadar.tar.gz</pre>
#Run "tar -xvzf VirtualRadar.tar.gz"
+
#Download the WebAdmin plugin by running <pre>wget http://www.virtualradarserver.co.uk/Files/VirtualRadar.WebAdminPlugin.tar.gz</pre>
#Run "rm VirtualRadar.tar.gz"
+
#Extract the contents by running <pre>tar -xvzf VirtualRadar.WebAdminPlugin.tar.gz</pre>
#Run "wget http://www.virtualradarserver.co.uk/Files/Preview/V3/VirtualRadar.WebAdminPlugin.tar.gz"
+
#Delete the compressed file by running <pre>rm VirtualRadar.WebAdminPlugin.tar.gz</pre>
#Run "tar -xvzf VirtualRadar.WebAdminPlugin.tar.gz"
+
#Start VRS and create an Admin User by running <pre>"mono /home/virtradar/VirtualRadar/VirtualRadar.exe -nogui -createAdmin:admin -password:PASSWORD</pre>
#Run "rm VirtualRadar.WebAdminPlugin.tar.gz"
+
#*for subsequent runs use <pre>mono VirtualRadar.exe -nogui</pre>
#Run "mono /home/virtradar/VirtualRadar/VirtualRadar.exe -nogui -createAdmin:admin -password:PASSWORD"
 
#*for subsequent runs use "mono VirtualRadar.exe -nogui"
 
  
 
=Configure Virtual Radar Server=
 
=Configure Virtual Radar Server=
#Visit ''http://MYSERVER:8080/VirtualRadar/WebAdmin/Settings.html'' and login as ''admin/PASSWORD''
+
#Visit http://MYSERVER:8080/VirtualRadar/WebAdmin/Settings.html and login as ''admin/PASSWORD''
 
#Click '''Receivers'''
 
#Click '''Receivers'''
 
#Click the green '''Edit''' icon for ''Receiver''
 
#Click the green '''Edit''' icon for ''Receiver''
Line 64: Line 54:
  
 
=Target your Local OSM Tile Server=
 
=Target your Local OSM Tile Server=
#First you'll need to have a local Open Street Maps Tile Server.  You can follow my [[Creating How to Setup an Open Street Map Tile Server under Ubuntu 18.04 in a Proxmox Container|How To]] to make your own.  I'm going to assume that it is locally available at http://map.
+
#First you'll need to have a local Open Street Maps Tile Server.  You can follow my [[How to Setup an Open Street Map Tile Server under Ubuntu 18.04 in a Proxmox Container|How To]] to make your own.  I'm going to assume that it is locally available at http://map.
 
#log in to your Virtual Radar Server
 
#log in to your Virtual Radar Server
##Run ''su - virtradar''
+
##Switch to the VRS user by running <pre>su - virtradar</pre>
##Run ''nano /home/virtradar/.local/share/VirtualRadar/TileServerSettings-Custom.json'' and fill in the file with
+
##Create a custom TileServerSettings file to add your local Tile Server to VRS's drop down list by running <pre>nano /home/virtradar/.local/share/VirtualRadar/TileServerSettings-Custom.json</pre> and fill in the file with <pre>[&#10;  {&#10;    "MapProvider": "Leaflet",&#10;    "DisplayOrder": 1,&#10;    "Name": "Local OSM Tile Server",&#10;    "Url": "http://map/osm/{z}/{x}/{y}.png",&#10;    "Attribution": "http://map/",&#10;    "Subdomains": null,&#10;    "Version": null,&#10;    "MinZoom": null,&#10;    "MaxZoom": 19,&#10;    "ZoomOffset": null,&#10;    "MinNativeZoom": null,&#10;    "MaxNativeZoom": null,&#10;    "ZoomReverse": false,&#10;    "DetectRetina": false,&#10;    "ClassName": null,&#10;    "ExpandoOptions": [],&#10;&#10;    /* New settings from version 2.4.5 onwards: */&#10;    "ErrorTileUrl": null,&#10;    "IsTms": false,&#10;    "IsLayer": false,&#10;    "DefaultBrightness": 70,&#10;    "DefaultOpacity": 100&#10;  }&#10;]</pre> and then save & exit nano by hitting '''Ctrl+C''' and then '''Y'''
<nowiki>
+
##Start your VRS instance by running <pre>cd /home/virtradar/VirtualRadar&#10;mono VirtualRadar.exe -nogui</pre>
[
+
#Visit http://MYSERVER:8080/VirtualRadar/WebAdmin/Settings.html and login as ''admin/PASSWORD''
  {
 
    "MapProvider": "Leaflet",
 
    "DisplayOrder": 1,
 
    "Name": "Local OSM Tile Server",
 
    "Url": "http://map/osm/{z}/{x}/{y}.png",
 
    "Attribution": "http://map/",
 
    "Subdomains": null,
 
    "Version": null,
 
    "MinZoom": null,
 
    "MaxZoom": 19,
 
    "ZoomOffset": null,
 
    "MinNativeZoom": null,
 
    "MaxNativeZoom": null,
 
    "ZoomReverse": false,
 
    "DetectRetina": false,
 
    "ClassName": null,
 
    "ExpandoOptions": [],
 
 
 
    /* New settings from version 2.4.5 onwards: */
 
    "ErrorTileUrl": null,
 
    "IsTms": false,
 
    "IsLayer": false,
 
    "DefaultBrightness": 70,
 
    "DefaultOpacity": 100
 
  }
 
]</nowiki>
 
##exit
 
##Run ''sudo systemctl restart virtualradar''
 
#Visit ''http://MYSERVER:8080/VirtualRadar/WebAdmin/Settings.html'' and login as ''admin/PASSWORD''
 
 
##Click '''Options''' on the left
 
##Click '''Options''' on the left
##Under '''Data Sources''' / '''Map Providers''' click the '''Tile server:''' drop down menu and select "* Local OSM Tile Server"
+
##Under '''Data Sources''' / '''Map Providers''' click the '''Tile server:''' drop down menu and select '''* Local OSM Tile Server'''
 
##Hit the '''Save''' button at the top
 
##Hit the '''Save''' button at the top
  
 
=Setup Debian 9 to start VirtualRadar on Boot=
 
=Setup Debian 9 to start VirtualRadar on Boot=
#Get back to your ''sudo'' user by running "exit"
+
#Get back to your ''sudo'' user by running <pre>exit</pre>
#Run "sudo nano /etc/systemd/system/virtualradar.service" and fill with
+
#Create a new systemd service file by running <pre>sudo nano /etc/systemd/system/virtualradar.service</pre> and filling it in with <pre>Description=Virtual Radar Server ADS-B Plotter&#10;&#10;Wants=network.target&#10;After=syslog.target network-online.target&#10;&#10;[Service]&#10;Type=simple&#10;ExecStart=/usr/bin/mono /home/virtradar/VirtualRadar/VirtualRadar.exe -nogui&#10;Restart=on-failure&#10;RestartSec=10&#10;KillMode=process&#10;User=virtradar&#10;Group=virtradar&#10;&#10;[Install]&#10;WantedBy=multi-user.target</pre>
<nowiki>Description=Virtual Radar Server ADS-B Plotter
+
#Make sure systemd knows about your new file by running <pre>sudo systemctl daemon-reload</pre>
 
+
#Enable your new service by running <pre>sudo systemctl enable virtualradar</pre>
Wants=network.target
+
#Start VRS by running <pre>sudo systemctl start virtualradar</pre>
After=syslog.target network-online.target
+
#Check the status of the VRS service by running <pre>sudo systemctl status virtualradar</pre>
 
+
#Reboot your machine to make sure VRS starts on boot by running <pre>sudo reboot</pre> and visiting http://MYSERVER/
[Service]
 
Type=simple
 
ExecStart=/usr/bin/mono /home/virtradar/VirtualRadar/VirtualRadar.exe -nogui
 
Restart=on-failure
 
RestartSec=10
 
KillMode=process
 
User=virtradar
 
Group=virtradar
 
 
 
[Install]
 
WantedBy=multi-user.target</nowiki>
 
#Run "sudo systemctl daemon-reload"
 
#Run "sudo systemctl enable virtualradar"
 
#Run "sudo systemctl start virtualradar"
 
#Run "sudo systemctl status virtualradar" to check status
 
  
 
[[Category: Linux]]
 
[[Category: Linux]]

Revision as of 12:38, 9 July 2019

Virtual Radar Server allows you to host your own, web based, ADS-B plotter. It will provide a webpage showing the location of, and information on, aircraft that are transmitting ADS-B messages. These messages, of course, have to be received. Luckily this can be accomplished cheaply and easily. Check out some of the following links.

In my case I needed to be able to run the entire thing offline and had access to a pretty expensive uAvionix pingStation. So in this article, we'll be using Virtual Radar Server, a pingStation, a Debian 9 server, and a local Open Street Map tile server.

Prereqs

  1. Log in to your Debian 9 server as a user capable of running the sudo command
  2. Make sure your system is up to date by running
    sudo apt update
    and
    sudo apt upgrade
  3. Install the Apache Web Server and Mono Framework by running
    sudo apt install apache2 mono-complete
    • Note: If you're setting this up on an LXC container you'll get an error with avahi-daemon and libnss-mdns:amd64. This is OK. For our uses, this won't cause any problems.
  4. Create a new user for running Virtual Radar Server by running
    sudo adduser virtradar

Setup Apache2 HTML Forwards

The following actions will allow your users to visit http://MYSERVER and http://MYSERVER/admin to visit the main site and the admin site (respectively).

  1. Delete Apache's default landing page by running
    sudo rm /var/www/html/index.html
  2. Create a new landing page that forwards to the main VRS site by running
    sudo nano /var/www/html/index.html
    and entering the following
    <head>
         <meta http-equiv="refresh" content="0; url=http://MYSERVER:8080/VirtualRadar" />
    </head>
  3. Create a new page to redirect to the VRS admin site by running
    sudo mkdir /var/www/html/admin
    sudo nano /var/www/html/admin/index.html
    and enter the following
    <head>
         <meta http-equiv="refresh" content="0; url=http://MYSERVER:8080/VirtualRadar/WebAdmin" />
    </head>

Setup pingStation

These steps are specific to the uAvionix pingStation. Other ADS-B receivers will setup slightly differently.

  1. visit http://pingstation-abcd (where abcd are the last 4 digits of your pingStation's MAC Address
  2. set Output Formats: to TCP Compressed VR
  3. set TCP Push IP Address or Hostname: to MYSERVER
  4. set TCP Port: to 30003
  5. click Update

Install Virtual Radar Server

  1. Switch to the new virtradar user (starting in their home folder) by running
    su - virtradar
  2. Create a new directory for VRS, and move into it, by running
    mkdir VirtualRadar
    cd VirtualRadar
  3. Download the latest copy of VRS by running
    wget http://www.virtualradarserver.co.uk/Files/VirtualRadar.tar.gz
  4. Extract the contents by running
    tar -xvzf VirtualRadar.tar.gz
  5. Delete the compressed file by running
    rm VirtualRadar.tar.gz
  6. Download the WebAdmin plugin by running
    wget http://www.virtualradarserver.co.uk/Files/VirtualRadar.WebAdminPlugin.tar.gz
  7. Extract the contents by running
    tar -xvzf VirtualRadar.WebAdminPlugin.tar.gz
  8. Delete the compressed file by running
    rm VirtualRadar.WebAdminPlugin.tar.gz
  9. Start VRS and create an Admin User by running
    "mono /home/virtradar/VirtualRadar/VirtualRadar.exe -nogui -createAdmin:admin -password:PASSWORD
    • for subsequent runs use
      mono VirtualRadar.exe -nogui

Configure Virtual Radar Server

  1. Visit http://MYSERVER:8080/VirtualRadar/WebAdmin/Settings.html and login as admin/PASSWORD
  2. Click Receivers
  3. Click the green Edit icon for Receiver
  4. Change Name: to pingStation
  5. Change Format: to Compressed VRS
  6. Change Connection type: to Network
  7. Check Push receiver
  8. Set Port: to 30003
  9. Click the X to exit the Edit screen
  10. Scroll to the top of the Options page and click Save

Target your Local OSM Tile Server

  1. First you'll need to have a local Open Street Maps Tile Server. You can follow my How To to make your own. I'm going to assume that it is locally available at http://map.
  2. log in to your Virtual Radar Server
    1. Switch to the VRS user by running
      su - virtradar
    2. Create a custom TileServerSettings file to add your local Tile Server to VRS's drop down list by running
      nano /home/virtradar/.local/share/VirtualRadar/TileServerSettings-Custom.json
      and fill in the file with
      [
        {
          "MapProvider": "Leaflet",
          "DisplayOrder": 1,
          "Name": "Local OSM Tile Server",
          "Url": "http://map/osm/{z}/{x}/{y}.png",
          "Attribution": "http://map/",
          "Subdomains": null,
          "Version": null,
          "MinZoom": null,
          "MaxZoom": 19,
          "ZoomOffset": null,
          "MinNativeZoom": null,
          "MaxNativeZoom": null,
          "ZoomReverse": false,
          "DetectRetina": false,
          "ClassName": null,
          "ExpandoOptions": [],
      
          /* New settings from version 2.4.5 onwards: */
          "ErrorTileUrl": null,
          "IsTms": false,
          "IsLayer": false,
          "DefaultBrightness": 70,
          "DefaultOpacity": 100
        }
      ]
      and then save & exit nano by hitting Ctrl+C and then Y
    3. Start your VRS instance by running
      cd /home/virtradar/VirtualRadar
      mono VirtualRadar.exe -nogui
  3. Visit http://MYSERVER:8080/VirtualRadar/WebAdmin/Settings.html and login as admin/PASSWORD
    1. Click Options on the left
    2. Under Data Sources / Map Providers click the Tile server: drop down menu and select * Local OSM Tile Server
    3. Hit the Save button at the top

Setup Debian 9 to start VirtualRadar on Boot

  1. Get back to your sudo user by running
    exit
  2. Create a new systemd service file by running
    sudo nano /etc/systemd/system/virtualradar.service
    and filling it in with
    Description=Virtual Radar Server ADS-B Plotter
    
    Wants=network.target
    After=syslog.target network-online.target
    
    [Service]
    Type=simple
    ExecStart=/usr/bin/mono /home/virtradar/VirtualRadar/VirtualRadar.exe -nogui
    Restart=on-failure
    RestartSec=10
    KillMode=process
    User=virtradar
    Group=virtradar
    
    [Install]
    WantedBy=multi-user.target
  3. Make sure systemd knows about your new file by running
    sudo systemctl daemon-reload
  4. Enable your new service by running
    sudo systemctl enable virtualradar
  5. Start VRS by running
    sudo systemctl start virtualradar
  6. Check the status of the VRS service by running
    sudo systemctl status virtualradar
  7. Reboot your machine to make sure VRS starts on boot by running
    sudo reboot
    and visiting http://MYSERVER/