CockpitHardwareHUB_v2 is a free of charge tool designed for cockpit builders to connect hardware to Microsoft Flight Simulator 2020. Unlike other tools that require specific configurations or are limited to certain microcontroller brands, CockpitHardwareHUB_v2 offers flexibility and broad compatibility.
The tool also includes several features that help finding and testing the variables and parameters that are required to let your Home Cockpit Hardware interact with MSFS 2020.
Key Features
- Ability to test variables and parameters before implementing them in your firmware
- Compatibility with any microcontroller providing a serial interface via USB
- USB devices are hot swappable
- Light weight but reliable text-based communication protocol
- Configurations are “pushed” from each device, eliminating extra configuration files
- Ability to debug the interaction between devices and MSFS 2020
Concept
The tool listens for ‘Win32_SerialPort‘ devices and identifies hardware using the PNPDevice string format ‘USB\VID_vvvv&PID_pppp\nnnnnnn‘. The string components include USB indication, VendorID, ProductID, and a unique serial number for each device. The tool allows to filter on specific VID, PID and/or Serial Number.
Registration Process
Devices undergo a registration process involving command-response sequences.
- RESET: Puts device in Registration Mode.
- IDENT: Device responds with DeviceName and ProcessorType.
- REGISTER: Device sends its Property strings.
Properties and Variables
Properties received are added to the Property Pool, becoming Variables registered with MSFS using `SimConnect` and/or the `WASM module`. Properties are identified by a Property Id which is the sequence in which they are sent starting from 1. Variables get their own Variable Id which is managed by CockpitHardwarHUB_v2.
Construction of a Device Property
Device properties follow a specific format, including:
- ValueType: Type of the property’s value.
- RW: Read or Write indication.
- VarType: Type of variable (Simulation, Local, Events, etc.)
- VarName: Name of the variable.
- Index (optional): Additional variable information.
- Unit: (Only for ‘A’ type variables)
Data Exchange
Once Properties are successfully registered and linked with a Variable, data can be exchanged between MSFS and the devices. For efficiency, the 3-digit Property ID is used rather than the full Property string. Each command has the format NNN[=[data]], in which NNN is the Property ID and data the optional data (if the variable requires it), prepended by the ‘=-sign’.
CockpitHardwareHUB_v2 applies restrictions based on ValueType, RW and VarType.
User Interface
The tool assists in developing hardware with features like:
- ‘execute_calculator_code‘: Helps in experimenting with commands.
- ‘Virtual Device‘: Simulates a real USB device for property testing.
- Overview of all registered Variables, and in case of ‘R’ead variables real-time update of the values.
Installation
The GitHub repository contains 2 folders that allow to immediately use the application:
- Executables – Copy this to a folder on your computer
- WASM module – The folder ‘wasimcommander-module’ needs to be copied in the Community folder of MSFS 2020
Credits
CockpitHardwareHUB_v2 is developed by Hans Billiet. The project leverages contributions from Maxim Paperno who is the creator of WASimCommander, and Paul van Dinther for the module SerialPortManager.cs.
CockpitHardwarHUB_v2 uses the WASimCommander WASM module and a slightly adapted version of WASimCommander.WASimClient.dll (v1.2.0.1). Both are included in this repository.
Copyright License and Disclaimer
- Copyright: Hans Billiet; All Rights Reserved.
- Licensed under GNU General Public License GPL v3 or later.
- WASimCommander project is used under the terms of the GPL v3 license
- No warranty for the program’s utility, suitability, or merchantability.