In the beginning of 2022, I wrote a tutorial on how to develop your own implementation to connect with SimConnect and WASM using Visual Studio 2019. I wrote this tutorial because I had to spend a lot of time to find decent documentation about the topic, so why not share my findings with the community. For people that have no experience with SimConnect and WASM, I strongly recommend to read this post first.
I have now used the basics of that tutorial to develop a complete new tool that allows to easily connect hardware that supports Serial USB (example: Arduino) with MSFS2020. In the meantime, I’m using Visual Studio 2022 as well. You can find the tool on GitHub here. In the following weeks, I will explain all the details in several chapters as I did in the previous post.
EDIT 21/Jan/2024:
In the meantime, a new and better version CockpitHardwareHUB_v2 is released on GitHub. This version is a complete rewrite of the first version, and a lot more rubust. Devices that are working with the first version will work with this new version, as the protocol and concepts haven’t changed. This new version uses a different WASM module (WASimCommander developped by mpaperno). A folder with all executables can be found in the repository. And this time, the GitHub repository also contains a full user manual that explains the protocol.
I decided to put this post in the “Home Cockpit Builders” section of this forum, because that is definitely the target audience. My own goal is to build my own A320 cockpit, and I will use this tool to connect with MSFS2000, so I think that this section is the best fit.
The tool is also not ready. Currently it supports A-vars, L-vars and K-vars, but will be expanded in the future for other types of variables.
Some people might wonder: “Why do we need another tool? There are already many (free) tools such as MobiFlight.” Well, there are a few reasons why I developed my own tool. First of all, because writing software is part of my hobby. Secondly, tools like MobiFlight are great because you don’t have to know anything about writing code yourself, but that is also the limitation. Although these tools have a massive amount of possibilities, you always will have to stick to the concepts provided in such tool. My tool just provides some basic communication protocol between a Serial USB device and MSFS2020, and some methods to define the variables you want to control. But you have to write your own code to use it. It means that you are also not limited to Arduino - in fact, I’m using PIC Microcontrollers to develop my own hardware. So basically, my tool is meant for a different public, but at the end it’s all with the same goal in connecting buttons, rotary encoders, LED’s, LCD displays, etc… to MSFS2020.
On GitHub, I have provided 2 extra folders in the repository.
- Executables: In my previous post I had the question to provide at least one version of executables that can be used immediatly, without having to setup the whole enviornment in Visual Studio. The Executables contain both the WASM-module and the tool itself. The folder WASM_HABI needs to be copied in the MSFS Community folder before starting MSFS2020. In my previous tutorial, I explain how you can find this Community folder. Look here, and search for “Use our first WASM module”. Do not create the folder, but copy the folder “WASM_HABI” from the Executables in the Community folder. The other files “CockpitHardwareHUB.exe, Microsoft.FlightSimulator.SimConnect.dll and SimConnect.dll” need to be copied in a folder on your computer. The tool can then be launched by starting “CockpitHardwareHUB.exe”.
- ArduinoExample: This is some example code that can be used on an Arduino Mega 2560. I might provide the schematic of this example later in this post. It’s uses the FlyByWire A32NX (my favorite!), and allows controlling the EFIS Left CSTR and WPT (PushButton and LED) and shows the HDG on an 7-Segment Display together with a Rotary Encoder to change the value.
Finally, please be aware that I’m not a professional Software Developer. I’m sure that the coding style can be improved, and that I might not use all the wistles and bells that the C# and C++ language provide. Do not hesitate to suggest improvements, give comments or make recommendations in this post. Although, be aware that this is not a C# or C++ forum.