How to setup Virtual Radar Server and pingStation for offline use
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.
- https://www.adsbreceiver.net/
- https://pimylifeup.com/raspberry-pi-ads-b-receiver/
- https://swling.com/blog/2017/03/making-a-flightaware-ads-b-feeder-with-a-raspberry-pi-3-and-rtl-sdr-dongle/
- https://uavionix.com/products/pingstation/
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.
Contents
Prereqs
- Log in to your Debian 9 server as a user capable of running the sudo command
- Make sure your system is up to date by running
sudo apt update
andsudo apt upgrade
- 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.
- 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).
- Delete Apache's default landing page by running
sudo rm /var/www/html/index.html
- 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>
- 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.
- visit http://pingstation-abcd (where abcd are the last 4 digits of your pingStation's MAC Address
- set Output Formats: to TCP Compressed VR
- set TCP Push IP Address or Hostname: to MYSERVER
- set TCP Port: to 30003
- click Update
Install Virtual Radar Server
- Switch to the new virtradar user (starting in their home folder) by running
su - virtradar
- Create a new directory for VRS, and move into it, by running
mkdir VirtualRadar cd VirtualRadar
- Download the latest copy of VRS by running
wget http://www.virtualradarserver.co.uk/Files/VirtualRadar.tar.gz
- Extract the contents by running
tar -xvzf VirtualRadar.tar.gz
- Delete the compressed file by running
rm VirtualRadar.tar.gz
- Download the WebAdmin plugin by running
wget http://www.virtualradarserver.co.uk/Files/VirtualRadar.WebAdminPlugin.tar.gz
- Extract the contents by running
tar -xvzf VirtualRadar.WebAdminPlugin.tar.gz
- Delete the compressed file by running
rm VirtualRadar.WebAdminPlugin.tar.gz
- 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
- for subsequent runs use
Configure Virtual Radar Server
- Visit http://MYSERVER:8080/VirtualRadar/WebAdmin/Settings.html and login as admin/PASSWORD
- Click Receivers
- Click the green Edit icon for Receiver
- Change Name: to pingStation
- Change Format: to Compressed VRS
- Change Connection type: to Network
- Check Push receiver
- Set Port: to 30003
- Click the X to exit the Edit screen
- Scroll to the top of the Options page and click Save
Target your Local OSM Tile Server
- First you'll need to have a local Open Street Maps Tile Server. You can follow my OSM Tile Server 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
- Switch to the VRS user by running
su - virtradar
- 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 - Start your VRS instance by running
cd /home/virtradar/VirtualRadar mono VirtualRadar.exe -nogui
- Switch to the VRS user by running
- Visit http://MYSERVER:8080/VirtualRadar/WebAdmin/Settings.html and login as admin/PASSWORD
- Click Options on the left
- 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
Setup Debian 9 to start VirtualRadar on Boot
- Get back to your sudo user by running
exit
- Create a new systemd service file by running
sudo nano /etc/systemd/system/virtualradar.service
and filling it in withDescription=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
- Make sure systemd knows about your new file by running
sudo systemctl daemon-reload
- Enable your new service by running
sudo systemctl enable virtualradar
- Start VRS by running
sudo systemctl start virtualradar
- Check the status of the VRS service by running
sudo systemctl status virtualradar
- Reboot your machine to make sure VRS starts on boot by running
sudo reboot
and visiting http://MYSERVER/