Simconnect on 2nd PC (network setup)

Hello!
I searched this forum and also others but I did not find a short description or suitable hints to my question.

I always use 2 PCs, one for the flightsim itself, the second for nav tools, like LittleNavmap or Navigraph Chars. Both tools have their own software to connect inbetween the PCs (e.g. Littlenavconnect).

Is it possible to start other tools, like NeoFly and to somehow set up the simconnect over network by myself?

In the past with FS9/FSX I used FSUIPC + WideFS.
But how can I enable the network communication of simconnect from a 2nd PC to my MSFS PC?

Thank you for helpful hints,
Carsten

Yes. I use LittleNavMap on a second computer using Littlenavconnect. It was a little tricky to set up but it works well. Go to their website for full details. You don’t need FSUIPC + WideFS.

I don’t know about NeoFly.

Thank you @scanham!

I already use Littlenavmap & Littlenavconnect and it works good on 2nd PC.
Also Navigraph with its own Simlink software works on the 2nd PC.

But I am looking for a solution to have simconnect running on a 2nd PC with a connection to the MSFS PC so I can run Tools on the second PC which do not have their own network bridge solution.

Neofly is just the first software I use without its own simmconnect network solution.

What type of tools are you looking to use on the second PC? Those that already use SimConnect or tools you want to build/write yourself?

If it’s the latter, I’m in the process of developing an API (Open Source) to provide basic SimConnect access to a remote PC via its own protocol.

At present, it allows network connections to request a SimVar, which is then transmitted back to the client whenever that SimVar value changes (until the client disconnects).

The first (Alpha) release is now available in GitHub, details are posted here.

If your tool/tools are already designed to use SimConnect natively, you can try modifying the tools SimConnect.cfg file, to point to the MSFS PC (and open the SimConnect port on your firewall for the MSFS PC, otherwise your connections are going to fail).

There has been limited success using SimConnect over a network, but from other posts, it is possible. There’s just not much documentation about it.

Hello @Dragonlaird!

My use-case is to run a software, like Neofly or SPAD.Next, on a 2nd PC other then my MSFS PC.
In the past I used FSUIPC/WideFS for moving software to other PCs, like Go-fligth or some flightplanning software.

Nowadays it seems that each tool-developer himself must implement a solution for network traffic to get data exchange with MSFS running over network.

I am looking for a software to do the following:

PC1: MSFS → Tool with Simconnect.DLL
→ network connection →
PC2: Software simulating MSFS Simmconnect API → Some Community Tool using Simconnect.DLL

Littenavconnect is doing this but only for Littlenavmap. I am looking for an all-purpose tool to move more software from my MSFS PC to my 2nd PC…

Hi @Buntstift68 ,

I’ve not fully tested this personally but SimConnect does support connecting to MSFS running on another PC, via a network.

First, find the external IP address of the MSFS2020 PC.

To do this, open a Command Prompt (on the MSFS2020 PC, obviously) and type:

IPCONFIG

You’re looking for the IPv4 Address, it will likely start with “192.168.”

Whilst on the MSFS2020 PC, we need to find the correct port number SimConnect should use. The default is 500, but we can double-check.

In the Command Prompt, change to the install folder of MSFS2020, if you installed it via Steam, it will be in your Steam Library, usually in a folder like:

\SteamLibrary\steamapps\common\MicrosoftFlightSimulator

Now we’ll check to see if you have a SimConnect.xml file, this is the config file used by the SimConnect server. In the Command Prompt window, type:

DIR SimConnect.xml /s

If no files are found, you’re using the standard port (500), if a file exists, open it with your text editor to find which port your network connection is listening on.

On the PC running the tool/component you want to run remotely, in the application folder, you should find the SimConnect.dll. You may also find a SimConnect.cfg file. If not, create a new config file “SimConnect.cfg”.

In the config file, enter/update the following:

[simConnect]
Protocol=IPv4
Address=<MSFS2020 IP Address from above>
Port=<Port Number from above>
MaxReceiveSize=4096
DisableNagle=0

Replace the Address and Port values with the external IP address and port number of the PC running MSFS2020.

We’re not completely finished, you also need to ensure the firewall on your MSFS2020 PC allows connections to the port above, I can’t help a lot here, as every firewall product is different.

In your firewall, you need to allow inbound TCP/IP and UDP connections to the port number we found above.

After all that, if it still doesn’t connect, try modifying the SimConnect.xml file on the MSFS2020 PC, to force it to use the external IP, it may have just connected to the internal loopback IP address (127.0.0.1), which means it isn’t listening for connections externally.

Like I said, I can’t testify this works 100% but it should allow your remote application to connect using the native SimConnect DLL.

Dragonlaird

Can one set those client values also programmatically, via the SimConnect API?

Or is there at least a way to „refresh“ (dynamically unlink, relink) the SimConnect.dll, such that the config file is read again (assuming that the DLL reads it during initialisation)? Or even an API to re-read the (updated) config file?

I am asking because in the API description I do not find any functions related to connecting over IP:

SimConnect References

@Steeler2340 ,

Sadly not, at least not via the .NET wrapper (doubt the native C++ DLL will allow it either).

You’re right that it needs to be modified before instantiating (using) the DLL, I’ve not tested it but I doubt the DLL will detect changes to the CFG file when it is in use.

However, you can dispose of the SimConnect object in your own code, then update the CFG file and create a new instance of SimConnect, to force it to reload the CFG settings. Not the nicest approach but it should work, as you’ve effectively reloaded it.

Be careful when attempting this, as the results can be unpredictable, it has the potential to cause memory leaks or even make MSFS unstable.

Dragonlaird

1 Like

So one way could be to work with function pointers which would (only) be resolved at runtime, by dynamically loading the SimConnect.dll with LoadLibrary() (the Windows equivalent to dlopen() etc.).

That is, the application would not directly link (at compile/link time) against SimConnect, but explicitly load it during application initialisiation (as a “plugin”).

And whenever we’d want to change the network configuration we would unload and re-load the SimConnect.dll again.

But this is a path that is way to complicated (declaring all the function pointers alone ;)), so I am not going to try it - but if anyone feels inspired I’d be interested to hear about the outcome :wink:

As I mentioned above, I’m in the process of updating the project to demonstrate/test the SimConnect features, which I also plan the include a “Disconnect” method, to allow the DLL to be unloaded, this would verify if that approach would work.

I just noticed that you’ve added this to your comment: are you talking about the C# wrapper around the SimConnect.dll (wrapper around the SimConnect API written in C in the end) in this case? So are you saying that the C# wrapper effectively unloads the SimConnect.dll when “not in use”?

Because in the C++ world I have to explicitly link against SimConnect.dll (actually SimConnect.lib of course - except I’d go the “plugin way” and use function pointers and resolve them myself with the exported function symbols, load/unload the SimConnect.dll, as outlined in my previous comment), and so that DLL gets loaded together with my application at startup, whether I use it or not.

Yes, in C#, we need to use the Managed DLL (Microsoft.FlightSimulator.SimConnect.dll in the SDK) to access the methods, properties etc of SimConnect. We can’t natively use the SimConnect.dll directly without a lot of hassle and additional coding.

Regarding your comment about using the Plug-In route, that sounds like a better option, as you can then completely remove it from memory before re-creating it, ensuring there’s no legacy code left to retain/cache the config values.

This is great to know (about Navigraph for me) running on a 2nd PC … I’m about to try to set that up

For further info on the various config files (CFG, XML and INI) for SimConnect client and server, refer to the SDK documentation you downloaded when you enabled Developer mode in MSFS 2020:

%MSFS_SDK%Documentation\04-Developer_Tools\SimConnect\SimConnect_Reference.html

Copy/paste the above line into your file browser, it should open the relevant page in a web browser for you.

@Steeler2340 not tried this but it might be worth testing if the CFG file is re-read when using the methods (functions):

SimConnect_Close
SimConnect_Open

If it does work, you don’t need to unload/reload SimConnect and it may even retain all the client definitions etc

1 Like

That would be wonderful if this would work! I keep this in mind once I come around testing the “network part” of SimConnect (I first need to get hold of a second Windows installation to actually be able to test this, e.g. a virtual machine of some sort).

Now that raises the question where the SimConnect.cfg is actually expected to be located (for FS 2020): According to the Prepar3D

SimConnect Configuration

documentation the configuration “should be placed in the Documents folder, or in the same folder as the client application or library, on the computer the client is running on.”

(yes, I know, I keep referring to SimConnect API documentation of other products - but the MS specific SimConnect API documentation is disconninued and well hidden from web crawlers).

The question is relevant because if the application is supposed to be able to change that configuration (and create it automatically in the first place) then it would not be an ideal fit if that configuration could only be stored in the application’s directory - which would normally be write-protected (for non-admin users).

So does the SimConnect client library (DLL) for FS 2020 also look in some “documents” folder for the SimConnect.cfg? Or only in the same directory where the SimConnect.dll is located itself (which would typically be in a read-only location)?

Anyone has already made some practical steps which such a “network setup”?

Folks, I believe the whole *.cfg story (“access FS2020 via SimConnect over network”) is soon going to be history, at least in this form.

According to the FS2020 SDK documentation which is newly available online the *.cfg and *.ini files are still working, but considered to be legacy and hence should not be used going forward:

SimConnect CFG Definition

1 Like

It will be interesting to see how they will support legacy remote software if they plan to remove the network feature of SimConnect, I suspect remote software will need to bundle an old version of SimConnect, although the server may reject connections from older SimConnect DLLs

@Steeler2340 if support is withdrawn from the SimConnect SDK for network communication, there I still a requirement for third-party apps to connect natively to MSFS 2020 across a network.

They will need to provide documentation for the SimConnect API, so developers can communicate directly, instead of using the SDK to handle the network layer.

Given how long it’s taken to produce some SDK documentation, I can’t imagine they will be writing the API documentation anytime soon, I suspect the SDK will support network comms for a while yet :wink:

1 Like