mpaperno / MSFSTouchPortalPlugin

A plugin which provides a two-way interface between Touch Portal clients and Flight Simulators which use SimConnect, such as MSFS 2020 and FS-X.
GNU General Public License v3.0
66 stars 4 forks source link

Connection to simulator failed #52

Closed Pilippin closed 1 year ago

Pilippin commented 1 year ago

Hello,

I have never been able to connect TP to MSFS 2020

Log: 13:30:04.456 - [LOG] (Action Flow) - Doing action: [Connect & Update] MSFSTouchPortalPlugin.Plugin.Action.Connection.Data.Action -> Toggle Simulator Connection | 13:30:04.462 - [LOG] (Plugin Instance) Preparing plugin data for MSFSTouchPortalPlugin 13:30:04.467 - [LOG] (Plugin Instance) This is MSFSTouchPortalPlugin and received message for MSFSTouchPortalPlugin 13:30:04.475 - [LOG] (Plugin Instance) Incoming data: {"type":"stateUpdate","id":"MSFSTouchPortalPlugin.Plugin.State.Connected","value":"connecting"} 13:30:04.475 - [LOG] (Plugin Instance) Message send: {"data":[{"id":"MSFSTouchPortalPlugin.Plugin.Action.Connection.Data.Action","value":"Toggle Simulator Connection"}],"pluginId":"MSFSTouchPortalPlugin","actionId":"MSFSTouchPortalPlugin.Plugin.Action.Connection","type":"actio 13:30:04.483 - [LOG] (Plugin Instance) Incoming data: {"type":"stateUpdate","id":"MSFSTouchPortalPlugin.SimSystem.State.SimSystemEvent","value":"Connecting"} 13:30:04.484 - [LOG] (State System) Changed state MSFSTouchPortalPlugin.Plugin.State.Connected from false to value connecting 13:30:04.490 - [LOG] (State System) Changed state MSFSTouchPortalPlugin.SimSystem.State.SimSystemEvent from Disconnected to value Connecting 13:30:04.490 - [LOG] (Action Flow) Event Triggered(0, 6): When MSFS - Plugin - The status of SimConnect (true/false/connecting) changes to 'connecting' 13:30:04.497 - [LOG] (Action Flow) Button Event at (0, 6) on Page: \A32NX\A32NX_MAIN.tml 13:30:04.503 - [LOG] (Action Flow) - Doing action: [Visuals] Change visuals for the Icon 13:30:13.438 - [LOG] (Plugin Instance) Incoming data: {"type":"stateUpdate","id":"MSFSTouchPortalPlugin.SimSystem.State.SimSystemEvent","value":"Connection Timed Out"} 13:30:13.438 - [LOG] (Plugin Instance) Incoming data: {"type":"stateUpdate","id":"MSFSTouchPortalPlugin.SimSystem.State.SimSystemEventData","value":"30:13 [[c#e5c32b]WRN[/c]] Connection to Simulator failed, retrying in 30 seconds..."} 13:30:13.439 - [LOG] (State System) Changed state MSFSTouchPortalPlugin.SimSystem.State.SimSystemEvent from Connecting to value Connection Timed Out 13:30:13.446 - [LOG] (Plugin Instance) Incoming data: {"type":"stateUpdate","id":"MSFSTouchPortalPlugin.Plugin.State.LogMessages","value":"26:50 [[c#e5c32b]WRN[/c]] Connection to Simulator failed, retrying in 30 seconds...\n27:29 [[c#e5c32b]WRN[/c]] Connection to Simulator fai 13:30:13.446 - [LOG] (State System) Changed state MSFSTouchPortalPlugin.SimSystem.State.SimSystemEventData from 30:00 [[c#006eff]INF[/c]] Connection attempts to Simulator were canceled. to value 30:13 [[c#e5c32b]WRN[/c]] Connection to Simulator failed, retrying in 30 seconds... 13:30:13.453 - [LOG] (State System) Changed state MSFSTouchPortalPlugin.Plugin.State.LogMessages to value trimmed because it is too long. 13:30:52.414 - [LOG] (Plugin Instance) Incoming data: {"type":"stateUpdate","id":"MSFSTouchPortalPlugin.SimSystem.State.SimSystemEvent","value":"Connection Timed Out"} 13:30:52.415 - [LOG] (Plugin Instance) Incoming data: {"type":"stateUpdate","id":"MSFSTouchPortalPlugin.SimSystem.State.SimSystemEventData","value":"30:52 [[c#e5c32b]WRN[/c]] Connection to Simulator failed, retrying in 30 seconds..."} 13:30:52.424 - [LOG] (Plugin Instance) Incoming data: {"type":"stateUpdate","id":"MSFSTouchPortalPlugin.Plugin.State.LogMessages","value":"27:29 [[c#e5c32b]WRN[/c]] Connection to Simulator failed, retrying in 30 seconds...\n28:09 [[c#e5c32b]WRN[/c]] Connection to Simulator fai 13:30:52.424 - [LOG] (State System) Changed state MSFSTouchPortalPlugin.SimSystem.State.SimSystemEventData from 30:13 [[c#e5c32b]WRN[/c]] Connection to Simulator failed, retrying in 30 seconds... to value 30:52 [[c#e5c32b]WRN[/c]] Connection to Simulator failed, retrying in 30 seconds... 13:30:52.432 - [LOG] (State System) Changed state MSFSTouchPortalPlugin.Plugin.State.LogMessages to value trimmed because it is too long.

TP version : v3.1 build 12 MSFS Touch Portal Plugin version : 1040100

Thanks for the help

mpaperno commented 1 year ago

Hi,

Do you have a customized SimConnect.xml in the simulator's config directory?

There should be a SimConnect.xml file in one of those folders anyway, the question is if you've customized it or not (perhaps post it here if you're not sure).

The plugin keeps its own logs in C:\Users<User_Name>\AppData\Roaming\TouchPortal\plugins\MSFS-TouchPortal-Plugin\logs folder, where is your Windows user name. Those will be more useful to see. In fact the only reason there's anything from the plugin in this TP log is because the connection failure message is being sent as a TP State... :)

Cheers, -Max

Pilippin commented 1 year ago

MSFSTouchPortalPlugin20230422.log

Here's the XML content:

<?xml version="1.0" encoding="UTF-8"?>

SimConnect Server Configuration SimConnect.xml False Static IP4 port IPv4 local 500 64 41088 False Static IP6 port IPv6 local 501 64 41088 False Custom Pipe Pipe local Custom/SimConnect 64 41088 True Dynamic IP4 port IPv4 local 0 64 41088 True Dynamic IP6 port IPv6 local 0 64 41088 True Default FSX Pipe Pipe local 0 64 41088 Remote Pipe False Pipe global Custom\SimConnectGlobal 12 41088 Thanks again
Pilippin commented 1 year ago

I went there https://docs.flightsimulator.com/html/Programming_Tools/SimConnect/SimConnect_XML_Definition.htm and downloaded the XML. I tried again but nothing changed, same error

mpaperno commented 1 year ago

Thanks,

Just to be sure... it's probably just a formatting issue, but your actual XML file has tags around each actual line... right? Like this:

    <SimConnect.Comm>
        <Descr>Remote Pipe</Descr>
        <Disabled>False</Disabled>
        <Protocol>Pipe</Protocol>
        <Scope>global</Scope>
        <Port>Custom\SimConnectGlobal</Port>
        <MaxClients>64</MaxClients>
        <MaxRecvSize>41088</MaxRecvSize>
    </SimConnect.Comm>

This is also the entry that the plugin expects to be there by default. I think if there is no SimConnect.xml file in the config folder at all, then this connection is also enabled by default.

The file also must start with

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

and the last line must be

</SimBase.Document>

If that's all correct on your end, then please let me know about:

  1. What do you have in the plugin's settings (in Touch Portal -> Settings -> Plug-ins -> MSFS) for the "SimConnect.cfg Index" option?
  2. Please check in C:\Users<User_Name>\AppData\Roaming\TouchPortal\plugins\MSFS-TouchPortal-Plugin\ folder that there is a "SimConnect.cfg" file in there. If there is, try deleting or renaming it and restarting the plugin (from TP's Settings window). If there is not (which is unlikely) then that is an issue, though I'm not sure why it would happen.
  3. Is TP/plugin running on same computer as the Sim? (I noticed your custom remote connection pipe in the original XML).
  4. Did you restart the sim after swapping the XML file for the downloaded version?

You could try setting "SimConnect.cfg Index" option to 1 (one), which is an alternative standard configuration.

Not really sure what else to suggest at this point... except there's a way to enable SimConnect logging on the simulator side, which may potentially provide some clues. There should be a SimConnect.ini file in ...AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalState and it should have comments/instructions about each setting. It's described here: https://docs.flightsimulator.com/html/Programming_Tools/SimConnect/SimConnect_INI_Definition.htm

Cheers, -Max

Pilippin commented 1 year ago

Thanks for your time. Yes the xml file is in the right format.

But before going any further, I noticed that animations aren't working anymore. FBW A32NX or even original A310 is completly dull in terms of animations. For example, throttle information from my Honeycomb Bravo throttle quadrant is received and there is thrust but no animation throttle...

I'm trying to uninstall some addons and I hope not to have to reinstall completly MSFS (way to long). Maybe FSUIPC7 caused some error, I don't know...

I keep you noted

Thanks again

Luisgrf77 commented 1 year ago

Thanks for your time. Yes the xml file is in the right format.

But before going any further, I noticed that animations aren't working anymore. FBW A32NX or even original A310 is completly dull in terms of animations. For example, throttle information from my Honeycomb Bravo throttle quadrant is received and there is thrust but no animation throttle...

I'm trying to uninstall some addons and I hope not to have to reinstall completly MSFS (way to long). Maybe FSUIPC7 caused some error, I don't know...

I keep you noted

Thanks again

Hi, any success in getting back the animations to work? best regards Luis