Jump to content

Acars on Sims other than MSFS/Xplane etc.


Alex

Recommended Posts

Hi All.

I am currently setting up a VA for an airline that runs on a simulator other than msfs or xplane.

It is FlightGear which is a free open source sim.

It's not quite upto all the bells and whistles that the aforementioned sims have, but i want to provide a top notch va for the community there.

FlightGear has its own multiplayer servers and a flight can be tracked via these, so i would like to know if the Acars systems can be adapted to point to servers other than msfs etc?

Where would i begin looking? i have very limited programming skills unfortunately..

Thanks

Alex

Link to comment
Share on other sites

  • Administrators

Is there an ACARS client/can you tell it where to send status updates/PIREPs?

Either case, yes, it would be do-able. You just have to write the module for phpVMS to do it, which is straight-forward for the most part.

Link to comment
Share on other sites

Can you explain to me what you mean by "client", do you mean a program which collects the required data from the Simulator and stores it as an xml file at any given time?

If so not at the moment sofar as i am aware, All the data is there, it's just how do i go about capturing it and posting it?

Link to comment
Share on other sites

  • Administrators

Can you explain to me what you mean by "client", do you mean a program which collects the required data from the Simulator and stores it as an xml file at any given time?

If so not at the moment sofar as i am aware, All the data is there, it's just how do i go about capturing it and posting it?

Yes, exactly. Like kACARS or FSFK which run in the background collecting data from FS and sending it off to phpVMS

Link to comment
Share on other sites

collecting data from FS and sending it off to phpVMS

Thats the part i need the assistance with.

If i had an xml file which had all the required data, what information do i need.

I know these are real newby questions, so please bear with me,(i have never used any MSFS or other flightsim software so it's all new) i'm trying to ask the questions so they make sense. It's always much easier knowing it in your head, but to transpose that onto a forum is much more difficult. :blink:

OK, so my aircraft is online in multiplayer,connected to the FGservers (one of ten).

I need to create a module that would at regular intervals take various parameters (heading,speed,altitdue etc) and update a map, save all that data in an xml file which could then be read and transposed into an automatically generated pirep.

In essence this is what i understand xacars and the others do. Would be easiest to taker an already established module (if licence permitted) and point it to the FGservers to collect the data, or go from scratch.

Thanks for your patience

Alex

Link to comment
Share on other sites

  • Administrators

No prob! :) You essentially need a program running on the pilot's PC, which sends data to a phpVMS module at regular intervals, the module then parses it and through the API, it will update the map.

So essentially, you're sending XML from the program from the app, to a URL, something like:

phpvms.net/action.php/flightgear_acars/

Then a function in there would take the XML send via POST, and parse it out into a data structure like this:

$data = array(
'pilotid'=>$pilotid,
'code'=>$code,
'flightnum'=>$flightnum,
'depicao'=>$depicao,
'arricao'=>$arricao,
'aircraft'=> $aircraft,
'registration'=>(string) $xml->AircraftTailNumber,
'flighttime'=> $flighttime,
'landingrate'=> (string) $xml->ONVS,
'submitdate'=>'NOW()',
'comment'=> trim((string) $xml->COMMENT),
'fuelused'=> (string) $xml->BlockFuel,
'source'=>'fsfk',
'load'=>$load,
'log'=>$log,
'rawdata'=>$rawdata,
);

$ret = ACARSData::FilePIREP($pilotid, $data);

That code is pulled from FSFK, which sends in XML, and then it files the PIREP. The rest is taken care of behind the scenes.

You can probably use an existing ACARS module in bits and pieces (the data structure and API portions), but you'd have to write the 'fill-ins' to the structures to match the data which is being sent to it. They're all different.

Link to comment
Share on other sites

i sort of understand, it's still a way out of my level of understanding really, but i'll see what i can come up with.

checking through the properties of the simulator, i can log flight detail (check a logging box) which at the end of the flight spits out a csv file already.

Logging in FlightGear

---------------------

FlightGear can log any property values at any interval to one or more
CSV files (which can be read and graphed using spreadsheets like
Gnumeric or Excel).  Logging is defined in the '/logging' subbranch of
the main property tree; under '/logging', each '/log' subbranch
defines a separate log with its own output file and interval.  Here is
a simple example that logs the rudder and aileron settings every
second (1000ms) to the file steering.csv, using a comma (the default,
anyway) as the field delimiter:

<PropertyList>
<logging>
 <log>
  <enabled>true</enabled>
  <filename>steering.csv</filename>
  <interval-ms>1000</interval-ms>
  <delimiter>,</delimiter>
  <entry>
   <enabled>true</enabled>
   <title>Rudder</title>
   <property>/controls/flight/rudder</property>
  </entry>
  <entry>
   <enabled>true</enabled>
   <title>Ailerons</title>
   <property>/controls/flight/aileron</property>
  </entry>
 </log>
</logging>
</PropertyList>

Each 'log' subbranch contains a required 'enabled' property, an
optional 'filename' property (defaults to "fg_log.csv"), an optional
'delimiter' property (defaults to a comma), an optional 'interval-ms'
property (defaults to 0, which logs every frame), and a series of
'entry' subbranches.  The 'delimiter' property uses only the first
character of the property value as the delimiter.  Note that the
logger does no escaping, so you must choose a delimiter that will not
appear in the property values (that's not hard, since most of the
values are numeric, but watch for commas in the titles).

Each 'entry' subbranch contains a required 'enabled' property, a
'property' property specifying the name of the property to be logged,
and an optional 'title' property specifying the title to use in the
CSV file (defaults to the full path of the property).  The elapsed
time in milliseconds since the start of the simulation is always
included as the first entry with the title "Time", so there is no need
to include it explicitly.

Here's a sample of the logging output for the above log:

 Time,Rudder,Ailerons
 6522,0.000000,0.000000
 7668,-0.000000,0.000000
 8702,-0.000000,0.000000
 9705,-0.000000,0.000000
 10784,-0.000000,0.000000
 11792,-0.000000,0.000000
 12808,-0.000000,-0.210000
 13826,-0.000000,-0.344000
 14881,-0.000000,-0.066000
 15901,-0.000000,-0.806000
 16943,-0.000000,-0.936000
 17965,-0.000000,-0.534000
 19013,-0.000000,-0.294000
 20044,-0.000000,0.270000
 21090,-0.000000,-1.000000
 22097,-0.000000,-0.168000

Note that the requested interval is only a minimum; most of the time,
the actual interval is slightly longer than the requested one.

The easiest way for an end-user to define logs is to put the log in a
separate XML file (usually under the user's home directory), then
refer to it using the --config option, like this:

 fgfs --config=log-config.xml

The output log files are always relative to the current directory.

Link to comment
Share on other sites

  • Administrators

Looks interesting - you'll have to have it generate a log file with info for a PIREP, it seems like you can generate status reports every few minutes. You'll need a program which is running which picks up the latest status report and sends it off to phpVMS

Link to comment
Share on other sites

OK that helps, it actually updates every 10 ms, so i would need to capture each property that i needed for the pirep, some lets say every 5 seconds such as lat/long/heading and altitude, then have it read static properties like dep icao/arr icao, calculate fuel use etc.

Link to comment
Share on other sites

  • Administrators

OK that helps, it actually updates every 10 ms, so i would need to capture each property that i needed for the pirep, some lets say every 5 seconds such as lat/long/heading and altitude, then have it read static properties like dep icao/arr icao, calculate fuel use etc.

Every 5 seconds is too soon, I would say every 2-5 minutes. Otherwise you'll effectively be DOS'ing your own server

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...