MSFS to MQTT Bridge is a CLI application that reads data from Microsoft Flight Simulator (MSFS) using FSUIPC and publishes the data to an MQTT broker. This allows you to monitor flight data in real-time using MQTT clients.
- Connects to Microsoft Flight Simulator using FSUIPC
- Reads over 70 data points from the simulator including:
- Flight data (position, altitude, attitude)
- Speed data (ground, true air, indicated air speeds)
- Engine parameters (N1, N2, temperatures, pressures)
- Autopilot settings
- Aircraft controls and surfaces
- Environment data
- Navigation systems
- Fuel systems
- Publishes data to any MQTT broker
- Uses efficient memory block reading to optimize performance
- Error recovery and reconnection logic
- Microsoft Flight Simulator: MSFS 2020 or MSFS 2024
- FSUIPC7: Required to access flight simulator data. Check out Pete & John Dowson's Software page for more information.
- Purchase from SimMarket
- A registered version is recommended, but the free version works for many data points
- .NET 8.0 SDK: Required to build and run MSFS2MQTT
- MQTT Broker: Required to receive and distribute data
- Purchase and download FSUIPC7 for MSFS 2020/2024
- Install FSUIPC following the instructions provided
- Register FSUIPC if you purchased a license
- Launch Microsoft Flight Simulator
- Press Ctrl+F to open the FSUIPC configuration window
- Ensure FSUIPC is working correctly
- Download and install Mosquitto
- Create or edit the
mosquitto.conffile to configure access:
listener 1883
allow_anonymous true
- Start the Mosquitto broker:
mosquitto -c mosquitto.conf
- Download and install HiveMQ broker
- Start HiveMQ according to its documentation
- Access the web UI at http://localhost:8080 (default)
- Clone the repository:
git clone https://github.com/bendechrai/msfs2mqtt.git
cd msfs2mqtt
- Build the project:
dotnet build
- Configure MQTT connection:
Modify the AppSettings.cs file in the Configuration folder to match your MQTT broker settings:
public MQTTSettings MQTTSettings { get; } = new MQTTSettings
{
BrokerAddress = "localhost", // Change to your MQTT broker address
BrokerPort = 1883, // Change to your MQTT broker port
ClientId = "MSFS2MQTT",
TopicPrefix = "msfs/" // Change to your preferred topic prefix
};- Run the application:
dotnet run
- Start Microsoft Flight Simulator
- Start a flight or use an existing save
- Run MSFS2MQTT
- Verify you see "Connected to FSUIPC!" and "Connected to MQTT broker!" messages
- Use an MQTT client to subscribe to the topics and verify data is being published
- Download and install MQTT Explorer
- Connect to your MQTT broker
- Move controls in the simulator and observe the data changes in real-time
- Ensure Microsoft Flight Simulator is running before starting MSFS2MQTT
- Check that FSUIPC7 is correctly installed and registered
- Try restarting both MSFS and MSFS2MQTT
- Verify your MQTT broker is running (
netstat -an | findstr 1883on Windows) - Check firewall settings if connecting to a remote broker
- Ensure broker credentials are correct if authentication is required
Error reading FSUIPC data: Check FSUIPC installation and ensure MSFS is runningMQTT client not connected: Check MQTT broker status and connection settingsError extracting data from block: This might indicate FSUIPC version incompatibility
This application uses an efficient approach to reading data from FSUIPC by using memory blocks instead of individual offsets. This reduces overhead and improves performance.
- Single Responsibility: Each extractor is responsible for processing data from exactly one memory block
- Clear Boundaries: Memory blocks are defined to align with logical groupings of simulator data
- Separation of Concerns: Data extraction is separated from data publishing
- MSFS2MQTT connects to FSUIPC to access simulator data
- Data is read in efficient memory blocks
- Specialized extractors process each data type from its designated memory block
- Data is published to MQTT topics
- MQTT clients (like Telegraf) can subscribe to these topics
The bridge extracts the following categories of data:
- Flight Data: Position, altitude, attitude
- Speed Data: Ground speed, true/indicated airspeeds, vertical speed
- Engine Data: N1/N2, temperatures, pressures, fuel flow
- Controls: Trim, flaps, gear, spoilers
- Autopilot: Modes, settings, targets
- Environment: Atmospheric conditions, warnings
- Lights: Aircraft lighting systems
- Navigation: VOR, ILS, and radio data
- Fuel: Quantities and consumption
- FSUIPC Reference - Technical details about FSUIPC offsets and data formats
- InfluxDB Integration - Instructions for sending data to InfluxDB
Contributions are welcome! Feel free to submit pull requests or open issues for bugs and feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.