News:

Buying something from Amazon? Please consider using my affiliate links - Amazon.com or Amazon.co.uk - You get your stuff, Plan-G gets a little boost :)   

Main Menu

msfs network connection problem

Started by sergio56, January 05, 2021, 02:58:07 PM

Previous topic - Next topic

sergio56

Hi all, I installed Plan-G and MSFS2020 in the same pc, and all worked well.
I also installed Plan-G on a notebook. connected to the same network, and I generated a database from MSFS installed on main PC (server).
So I guess the network connection is working...
Unfortunately, connection to MSFS, in order to show my aircraft and flying data is not possible.
I followed these steps :

1) stopped firewalls on server and client pc
2) added lines to SimConnect.xml (checking correct IP and port) as I read in the manual, in main PC :

-----------------------------------------------------------------------------
?xml version="1.0" encoding="Windows-1252"?>
<SimBase.Document Type="SimConnect" version="1,0">
<Descr>SimConnect Server Configuration</Descr>
<Filename>SimConnect.xml</Filename>
<Disabled>False</Disabled>
<!-- Example Global (remote) IPv4 Server Configuration-->
<SimConnect.Comm>
<Disabled>False</Disabled>
<Protocol>IPv4</Protocol>
<Scope>global</Scope>
<MaxClients>64</MaxClients>
<Address>192.168.0.55</Address>
<Port>4512</Port>
</SimConnect.Comm>
-----------------------------------------------------------------------------

3)  set in Plan-G  option - FS connection (in notebook), the same IP and port on server PC
4)  placed a SimConnect.cfg in Plan-G folder (in notebook), (as described in manual), with the same IP and port than in SimConnect.xml :

-----------------------------------------------------------------------------
[SimConnect]
Protocol=IPV4
Address=192.168.0.055
Port=4512
MaxReceiveSize=4096
DisableNagle=0s
-----------------------------------------------------------------------------

6)  Checked SimConnect 1 and SimConnect2 option in FS connection (always on notebook)

Nothing works  :(
Any suggestion, any ideas?
Thank you

P.S.
I always started MSFS before Plan-G (as read in manual)

tim arnot

The file contents look okay, and ought to work, provided they're in the correct places as described in the v4 Quick Start Guide (it's preferable to follow this rather than the old v3 manual, since it's up to date, and specifically includes MSFS).

Next is to attach the log file here, so we can see what's happening.

Tim. @TimArnot

sergio56

#2
Thank you for replay
Here is the log file, I hope can help :

15:50:23.0

---===+++ 06/01/2021 +++===---

15:50:23.0 Starting Plan-Gv4 build 4.0.0.237
15:50:23.0 OS is Microsoft Windows NT 10.0.14393.0
15:50:23.0 Plan-G Files folder is: C:\Users\Administrator\Documents\Plan-Gv4 Files
15:50:24.9 Map tiles cache: C:\Users\Administrator\AppData\Local\GMap.NET\
15:50:24.9 Map provider: OpenStreetMap © OpenStreetMap contributors, CC-BY-SA.
15:50:24.9 Map cache mode: ServerAndCache
15:50:25.1 Program in: C:\Users\Administrator\Downloads\plan g\Plan-G v4
15:50:25.1 Data in: C:\Users\Administrator\Documents\Plan-Gv4 Files
15:50:25.2 Starting timer
15:50:25.2 DownloadCurrentMetars thread started
15:50:25.2 Metar13Z.TXT started
15:50:25.2 Metar14Z.TXT started
15:50:27.7 Stopping timer
15:50:27.7 StartMap
15:50:28.1 NdbsInBounds 0
15:50:28.2 VorsInBounds 1
15:50:28.8 AirportsInBounds 1
15:50:30.3 AirspaceInBounds N:43,69 S:43,66 W:10,33 E:10,45  13
15:50:30.5 NdbsInBounds 0
15:50:30.5 VorsInBounds 1
15:50:30.5 Metar13Z.TXT done
15:50:30.6 AirportsInBounds 1
15:50:30.7 Metar14Z.TXT done
15:50:30.7 DownloadCurrentMetars done
15:50:30.8 AirspaceInBounds N:43,69 S:43,66 W:10,33 E:10,45  13
15:50:31.1 _Backstage_IsOpenChanged: True
15:50:31.5 ProcessMetars done
15:50:41.0 _Backstage_IsOpenChanged: False
15:50:43.9 Initiating SimConnect FSX/MSFS SP2 connection.
15:51:06.3 Connect: System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at Microsoft.FlightSimulator.SimConnect.SimConnect..ctor(String szName, IntPtr hWnd, UInt32 UserEventWin32, WaitHandle hEventHandle, UInt32 ConfigIndex)
   at Plan_G.Model.SimConnect_FSX.Connect(IntPtr myWindow) in C:\Users\Tim\source\repos\Plan-G\Model\SimConnect_FSX.cs:line 141
15:51:06.4 SimConnect connection attempt timed out
15:51:06.4 Disconnecting from SimConnect
15:51:06.5 Disconnected from sim
15:51:11.1 NdbsInBounds 0
15:51:11.1 VorsInBounds 1
15:51:11.2 AirportsInBounds 1
15:51:11.4 AirspaceInBounds N:43,69 S:43,66 W:10,33 E:10,45  13
15:51:12.0 NdbsInBounds 0
15:51:12.0 VorsInBounds 1
15:51:12.1 AirportsInBounds 1
15:51:12.3 AirspaceInBounds N:43,71 S:43,65 W:10,27 E:10,51  14
15:51:12.5 NdbsInBounds 0
15:51:12.5 VorsInBounds 2
15:51:12.7 AirportsInBounds 3
15:51:12.9 AirspaceInBounds N:43,75 S:43,61 W:10,15 E:10,62  19
15:51:13.6 NdbsInBounds 1
15:51:13.6 VorsInBounds 2
15:51:13.8 AirportsInBounds 10
15:51:14.0 AirspaceInBounds N:43,83 S:43,56 W:9,91 E:10,85  24
15:51:14.2 NdbsInBounds 1
15:51:14.2 VorsInBounds 3
15:51:14.5 AirportsInBounds 15
15:51:14.7 AirspaceInBounds N:43,96 S:43,42 W:9,45 E:11,32  52



sergio56

This is the folder where I edited SimConnect.xml

C:\Users\Utente\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache

I guess it's correct

tim arnot

Simconnect.xml is in the correct place.

The "Error HRESULT E_FAIL has been returned from a call to a COM component." response after 20 seconds suggests that the connection didn't get through. (if it was refused, the error would have come back immediately)

Most likely reasons:
- the FS computer's IP has changed (this can happen after a reboot if it doesn't have a reserved address in your router)
- the wrong computer's IP address has been used in the cfg files (it must be the sim PC, not the client)
- simconnect.cfg is in the wrong place (it must be in either My Documents\ or the Plan-G PROGRAM folder)
- The firewall is blocking the connection (there is a sticky at the top of this forum, detailing how to open the firewall for SimConnect)

There is a way to see from the sim end whether the connection is getting through: Create a Simconnect.ini file, and place it in

C:\Users\Utente\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalState

(I've pasted a sample file to the end this message. You'll need to change the file= line to where you want the log to go).
When you start MSFS, it'll open a console window, and you can see all the Simconnect messages going back and forth. It'll be pretty obvious when a connection from Plan-G arrives.
Once you're done with it, just remove or rename the file.

simconnect.ini:
--------------------------------------------------------------------------------
[SimConnect]
level=normal
console=1
;RedirectStdOutToConsole=1
OutputDebugString=1
file=C:\Users\Utente\simconnect%03u.log
file_next_index=1
file_max_index=9
--------------------------------------------------------------------------------

Tim. @TimArnot

sergio56

Thank you again for kind reply.
- Main pc is connected by ethernet cable, then the IP cannot be changed. Anyway I checked many times with ipconfig command
- I checked hundred of times IP address (of main PC) in cfg file
- SimConnect.cfg is in the right place (e.g. Plan-G folder) in the client notebook
- firewall is disabled. Anyway I also followed setting instruction at the top of the forum (in the sticky post)

As a last chance I created the Simconnect.ini file you suggested
While MSFS and console running, I tried three times to connect from client notebook. Nothing worked.

I attached the simconnect log. I don't know if you can spend time over it but I hope so  :)


malstrom82

Hello!

Connection problems on network-pc here too.
Read through the documents and forum threads.

windows10 on both computers, msfs via steam.
port 4501 allowed in firewall on both pc's.
tried opening plan-g as administrator and not.
SimConnect.xlm as per below, on sim-pc. Located in C:\Users\Malstrom\AppData\Roaming\Microsoft Flight Simulator (msfs via steam).
SimConnect.cfg as attached, on laptop. Located directly under Documents (also tried inside the plan-g program folder).
logfile from laptop attached.
in Plan-G i setup with SimConnect2, using IPv4, address and port as per the xlm/cfg files.
(SimConnect1-option doesn't do anything).

when pressing connect, it disconnects almost immediately and crashes the program.
in the logfile all i can see is that line with time-out.
is there any issue regarding having two IPv4-entries in the xlm-file? (the added one on the bottom, and the pre-existing one above)?

Assistance appreciated! =)

------------------------------------------------------------------

<?xml version="1.0" encoding="Windows-1252"?>

<SimBase.Document Type="SimConnect" version="1,0">
    <Descr>SimConnect Server Configuration</Descr>
    <Filename>SimConnect.xml</Filename>
    <SimConnect.Comm>
        <Descr>Static IP4 port</Descr>
        <Protocol>IPv4</Protocol>
        <Scope>local</Scope>
        <Port>500</Port>
        <MaxClients>64</MaxClients>
        <MaxRecvSize>41088</MaxRecvSize>
    </SimConnect.Comm>
    <SimConnect.Comm>
        <Descr>Static IP6 port</Descr>
        <Protocol>IPv6</Protocol>
        <Scope>local</Scope>
        <Port>501</Port>
        <MaxClients>64</MaxClients>
        <MaxRecvSize>41088</MaxRecvSize>
    </SimConnect.Comm>
    <SimConnect.Comm>
        <Descr>Custom Pipe</Descr>
        <Protocol>Pipe</Protocol>
        <Scope>local</Scope>
        <Port>Custom\SimConnect</Port>
        <MaxClients>64</MaxClients>
        <MaxRecvSize>41088</MaxRecvSize>
    </SimConnect.Comm>
    <SimConnect.Comm>
        <Descr>Dynamic IP4 port</Descr>
        <Protocol>IPv4</Protocol>
        <Scope>local</Scope>
        <Port>0</Port>
        <MaxClients>64</MaxClients>
        <MaxRecvSize>41088</MaxRecvSize>
    </SimConnect.Comm>
    <SimConnect.Comm>
        <Descr>Dynamic IP6 port</Descr>
        <Protocol>IPv6</Protocol>
        <Scope>local</Scope>
        <Port>0</Port>
        <MaxClients>64</MaxClients>
        <MaxRecvSize>41088</MaxRecvSize>
    </SimConnect.Comm>
    <SimConnect.Comm>
        <Descr>Default FSX Pipe</Descr>
        <Protocol>Pipe</Protocol>
        <Scope>local</Scope>
        <Port>0</Port>
        <MaxClients>64</MaxClients>
        <MaxRecvSize>41088</MaxRecvSize>
    </SimConnect.Comm>
   <SimConnect.Comm>
      <Disabled>False</Disabled>
      <Protocol>IPv4</Protocol>
      <Scope>global</Scope>
      <MaxClients>64</MaxClients>
      <Address>192.168.0.103</Address>
      <Port>4501</Port>
   </SimConnect.Comm>
</SimBase.Document>

------------------------------------------------------------------

[SimConnect]
Protocol=IPV4
Address=192.168.0.103
Port=4501
MaxReceiveSize=4096
DisableNagle=0s

sergio56

Also in my configuration,  Plan-G  in SimConnect2, using IPv4, address and port as per the xlm/cfg files, disconnects almost immediately and crashes.
No solution?

tim arnot

#8
The simconnect log definitely shows there's nothing getting through. When it comes to networking, I'm not an expert, but there really are only those 4 parameter: IP, Port no, firewall, config files. My only other thought on that is maybe you have an antivirus that blocks it?

When you say "connected by ethernet cabe" to you mean the cable from one PC plugs directly into the other? (known as a crossover connection) Or do they both plug into a router? If they both plug into a router, then the IP address most definitely CAN change.

I do notice you have FSUIPC7 running. If you have WideFS too, that's an alternative connection that will work (WideFS/FSUIPC handles networking in a different way).

Quote from: sergio56 on January 07, 2021, 11:22:56 PM
Thank you again for kind reply.
- Main pc is connected by ethernet cable, then the IP cannot be changed. Anyway I checked many times with ipconfig command
- I checked hundred of times IP address (of main PC) in cfg file
- SimConnect.cfg is in the right place (e.g. Plan-G folder) in the client notebook
- firewall is disabled. Anyway I also followed setting instruction at the top of the forum (in the sticky post)

As a last chance I created the Simconnect.ini file you suggested
While MSFS and console running, I tried three times to connect from client notebook. Nothing worked.

I attached the simconnect log. I don't know if you can spend time over it but I hope so  :)

Tim. @TimArnot

tim arnot

Yes, Simconnect1 can't load on your PC (there's a lot of info on that if you search the forum, although no real solutions other than to install a copy of FSX on that PC). As regards Simconnect 2, as with the OP, you'll have to go through the same diagnostics: IP, port, firewall/antivirus, config. To see where the problem lies.

Regarding the crash, there's nothing in the log (there won't be - if it's crashed it can't log anything). You could look at the Windows logs through Event Viewer, that should tell you at least the faulting module.

Quote from: malstrom82 on January 08, 2021, 07:39:34 PM
Hello!

Connection problems on network-pc here too.
Read through the documents and forum threads.

windows10 on both computers, msfs via steam.
port 4501 allowed in firewall on both pc's.
tried opening plan-g as administrator and not.
SimConnect.xlm as per below, on sim-pc. Located in C:\Users\Malstrom\AppData\Roaming\Microsoft Flight Simulator (msfs via steam).
SimConnect.cfg as attached, on laptop. Located directly under Documents (also tried inside the plan-g program folder).
logfile from laptop attached.
in Plan-G i setup with SimConnect2, using IPv4, address and port as per the xlm/cfg files.
(SimConnect1-option doesn't do anything).

when pressing connect, it disconnects almost immediately and crashes the program.
in the logfile all i can see is that line with time-out.
is there any issue regarding having two IPv4-entries in the xlm-file? (the added one on the bottom, and the pre-existing one above)?

Assistance appreciated! =)

Tim. @TimArnot

sergio56

Quote from: tim arnot on January 09, 2021, 11:34:52 AM
The simconnect log definitely shows there's nothing getting through. When it comes to networking, I'm not an expert, but there really are only those 4 parameter: IP, Port no, firewall, config files. My only other thought on that is maybe you have an antivirus that blocks it?

When you say "connected by ethernet cabe" to you mean the cable from one PC plugs directly into the other? (known as a crossover connection) Or do they both plug into a router? If they both plug into a router, then the IP address most definitely CAN change.

I do notice you have FSUIPC7 running. If you have WideFS too, that's an alternative connection that will work (WideFS/FSUIPC handles networking in a different way).


Quote from: sergio56 on January 07, 2021, 11:22:56 PM
Thank you again for kind reply.
- Main pc is connected by ethernet cable, then the IP cannot be changed. Anyway I checked many times with ipconfig command
- I checked hundred of times IP address (of main PC) in cfg file
- SimConnect.cfg is in the right place (e.g. Plan-G folder) in the client notebook
- firewall is disabled. Anyway I also followed setting instruction at the top of the forum (in the sticky post)

As a last chance I created the Simconnect.ini file you suggested
While MSFS and console running, I tried three times to connect from client notebook. Nothing worked.

I attached the simconnect log. I don't know if you can spend time over it but I hope so  :)

I don't own WideFS, so I can't check. Unfortunately there is not a trial version...
Main pc is connected by Ethernet cable to router. Server PC (notebook) is connected by WIFI.
I'm not an espert too, but IP of the main PC is always the same (everytime I checked by IP config).
Furthermore, I use Little Nav Map (I don't like it too much), and I can correctly connect to server PC.
Anyway thanks a lot for your kind support.
If I'll solve this problem, I'll promptly post the solution!

tim arnot

Are you using the same port as LittleNavMap?

Tim. @TimArnot

sergio56

Quote from: tim arnot on January 09, 2021, 01:30:55 PM
Are you using the same port as LittleNavMap?

I tried using the same port and after changing

sergio56

I own Spadnext and it works perfectly on main pc (server)
I tried to install spadnext in my notebook and to connect it to MSFS2020, but it was impossible.
Every time, I got a connection error, like when I tried with Plan-G
Now I think the problem is SimConnect, because when I use LittleNavMap (which provides a proprietary server [eg LittleNavConnect]), I have no trouble at all.
Is there a network problem in SimConnect and MSFS2020?
Had someone else the same issue?

sergio56

Quote from: sergio56 on January 09, 2021, 01:26:02 PM
Quote from: tim arnot on January 09, 2021, 11:34:52 AM
The simconnect log definitely shows there's nothing getting through. When it comes to networking, I'm not an expert, but there really are only those 4 parameter: IP, Port no, firewall, config files. My only other thought on that is maybe you have an antivirus that blocks it?

When you say "connected by ethernet cabe" to you mean the cable from one PC plugs directly into the other? (known as a crossover connection) Or do they both plug into a router? If they both plug into a router, then the IP address most definitely CAN change.

I do notice you have FSUIPC7 running. If you have WideFS too, that's an alternative connection that will work (WideFS/FSUIPC handles networking in a different way).


Quote from: sergio56 on January 07, 2021, 11:22:56 PM
Thank you again for kind reply.
- Main pc is connected by ethernet cable, then the IP cannot be changed. Anyway I checked many times with ipconfig command
- I checked hundred of times IP address (of main PC) in cfg file
- SimConnect.cfg is in the right place (e.g. Plan-G folder) in the client notebook
- firewall is disabled. Anyway I also followed setting instruction at the top of the forum (in the sticky post)

As a last chance I created the Simconnect.ini file you suggested
While MSFS and console running, I tried three times to connect from client notebook. Nothing worked.

I attached the simconnect log. I don't know if you can spend time over it but I hope so  :)

I don't own WideFS, so I can't check. Unfortunately there is not a trial version...
Main pc is connected by Ethernet cable to router. Server PC (notebook) is connected by WIFI.
I'm not an espert too, but IP of the main PC is always the same (everytime I checked by IP config).
Furthermore, I use Little Nav Map (I don't like it too much), and I can correctly connect to server PC.
Anyway thanks a lot for your kind support.
If I'll solve this problem, I'll promptly post the solution!

I finally solved  :D :D
I copied and pasted to my simconnect.xml file, the lines from "Plan-G Quick Start.pdf", but nothing worked.
After struggling for two weeks, someone suggested to me, to try a new simconnect.xml file, because mine was broken.
He posted me the new file, and all magically worked!
I am not able to understand what the problem was in the old file, but what matters is that everything works!
I enclose the new file (in txt format), so perhaps it could be useful. Remember to modify IP address and port, in order to adapt to your PC configuration.
Thank you