Assistance Setting up Aircraft List JSON

Are you having problems with using or developing a plugin? Let me know here.
jtr
Posts: 1
Joined: Fri Sep 30, 2016 9:32 pm

Assistance Setting up Aircraft List JSON

Postby jtr » Fri Sep 30, 2016 10:14 pm

Hello and thank you for creating and distributing this fantastic project. I'm not sure if my question belongs in the plugin forum so please excuse me if it's misplaced. After reading through the documentation over the past few days I'm stuck trying to figure something out. :?:

My end goal is to take a data feed of pre-processed aircraft positions I have access to, store them locally and serve it over my local network to VRS to monitor aircraft activity at an airport. I already have my feed running (which is not in any of the other standard formats as it's already been processed) and it provides much of the data that Aircraft List JSON is looking for.

So if I want to setup my data in VRS using "Aircraft List (JSON)", my understanding (if it's correct) is that I'll need to setup my web server to respond to VRS requests, take any new data I've stored locally, and serve up a JSON file, correct? I'd really like to replicate what http://www.adsbexchange.com/data/ is doing but on a much smaller scale as my data feed just has data near a local airport.

So far, I've set up a local Apache server that I can connect to in VRS (localhost:port) and have a VirtualRadar directory setup for the AircraftList.json file, but I'm not sure what's next. With my programming (scripting) experience but no experience working with GET and POST methods, are you able to steer me in the right direction? Specifically, how and what do I create (and where) for my server to accomplish this? I came across another discussion (viewtopic.php?t=941#p4729) that seems like it might be similar to what I'm trying to do by referring to the source code, but I'm just not sure.

Thank you for any guidance you can provide.

FYI-my server is set up on Mac OS since that's where I process the data, but I'm open to moving it to Windows if needed.

agw
Posts: 1896
Joined: Fri Feb 17, 2012 3:20 am

Re: Assistance Setting up Aircraft List JSON

Postby agw » Sun Oct 02, 2016 11:24 pm

The aircraft list JSON format is basically a cut-down version of the AircraftList.json file that is sent by VRS to the browser. You can see the format if you have a working copy of VRS running, configure up an AircraftList (JSON) format rebroadcast server and then connect to it in the browser. Here's an example I've just tried but I've cut it down to just two aircraft:

Code: Select all

{
   "acList": [{
      "Icao": "400025",
      "Alt": 24475,
      "GAlt": 24475,
      "AltT": 0,
      "Call": "TEST1234",
      "Tisb": false,
      "TrkH": false,
      "Sqk": "0644",
      "Help": false,
      "VsiT": 0,
      "Gnd": false,
      "SpdTyp": 0,
      "CallSus": false,
      "Trt": 1
   },
   {
      "Icao": "49528A",
      "Alt": 17375,
      "GAlt": 17632,
      "InHg": 30.177166,
      "AltT": 0,
      "Call": "TAP362",
      "Lat": 50.813118,
      "Long": -1.117325,
      "Mlat": false,
      "Tisb": false,
      "Spd": 357.0,
      "Trak": 39.9,
      "TrkH": false,
      "Sqk": "7473",
      "Help": false,
      "Vsi": -1472,
      "VsiT": 0,
      "Gnd": false,
      "SpdTyp": 0,
      "CallSus": false,
      "Trt": 2
   }]
}


The documentation for the full AircraftList.json format is here (scroll down to Response):

http://www.virtualradarserver.co.uk/Documentation/Formats/AircraftList.aspx

You'll see that the JSON in the feed is a subset of the full version - at the top level you just have acList and then each aircraft just has fields for values that came from the aircraft.

When VRS produces the feed it sends all of the fields for all of the aircraft that are being tracked and then after that it only sends values that have changed (with some exceptions - e.g. if the latitude changes then both the latitude and longitude are sent, even if the longitude has not changed, and the ICAO is also always sent). You will be fine if you want to keep things simple and just send everything on each transmission.

However, the connection that VRS makes to pull an Aircraft List (JSON) feed from a remote server is just a simple socket connection. It does not use HTTP so I don't think that Apache will respond to it. I don't know enough about Apache to know whether it's possible to have it act as some kind of socket server.

Another approach you could look at taking is to extend your program that pulls together your feed and add support for the BaseStation format to it. BaseStation format is pretty simple, it's a text format with lines of comma-separated values. VRS could then connect directly to your program and pull the feed from there. There's some documentation on the feed format here:

http://woodair.net/sbs/Article/Barebone ... t_Data.htm

and this is a sample of a BaseStation feed from my machine:

Code: Select all

MSG,5,0,0,4CA373,0,2016/10/02,23:20:12.523,2016/10/02,23:20:12.523,,38000,,,,,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:12.523,2016/10/02,23:20:12.523,,38000,,,,,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:12.523,2016/10/02,23:20:12.523,,38000,,,,,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:12.523,2016/10/02,23:20:12.523,,38000,,,,,,,0,,0,0
MSG,6,0,0,4CA373,0,2016/10/02,23:20:12.738,2016/10/02,23:20:12.738,,,,,,,,5305,0,0,0,0
MSG,6,0,0,4CA373,0,2016/10/02,23:20:12.738,2016/10/02,23:20:12.738,,,,,,,,5305,0,0,0,0
MSG,6,0,0,4CA373,0,2016/10/02,23:20:12.738,2016/10/02,23:20:12.738,,,,,,,,5305,0,0,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:12.738,2016/10/02,23:20:12.738,,38000,,,,,,,0,,0,0
MSG,3,0,0,A63E62,0,2016/10/02,23:20:12.738,2016/10/02,23:20:12.738,,18000,,,51.469923,-1.311798,,,0,,0,0
MSG,8,0,0,A63E62,0,2016/10/02,23:20:12.940,2016/10/02,23:20:12.940,,,,,,,,,,,,0
MSG,1,0,0,4CA373,0,2016/10/02,23:20:13.133,2016/10/02,23:20:13.133,RYR67JU,,,,,,,,,,,0
MSG,3,0,0,4CA373,0,2016/10/02,23:20:13.133,2016/10/02,23:20:13.133,,38000,,,51.40947,-1.325189,,,0,,0,0
MSG,4,0,0,4CA373,0,2016/10/02,23:20:13.336,2016/10/02,23:20:13.336,,,404.6,354.9,,,0,,,,,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:13.336,2016/10/02,23:20:13.336,,38000,,,,,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:13.336,2016/10/02,23:20:13.336,,38000,,,,,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:13.337,2016/10/02,23:20:13.337,,38000,,,,,,,0,,0,0
MSG,1,0,0,A63E62,0,2016/10/02,23:20:13.754,2016/10/02,23:20:13.754,N501HM,,,,,,,,,,,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:13.754,2016/10/02,23:20:13.754,,38000,,,,,,,0,,0,0
MSG,5,0,0,A63E62,0,2016/10/02,23:20:13.948,2016/10/02,23:20:13.948,,18000,,,,,,,0,,0,0
MSG,6,0,0,A63E62,0,2016/10/02,23:20:13.948,2016/10/02,23:20:13.948,,,,,,,,5402,0,0,0,0
MSG,5,0,0,A63E62,0,2016/10/02,23:20:13.948,2016/10/02,23:20:13.948,,18000,,,,,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:13.948,2016/10/02,23:20:13.948,,38000,,,,,,,0,,0,0
MSG,6,0,0,A63E62,0,2016/10/02,23:20:13.948,2016/10/02,23:20:13.948,,,,,,,,5402,0,0,0,0
MSG,8,0,0,A63E62,0,2016/10/02,23:20:13.948,2016/10/02,23:20:13.948,,,,,,,,,,,,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:14.148,2016/10/02,23:20:14.148,,38000,,,,,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:14.148,2016/10/02,23:20:14.148,,38000,,,,,,,0,,0,0
MSG,6,0,0,4CA373,0,2016/10/02,23:20:14.148,2016/10/02,23:20:14.148,,,,,,,,5305,0,0,0,0
MSG,6,0,0,4CA373,0,2016/10/02,23:20:14.148,2016/10/02,23:20:14.148,,,,,,,,5305,0,0,0,0
MSG,4,0,0,400FDF,0,2016/10/02,23:20:14.148,2016/10/02,23:20:14.148,,,266.9,355.3,,,-1344,,,,,0
MSG,5,0,0,A63E62,0,2016/10/02,23:20:14.352,2016/10/02,23:20:14.352,,18000,,,,,,,0,,0,0
MSG,4,0,0,4CA373,0,2016/10/02,23:20:14.352,2016/10/02,23:20:14.352,,,404.7,354.8,,,64,,,,,0
MSG,5,0,0,A63E62,0,2016/10/02,23:20:14.352,2016/10/02,23:20:14.352,,18000,,,,,,,0,,0,0
MSG,5,0,0,A63E62,0,2016/10/02,23:20:14.563,2016/10/02,23:20:14.563,,18000,,,,,,,0,,0,0
MSG,8,0,0,4CA373,0,2016/10/02,23:20:14.563,2016/10/02,23:20:14.563,,,,,,,,,,,,0
MSG,6,0,0,A63E62,0,2016/10/02,23:20:14.563,2016/10/02,23:20:14.563,,,,,,,,5402,0,0,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:14.563,2016/10/02,23:20:14.563,,38000,,,,,,,0,,0,0
MSG,5,0,0,A63E62,0,2016/10/02,23:20:14.563,2016/10/02,23:20:14.563,,18000,,,,,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:14.563,2016/10/02,23:20:14.563,,38000,,,,,,,0,,0,0
MSG,5,0,0,400FDF,0,2016/10/02,23:20:14.758,2016/10/02,23:20:14.758,,16050,,,,,,,0,,0,0
MSG,4,0,0,A63E62,0,2016/10/02,23:20:14.758,2016/10/02,23:20:14.758,,,395.7,68.8,,,-64,,,,,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:14.758,2016/10/02,23:20:14.758,,38000,,,,,,,0,,0,0
MSG,3,0,0,A63E62,0,2016/10/02,23:20:14.758,2016/10/02,23:20:14.758,,18000,,,51.47118,-1.306458,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:14.758,2016/10/02,23:20:14.758,,38000,,,,,,,0,,0,0
MSG,5,0,0,4CA373,0,2016/10/02,23:20:14.758,2016/10/02,23:20:14.758,,38000,,,,,,,0,,0,0


If you want to see some code that formats up a BaseStation feed then you can take a look at the "ToBaseStationString" function in BaseStationMessage in VRS:

https://github.com/vradarserver/vrs/blob/master/VirtualRadar.Interface/BaseStation/BaseStationMessage.cs

Skibox
Posts: 114
Joined: Mon Apr 07, 2014 7:06 pm
Location: ESGG

Re: Assistance Setting up Aircraft List JSON

Postby Skibox » Mon Oct 02, 2017 1:16 pm

I'm bulding a feeder client that sends data to VRS using JSON.

agw wrote:The aircraft list JSON format is basically a cut-down version of the AircraftList.json file that is sent by VRS to the browser.


How cut-down is it? Is there a list of which parameters VRS can read on a receiver using JSON format?

I got most of it working, but trying to send altitude using "GAlt" parameter doesn't seem to work. Using "Alt" works fine, but I have the AMSL altitude...


BR
/M

agw
Posts: 1896
Joined: Fri Feb 17, 2012 3:20 am

Re: Assistance Setting up Aircraft List JSON

Postby agw » Sun Oct 15, 2017 2:47 pm

The fields that are sent are:

Air pressure
Altitude
Altitude type
Callsign
Ground speed
Emergency
Geometric altitude
Icao24
Is TisB
Latitude
Longitude
On Ground
Position is MLAT
Signal level
Speed type
Squawk
Target altitude
Target track
Track
Track is heading
Vertical rate

So geometric altitude should work - but I suspect you might not be setting the altitude type, in which case it'll default to using Altitude. The altitude type is the AltT parameter, set it to 1 for GAlt.

Skibox
Posts: 114
Joined: Mon Apr 07, 2014 7:06 pm
Location: ESGG

Re: Assistance Setting up Aircraft List JSON

Postby Skibox » Fri Oct 27, 2017 4:38 pm

agw wrote:So geometric altitude should work - but I suspect you might not be setting the altitude type, in which case it'll default to using Altitude. The altitude type is the AltT parameter, set it to 1 for GAlt.


Thanks for the tip, hadn't tried the AltT field.

But, it still does not accept the GAlt parameter, regardless of what I set the AltT to. It does however work if I use "Alt" and "AltT": "1", then it is imported as Geometric altitude.


So, if I send this into VRS it does work :

"Icao": 265582,
"Alt": 159,
"AltT": "1",
"Call": "SE JRI",
"Lat": 58.225362,
"Long": 17.01773,
"Spd": 24,
"Trak": 56,
"Trt": 0


.... Except it does not read the Trt, Transponder type value.

It would be great to be able to send this, and I also propose 2/3 new definitions of transponder types;

9: AIS
8: JAERO

maybe 7: APRS ?



BR

/M


Return to “Plugins”

Who is online

Users browsing this forum: No registered users and 2 guests