AFS4 - XCSoar Integration (Windows)

  • Hi everyone,

    I'm happy to share a tool I've been working on: AFS4 XCSoar Bridge — a bridge that connects Aerofly FS4 to XCSoar, the open-source glide computer used by real-world glider pilots.

    For the moment it only works with glider self launch or starting a flight in the air - sim limitation.

    If you enjoy soaring in AFS4, this gives you a fully functional glide computer running alongside the simulator with real-time data: vario, barometric altitude, moving map, thermal mapping, task planning, and everything else XCSoar offers.

    How it works:
    - The bridge reads AFS4's UDP broadcast data (ForeFlight protocol)
    - Converts it to standard NMEA sentences (the same format real GPS devices use)
    - Serves the data via TCP so XCSoar can connect and use it

    What XCSoar gets from AFS4:
    - GPS position, altitude, and ground speed
    - True heading
    - Barometric altitude
    - Calculated vario (vertical speed) with smoothing
    - 30-second average vario

    Features:
    - Simple GUI showing connection status and live flight data
    - Standalone Windows executable — no Python installation needed
    - Also works from the command line for advanced users
    - Zero configuration needed on the AFS4 side (just enable UDP broadcast)
    - Works on the same computer or across the network (e.g., XCSoar on a tablet)

    Quick setup:

    1. In AFS4: Settings > Miscellaneous > Enable "Broadcast flight info to IP address" (port 49002)
    2. Download and run AFS4-XCSoar-Bridge.exe, click Start
    3. In XCSoar (must be in FLY mode, not SIM): Config > Devices > Add device:
    - Port: TCP Client
    - IP: 127.0.0.1
    - TCP Port: 4353
    - Driver: Generic

    That's it — XCSoar will show your position, altitude, vario, and start mapping thermals.

    Important note: XCSoar must be set to FLY mode (not SIM). In SIM mode, XCSoar disables all network device ports.

    Download:
    GitHub: https://github.com/jlgabriel/afs4-xcsoar-integration
    Direct download (Windows exe): https://github.com/jlgabriel/afs4…ases/tag/v1.0.0

    The project is open source (MIT license). Feedback, suggestions, and contributions are welcome!

    Future plans include a version that connects through the Aerofly Bridge DLL for access to more flight data (airspeed, pressure, and more).

  • The code is very clean and well structured, Anthropic Claude did a great work refactoring it and completing this work I have done last year.

    Next version will use the integration DLL to try to access more variables from our sim.

    The idea is that it will use the DLL if it is available, and as a fallback it will use the UDP data if the DLL is not installed.

    Best regards, Juan

  • Ok, new experimental version 2, added, I hope someone who knows how to use XCSoar could test it.

    Release v2.0.0 — DLL Integration: Direct Vario, IAS/TAS & Wind for XCSoar · jlgabriel/afs4-xcsoar-integration
    What's New This release adds direct integration with Aerofly FS4 via the AeroflyReader DLL, providing high-quality flight data to XCSoar at 50-60Hz — no more…
    github.com

    ## What's New

    This release adds direct integration with Aerofly FS4 via the AeroflyReader DLL,
    providing high-quality flight data to XCSoar at 50-60Hz — no more calculated vario lag.

    ### DLL Shared Memory Support

    The bridge now reads flight data directly from the AeroflyReader DLL shared memory,
    bypassing the UDP protocol limitations. When the DLL is detected, data quality
    improves dramatically. UDP remains as automatic fallback if the DLL is not available.

    ### New Data Available (DLL mode)

    - Direct vario — Instant vertical speed from the simulator at 50Hz, no smoothing lag
    - IAS / TAS — Indicated airspeed from AFS4 + True airspeed calculated via ISA atmosphere model
    - Wind direction & speed — Real wind vector from the simulator engine
    - $LXWP0 NMEA sentence — Condor3-compatible format that XCSoar parses for vario, TAS, and wind

    ### Technical Details

    - AFS4 DLL vectors are in ECEF (Earth-Centered Earth-Fixed) coordinates — the bridge
    projects them to the local East-North-Up frame using the aircraft's lat/lon
    - Heading is converted from AFS4's math convention (CCW from East) to standard
    navigation convention (CW from North)
    - TAS conversion uses the full ISA standard atmosphere model, accurate up to 11,000m

    ## Installation

    1. Extract `AeroflyReader.dll` to: `%USERPROFILE%\Documents\Aerofly FS 4\external_dll\`
    2. Run `AFS4-XCSoar-Bridge.exe` (standalone, no Python needed)
    3. Start Aerofly FS4 and load a flight
    4. In XCSoar: Config > Devices > TCP Client, 127.0.0.1:4353, Driver: Condor3
    5. XCSoar must be in FLY mode (not SIM)

    The DLL is the simplified read-only version from the:
    Aerofly-FS4-Bridge: https://github.com/jlgabriel/Aero…main/simplified project (v1.1.0).
    It only reads data from the simulator — it does not send commands or modify the flight.

    ## What's Included in the dist.zip file

    `AFS4-XCSoar-Bridge.exe` | Standalone bridge application (no Python required)
    `AeroflyReader.dll` | AFS4 read-only DLL (install in AFS4 external_dll folder)

    ## XCSoar Driver Selection

    | Driver | When to Use |
    | Condor3 | Recommended with DLL — gets TAS, direct vario, and wind via $LXWP0 |
    | Generic | Basic mode — works with and without DLL |

    Best regards, Juan

  • Excellent work, I am planning on building an Airline ACARS/ Flight data monitoring FOQA tool. Does the simplified DLL cover most things? Not sure if I should go with the main FS4 bridge. I will start reading all the documentation over easter.

    Initially, it will just monitor landing data, and stable approach criteria (1000ft, engines spooled, at or near Vref, decent rate within limits)

  • Hi 777Driver , here there it is the answer from our expert, Claude Opus 4.6. If some of these parameters are missing in the actual DLL, it would be possible to do a custom DLL using some aircrafts specific variables.

    I would recommend you starting to play with the DLL and the sample files. If you work with Claude Code, Codex, Cursor or similar, it would be easy to clone the DLL project and do a modified DLL for your custom needs (aircrafts have a lot of variables not included in the DLL).

    For an ACARS/FOQA stable approach monitor you'll want the full AeroflyBridge DLL. The simplified version covers basic telemetry (position, IAS, altitude, vario) but lacks several variables critical for approach monitoring:

    • Engine rotation speeds (EngineRotationSpeed1-4) — needed to verify engines spooled. Simplified only has a boolean running flag.
    • 4-engine support — simplified only exposes 2 engines, the full bridge has all 4 (important for the A350!).
    • Radar altitude — for the 1000ft gate check.
    • VAPP speed — for Vref comparison. Simplified has VS0/VS1/VFE but not VAPP.
    • ILS course data, autobrake state, spoiler position, on-runway flag — all full bridge only.

    The full bridge also supports bidirectional control (TCP commands), which could be useful if you later want to trigger warnings or interact with aircraft systems.

    Both DLLs expose data via shared memory and TCP, so the integration approach is similar — just more variables available with the full bridge.

    Best regards, Juan

    Edited once, last by Jugac64 (April 2, 2026 at 3:40 AM).

  • Hi 777Driver , here there it is the answer from our expert, Claude Opus 4.6. If some of these parameters are missing in the actual DLL, it would be possible to do a custom DLL using some aircrafts specific variables.

    I would recommend you starting to play with the DLL and the sample files. If you work with Claude Code, Codex, Cursor or similar, it would be easy to clone the DLL project and do a modified DLL for your custom needs (aircrafts have a lot of variables not included in the DLL).

    For an ACARS/FOQA stable approach monitor you'll want the full AeroflyBridge DLL. The simplified version covers basic telemetry (position, IAS, altitude, vario) but lacks several variables critical for approach monitoring:

    • Engine rotation speeds (EngineRotationSpeed1-4) — needed to verify engines spooled. Simplified only has a boolean running flag.
    • 4-engine support — simplified only exposes 2 engines, the full bridge has all 4 (important for the A350!).
    • Radar altitude — for the 1000ft gate check.
    • VAPP speed — for Vref comparison. Simplified has VS0/VS1/VFE but not VAPP.
    • ILS course data, autobrake state, spoiler position, on-runway flag — all full bridge only.

    The full bridge also supports bidirectional control (TCP commands), which could be useful if you later want to trigger warnings or interact with aircraft systems.

    Both DLLs expose data via shared memory and TCP, so the integration approach is similar — just more variables available with the full bridge.

    I've installed the full DLL, it looks like a lot of parameters are logged. I've created a small PowerShell script to read the basics

  • This is brilliant! I've been away from Aerofly for a while, but it'll definitely test this as soon as I have a chance. Thank you!

    Interestingly, SeeYou navigator used to be my moving map of choice, but last season I moved to XCsoar mainly for the airspace side view. I find it super intuitive.

  • I had a play yesterday and it works really well. Thanks again for doing this!

    Aerofly does something funny with the windows and it's hard to use the mouse to control of the XCsoar window, but nothing to do with your DLL, just the way Aerofly takes over! Easy enough to control XCsoar with the arrow keys anyway.

    I'll do more testing this week. But it's such a nice feature having this in the game

  • Thank you Captain for the tests! any feedback will be appreciated, I hope we can improve it.

    If you could share how you configure the AFS4 gliders in XCsoar or SeeYou Navigator it would be great. Do you select the glider model, modify any parameters in the apps?

    Best regards, Juan

  • Yes, you can add different gliders, and select the right one before the flight, so the polar and final glide calculations match the glider.

    On XCsoar:

    1- Draw a V on the screen to bring up the menu
    2- Config
    3- Plane
    4- New, Edit etc

    XCsoar has a library of most gliders, so it's easy to pick the right one