Poor man XPlane Acars (non windows)

This is the place for general questions and discussions.

Moderators: Barry Theodore, Steve Sondheimer

Post Reply
Robert Simac
Member
Posts: 34
Joined: 05-21-2020 08:17 AM
Position: Pilot
Rank: Captain
Hub: KDFW
AAV Total Hours: 925.4
Current Bid: COMPLETED KDFW-KMGM
COMPLETED KMGM-KATL
COMPLETED KATL-KFNT
COMPLETED KFNT-KATL
COMPLETED KATL-KDEN
LOF4635 KDEN-KBIS
SKW4047 KBIS-KMSP
SKW4150 KMSP-KOMA
ENY3563 KOMA-KORD
RPA3729 KORD-KDFW

Poor man XPlane Acars (non windows)

Post by Robert Simac »

Frustrated by the lack of proper acars-like utility for X-Plane on non-windows OS (Linux, other), I devised rudimentary, yet functional python script doing the following:

1. Assuming the vatsim filed flight, it starts by connecting to vatsim server and gathering the current flightplan for selected vatsim ID (see example below)
2. It waits, and at the end of xplane flight, parses the Xplane own Data.txt file (no plugin required, native xplane data), get the rest of the data required for pilot report.
3. TBD: By means of HTTP GET/PUT/whatever, sends the pilot report to the virtual airline of your choice, in any format they like (TBD)

Below is the actual functional example, covering my AAVirtual scheduled flight today. It lacks the step where all of this is sent to my VA. This is the step I may need some help.

I do have internal fsacars (windows utility) data format as it is sent to VA, but unsure of details on what exact is mandatory by server side. If only the basic fields currently present are accepted, that would be sufficient for the start, and much better than current manual web form FREP submitting. This is the truncated fsacars way of pushing the data to virtual airline server:
GET /demo/pirep.php?user=N298A&pass=mypassword&aircraft=Cessna%20172SP%20&lat1=29.991741&lon1=-95.351442&lat2=29.993500&lon2=-95.355030&latland=29.993499&lonland=-95.355085&dateshort=07/06/2020&datestamp=1594079798&timeout=03:
This is the sample run of my script:(Note the sample is running on windows, but the intention is to fill the gap on non windows OS)
C:\Users\user\eclipse_workspace\sandbox\pyacars>c:\mytools\python35\python.exe pyacars.py --vatsimid 904506 --data "f:\SteamLibrary\steamapps\common\X-Plane 11\Data.txt"
2020-07-22 17:23:57,625:INFO: Querying the active vatsim flights at: http://cluster.data.vatsim.net/vatsim-data.txt for Vatsim user ID: 904506
2020-07-22 17:23:57,836:INFO: Found current user vatsim flight: {'': '\n', 'protrevision': '100', 'clienttype': 'PILOT', 'time_logon': '20200722200444', 'transponder': '474', 'planned_destairport_lat': '0', 'planned_destairport': 'KTRI', 'planned_depairport_lon': '0', 'heading': '1', 'planned_revision': '5', 'planned_minenroute': '57', 'time_last_atis_received': '20200722200444', 'planned_tascruise': '467', 'facilitytype': '0', 'planned_deptime': '2015', 'planned_depairport_lat': '0', 'longitude': '-82.40647', 'rating': '1', 'planned_destairport_lon': '0', 'groundspeed': '6', 'planned_aircraft': 'E170/L', 'planned_flighttype': 'I', 'callsign': 'SKW4857', 'planned_hrsfuel': '2', 'latitude': '36.47952', 'planned_depairport': 'KATL', 'planned_altairport': 'KCVG', 'QNH_Mb': '1019', 'planned_remarks': '+VFPS+/V/AAVIRTUAL.COM', 'planned_route': 'SMKEY2 HUCHH SOT HMV', 'frequency': '', 'planned_minfuel': '31', 'planned_actdeptime': '2015', 'QNH_iHg': '30.08', 'realname': 'Robert Simac KRDU', 'atis_message': '', 'planned_altitude': '31000', 'altitude': '1522', 'cid': '904506', 'planned_hrsenroute': '0', 'visualrange': '0', 'server': 'USA-EAST'}
2020-07-22 17:23:57,836:INFO: LINE: SKW4857:904506:Robert Simac KRDU:PILOT::36.47952:-82.40647:1522:6:E170/L:467:KATL:31000:KTRI:USA-EAST:100:1:474:0:0:5:I:2015:2015:0:57:2:31:KCVG:+VFPS+/V/AAVIRTUAL.COM:SMKEY2 HUCHH SOT HMV:0:0:0:0::20200722200444:20200722200444:1:30.08:1019:

Please make sure the X-Plane simulator session is finished. Press Enter to start processing x-plane data file: f:\SteamLibrary\steamapps\common\X-Plane 11\Data.txt
2020-07-22 17:23:59,265:INFO: Processed 478 xplane data records
2020-07-22 17:23:59,265:INFO: Record timestamps: Pushback:842.24194(20:17:53), Takeoff:1992.73364, Landing:4484.98047, Parking:4765.15039(21:23:13)
2020-07-22 17:23:59,265:INFO: PIREP record:
{
"lon1": -84.42335,
"fueldiff": 2861.4477500000003,
"lonland": -82.40546,
"timeoff": "20:37:03",
"landingFPM": -33.71941,
"landingFR": "VFR",
"lat2": 36.47986,
"lat1": 33.64022,
"blocktime": "01:05:22",
"atcdata": "/904506/SKW4857/SKW/E170L",
"callsign": "SKW4857",
"planned_destairport": "KTRI",
"planned_depairport": "KATL",
"atcModel": "E170/L",
"actualNM": 249.9758,
"blockfuel": 2861.4477500000003,
"fuelstop": 5953.87354,
"enroutefuel": 2220.3378900000007,
"datestamp": 1595448284,
"dateshort": "07/22/20",
"landingLBS": 58006.05078,
"latland": 36.47736,
"timoday": "Day",
"aircraft": "E170/L",
"timeon": "21:18:33",
"directNM": 197.19689926191288,
"landingKTS": 137.12988,
"lon2": -82.40644,
"taxifuel": 641.1098599999996,
"timeout": "20:17:53",
"timein": "21:23:13",
"fuelstart": 8815.32129
}
2020-07-22 17:23:59,275:INFO: Appending pirep record to local file: pirep_history.json
2020-07-22 17:23:59,285:INFO: Done with pirep processing.
User avatar
Michael Blakely
Screenshot Contest Winner x7
Screenshot Contest Winner x7
Posts: 3780
Joined: 07-21-2003 01:14 PM
Position: CEO
Rank: Commander
Hub: KDCA
Residence: San Diego (North County)
AAV Total Hours: 3485.5
Previous VA Hours: 0
Current Bid: COMPLETED KJFK-KDFW
COMPLETED KDFW-KIAD
COMPLETED KIAD-KDFW
AAL2248 KDFW-KSFO
ASA915 KSFO-KSEA
ASA672 KSEA-KDEN
AAL2771 KDEN-KORD
AAL1918 KORD-KPHX
AAL1945 KPHX-KDFW
AAL2437 KDFW-KLAX
Contact:

Re: Poor man XPlane Acars (non windows)

Post by Michael Blakely »

Robert,

Wow! Very clever!

When I have some time I'll look at the data format and let you know if it's compatible with our website FSACARS software. Once we make any needed updates, I'll point you to our test server and we'll see if we can get this running.
Mike

Image
Bid Theme: Back in the USA
Image
Post Reply