Jump to content
The simFlight Network Forums

On MSFS start, Wideclient button screen not available before first plane loaded because Wideserver is not started


LeoSchoonbroodt

Recommended Posts

Hi John, 

I have a question about starting Wideserver.
As it is at the moment, Wideserver is started the first time a plane is loaded.
Is there a way to start it after FSUIPC7 is initialized but before the first plane load?

I use a wideclient Buttonscreen to setup several things in my cockpit depending on the plane i want to load, and it has to be setup before the plane loads.
This all works well except for the first start after FSUIPC is loaded because Wideserver isn't started at that time and therefore i have no Buttonscreen and other switches connected to my wideclient.

It is no big problem just something that creates some failed first loads. For example a plane shutting down when started on the runway because a fuelvalve in my cockpit is still closed.
There are solutions for this but would be neat if Wideserver was already running on first load.


Have a nice evening,

Leo

 

Link to comment
Share on other sites

14 hours ago, LeoSchoonbroodt said:

I use a wideclient Buttonscreen to setup several things in my cockpit depending on the plane i want to load, and it has to be setup before the plane loads.
This all works well except for the first start after FSUIPC is loaded because Wideserver isn't started at that time and therefore i have no Buttonscreen.

But how can you set thigs up in the cockpit if you do not have an aircraft loaded? You should not be trying to set anything for an aircraft when in the main menu...

14 hours ago, LeoSchoonbroodt said:

It is no big problem just something that creates some failed first loads. For example a plane shutting down when started on the runway because a fuelvalve in my cockpit is still closed.

But then you need to open the fuel valve once the aircraft has been loaded, not when in the main menu - setting anything in an aircraft when in the main menu is not guaranteed to actually do anything.... The best way to initialise an aircraft on load would be to have a auto-started lua script, which will be started when the aircraft is initially loaded. You can also use ipcReady.lua for anything that applies to all aircraft, but for anything that is aircraft-specific you should have a specific script that is started from the the aircraft profile auto section.

The WideServer component/thread in FSUIPC has always been started once an aircraft is loaded and ready-to-fly. Starting it earlier may not guarantee WideClient will work correctly, as this may also depend on other threads which are not stated until an aircraft is loaded. However, in the attached version I have added the ability to start the WideServer thread soon after the simconnect connection has been opened and the data requested, but I am not sure that this will work as you would like it. To use this feature, add
    StartEarly=Yes
to the [WideServer] section of your FSUIPC7.ini file.

John

FSUIPC7.exe

Link to comment
Share on other sites

Hi John,

Yes i use autostart lua's in each profile, the problem is that this lua reads out settings from my cockpit which are different for each plane and if such a setting isn't correct it acts accordingly.
To be clear i don't set it in the aircraft cockpit but in my homebuild cockpit which is then read by the lua script. As many buttons, switches and settings are plane dependant they should be in correct state before the plane dependant auto-lua reads them.

This all works perfect for successive flights as wideserver is running inbetween flights. Just for this first flight i cannot setup my cockpit to a correct state for the plane to be loaded.
I guess i need to start this ipcReady.lua in the [Auto] section of the FSUIPC7.ini file, as the profile depenend lua is started in the [Auto] section of each profile file?

I will try your attached version and will report back.

Thanks and a nice day,

Leo

Link to comment
Share on other sites

2 minutes ago, LeoSchoonbroodt said:

I guess i need to start this ipcReady.lua in the [Auto] section of the FSUIPC7.ini file, as the profile depenend lua is started in the [Auto] section of each profile file?

No - you do not have to add this. The ipcReady.lua is always started if available, you do not add this to an [Auto] section. From the lua plugins document:

Quote

There are currently three explicitly reserved Lua names, for programs which are run automatically if present:

ipcinit.lua  automatically run as soon as FSUIPC has connected to the FS. Note that there will be no access to
                  the FSUIPC WASM functionality (lvars, hvars, calculator code) when this lua is started.

ipcready.lua  automatically run when FS is really “ready to fly”. If the FSUIPC WASM module is enabled, this will
                      be ran once the lvars and hvars have been received from the WASM.

 

8 minutes ago, LeoSchoonbroodt said:

To be clear i don't set it in the aircraft cockpit but in my homebuild cockpit which is then read by the lua script. As many buttons, switches and settings are plane dependant they should be in correct state before the plane dependant auto-lua reads them.

Ok

9 minutes ago, LeoSchoonbroodt said:

I will try your attached version and will report back.

Ok

Link to comment
Share on other sites

Hi John,

 

Works like a charm, i can set offsets and other cockpit related things direct after FSUIPC7 is started, so with this version my problem is solved.
Hope you can keep this option in future versions as i think there are more self-build cockpits that could benefit from this.

Many many thanks for your swift reaction and solution,

Leo

Link to comment
Share on other sites

3 hours ago, LeoSchoonbroodt said:

Hope you can keep this option in future versions as i think there are more self-build cockpits that could benefit from this.

It will be kept and included in the next official release, 7.4.7.

3 hours ago, LeoSchoonbroodt said:

Many many thanks for your swift reaction and solution,

No problem - cheers,

John

Link to comment
Share on other sites

John,

One hickup i have seen when using the version 7.4.7b is that FSUIPC7 hangs at the moment after the plane is loaded and the log shows " Starting everything now "
this is normally where it previously said "Starting Wideserver".
Is it possible that it doesn't check that wideserver is already running and tries to start it again?

I exited FSUIPC7 and started it again and then it just continued at that point.

I send you the logfiles here and try to investigate further this evening when time permits (got guests, so have to attend them now).

cheers

Leo

 

FSUIPC7 after stopping and restarting FSUIPC7.log FSUIPC7 hang after starting everything now.log

Link to comment
Share on other sites

21 minutes ago, LeoSchoonbroodt said:

One hickup i have seen when using the version 7.4.7b is that FSUIPC7 hangs at the moment after the plane is loaded and the log shows " Starting everything now "
this is normally where it previously said "Starting Wideserver".

That is very strange...

22 minutes ago, LeoSchoonbroodt said:

Is it possible that it doesn't check that wideserver is already running and tries to start it again?

No - it checks. This is what I see:

Quote

...
    21547 Maximum number of custom events available is 1024 (defined by ini parameter MaxNumberOfCustomEvents)
    21563 Starting WideServer now ...
    29656 User Aircraft ID not supplied -- trying default
    29656 Requesting user aircraft data...
    53297 \\JDRAZER\MSFS2020\Official\Steam\asobo-aircraft-c172sp-classic\SimObjects\Airplanes\Asobo_C172sp_classic\aircraft.CFG
    54391 Aircraft loaded: running normally now ...
    55203 System time = 26/02/2024 21:00:54, Simulator time = 19:00:53 (20:00Z)
    56203 Aircraft="Cessna Skyhawk Asobo"
   889281 Planned flight from LEVX to LEVX
   889281 C:\USERS\JLDOW\APPDATA\ROAMING\MICROSOFT FLIGHT SIMULATOR\MISSIONS\CUSTOM\CUSTOMFLIGHT\CUSTOMFLIGHT.PLN
   889281 C:\Users\jldow\AppData\Roaming\Microsoft Flight Simulator\MISSIONS\Custom\CustomFlight\CustomFlight.FLT
   891938 Starting WAPI...
   891938   [INFO]: **** Starting FSUIPC7 WASM Interface (WAPI) version 1.0.4 (WASM version 1.0.3) using connection -1
   891938   [INFO]: Connected to MSFS
   914906 -------------------- Starting everything now ----------------------
   914906 Requesting Input Events....
   914922 Subscribed to InputEvents (140 found)
   914922 Reloading assignments for Input Events....
   915031 Aircraft="Cessna Skyhawk Asobo"
   919656 Lvars received: 279 L:vars & 47 H:vars now available
   919656 Lvars/Hvars received - checking aircraft autos....
...

I am not sure why it is hanging for you - I will have to check further here. I am noy actually using any WideClients, so I will try later in the week with WideClient also running to see if this affects things.

John

Link to comment
Share on other sites

Hi John,

Did some investigation and found that FSUIPC7 didn't hang but didn't load the lua in the [Auto] section of the profile and so there was nothing logged and initialized which i interpreted as hang.
Found out via testing that this only happens on the first flight loaded after MSFS start and only if i use wideclient to setup my cockpit before this first flight.
if i don't touch wideclient, the lua is loaded, so i tried to eliminate which actions on wideclient cause this but have still not exactly pinpointed the problem.
Strange thing is that it only happens on the first flight, on successive flights i can setup my cockpit without problems before the plane is loaded.
Also, if i manually load the lua via a button that is defined in the profile ini then this succeeds succesfull, so this is a way around the problem.
But i still want to go to the bottom of this, just wanted to let you know what i found before you spend time on something that could be just caused because of the way i use wideclient.
Only thing that i find strange that it only is on the first flight and only when i touch wideclient before that first flight.

I'll keep you informed about anything i find.

Have a nice evening,

Leo

Link to comment
Share on other sites

Ok, thats interesting. Is this auto started in a profile [Auto] section? I suspect so...

Can you add logging for offset 0x3D00 please, as AscIIZ. This will log when the aircraft name is available which is needed to determine which profile to use. Also add logging for Extras, to add the thread ids to the log. Then generate those two files again.

Thanks - I will see if I can reproduce here, but it does look like something that WideClient is doing that is triggering this...

John

Link to comment
Share on other sites

39 minutes ago, John Dowson said:

Ok, thats interesting. Is this auto started in a profile [Auto] section? I suspect so...

Can you add logging for offset 0x3D00 please, as AscIIZ. This will log when the aircraft name is available which is needed to determine which profile to use. Also add logging for Extras, to add the thread ids to the log. Then generate those two files again.

Thanks - I will see if I can reproduce here, but it does look like something that WideClient is doing that is triggering this...

John

Yes it's loaded in the [Auto] section of the profile.

The correct profile ini file is loaded otherwise i couldn't manually load the lua as this button is defined in the profile file

i will add logging today and will send you the files.

Leo

Link to comment
Share on other sites

4 minutes ago, LeoSchoonbroodt said:

The correct profile ini file is loaded otherwise i couldn't manually load the lua as this button is defined in the profile file

Yes but that will be done slightly later - different sections of the profile are loaded at different times. It looks like the aircraft name isn't available when the lua autos are started - this is what I want to check with the additional logging.  Could you also use the attached version which has additional (temporary) logging added.

John

FSUIPC7.exe

Link to comment
Share on other sites

2 hours ago, John Dowson said:

Yes but that will be done slightly later - different sections of the profile are loaded at different times. It looks like the aircraft name isn't available when the lua autos are started - this is what I want to check with the additional logging.  Could you also use the attached version which has additional (temporary) logging added.

John

FSUIPC7.exe 663.5 kB · 0 downloads

Yes i will try this version.

It's a strange problem, Yesterday any first flight didn't load the profile lua, didn't matter which Aircraft and successive flights were always OK.

Today my first two flights went very well, no problem using Buttonscreen before flightload lua and ini file loaded.
First one with the Schweizer second one with the default Cabri.

The third flight with the Bell206, the lua was loaded as i can see that my Arduino's were initialized but when i tried to use the buttons defined in the Bell206.ini they didn't work.
Did several reloads of Button & Switches via the assignments menu to no result.
Then when i gave up and used the Buttonscreen's ESC and END buttons, those worked. So for me an indication that only buttons in the Bell206.ini were not working.

I send you that logfile in case you want to have a look.

FSUIPC7.log

Link to comment
Share on other sites

12 minutes ago, LeoSchoonbroodt said:

Meanwhile a did a testfly with version 7.4.8a and got the same result.

You will as there is no change just additional logging..

13 minutes ago, LeoSchoonbroodt said:

lua loaded but buttons in profile ini file not.

So you are saying that the luas are now started ok (including profile luas), but the profile buttons are not loaded? And the first time you tried everything was ok for the first two aircraft, and the profile buttons failed to load on the third aircraft, and the second time the profile buttons failed to load with the first aircraft?


 

Link to comment
Share on other sites

Yes, i switched Aircraft several times to see if it was Aircraft specifioc.
I don't have the logfiles from earlier flights anymore but i past you my Journal with notes that i kept since the additional debugging options.

TESTS WITH DEBUG EXTRA OPTION
===============================
TEST 1 
MSFS started
ButtonScreen  use
Aircraft Schweizer selected
Aircraft Schweizer loaded
EVERYTHING WORKS

TEST 2
MSFS started
ButtonScreen  use
Aircraft Cabri selected
Aircraft Cabri loaded
EVERYTHING WORKS

TEST 3
MSFS started
ButtonScreen use
Aircraft Bell206 slected
Aircraft Bell206 loaded
Lua Loaded as Arduino's are initialized
Buttons defined in Bell206.ini Don't work 
BUT Bell206.ini is loaded as [Auto] Bell206.lua is loaded
Several times Button & Switches reload from menu without result
AT END when pressing ESC and END buttons from Buttonscreen (Defined in FSUIPC7.ini): these work
Also enormous amount of Axis data in log, could this hinder Button detection???
Have seen that when i enable lua logging, it is almost impossible to use the simulator

NEW Version of FSUIPC7.4.8a
============================
TEST 1
MSFS started
ButtonScreen use
Aircraft Schweizer selected
Aircraft Schweizer loaded
Lua Loaded as Arduino's initialized
Buttons defined in Schweizer.ini NOT working
Buttons defined in FSUIPC7.ini working
Buttons from buttonscreen working
  Enabled lualogging from one of those and to see if enabled switched some undefined commands 
  in the homecockpit on and off. Do find this in the logging: RECEIVED: ZZ696720   NOT RECOGNISED/EXECUTED
btw. all buttons above 1000 are defined in the FSUIPC7.ini, those work

Link to comment
Share on other sites

Profile buttons should be loaded after the aircraft name is logged:

Quote

...
    10266 26872 Aircraft="FlyInside - B206"
 ...
    159391 26872 Aircraft="Schweizer S300CBi White"

But I cannot tell where those button assignments in your log are coming from... can you please attach your FSUIPC7.ini file and the profile .ini files of the aircraft you are using for testing.

 

Link to comment
Share on other sites

OK here are the profile files i used during testing.
All button linenumbers above 1000 for buttondefinitions come from FSUIPC7.ini 
Lower than 1000 come from profile files.

I have anyway the idea that it's intermittend as the first flight with the Schweizer worked and the last flight didn't and if you say this version 7.4.8a only added additional logging
then the other conditions are the same. Also because yesterday the main problem was that profile auto lua's were not loaded and i have never seen that today.
Now the main problem seems to be that buttondefinitions from the profile files are not loaded.

 

FSUIPC7.ini CabriG2.ini Schweizer.ini Bell206.ini

Link to comment
Share on other sites

Not related to your issue, but a few problems I have noticed in your ini fille...

Quote

C=<< MISSING JOYSTICK >> << MISSING JOYSTICK >>
B=<< MISSING JOYSTICK >> << MISSING JOYSTICK >>

You have assignments to these two missing joysticks - best to remove those assignments (or change the letters to an existing device) and remove those lines.

You should update to use substrings in your profiles. e.g. change

Quote

[Profile.H160]
1=Airbus H160 Luxury Livery 1
2=Airbus H160 Luxury Livery 2
3=Airbus H160 Luxury Livery 3
4=Airbus H160 Luxury Livery 4
5=Airbus H160 Luxury Livery 5
6=Airbus H160 Luxury Livery 6
7=Airbus H160 Civil Livery 1
8=Airbus H160 Civil Livery 2
9=Airbus H160 Civil Livery 3
10=Airbus H160 Civil Livery 4
11=Airbus H160 Civil Livery 5
12=Airbus H160 Civil Livery 6

to

Quote

[Profile.H160]
1=Airbus H160

Change

Quote

[Profile.JS145]
1=Airbus H145 Luxury Livery 1
2=Airbus H145 Luxury Livery 2
3=Airbus H145 Luxury Livery 3
4=Airbus H145 Luxury Livery 4
5=Airbus H145 Civilian Livery 1
6=Airbus H145 Civilian Livery 2
7=Airbus H145 Civilian Livery 3
8=Airbus H145 Civilian Livery 4
9=Airbus H145 Military Livery 1
10=Airbus H145 Military Livery 2
11=Airbus H145 Military Livery 3
12=Airbus H145 Military Livery 4
13=Airbus H145 ADAC
14=Airbus H145 DRF
15=Airbus H145 CMH
16=Airbus H145 HeliOtago
17=Airbus H145 Norsk Luftambulanse
18=Airbus H145 Bundeswehr
19=Airbus H145 CAL FIRE
20=Airbus H145 San Diego Gas Electric
21=HPG H145 OO-NSZ EMS
22=Airbus H145 Petroleum Helicopters International
23=Airbus H145 KN Helicopters
24=Airbus H145 Philippine Coast Guard
25=Airbus H145 United States Coast Guard
26=Airbus H145 Civilian Cargo Livery 1
27=Airbus H145 Military Cargo Livery 1

to

Quote

[Profile.JS145]
1=Airbus H145
2=HPG H145 OO-NSZ EMS

etc.

Do this for each of your profiles, i.e. use a substring of the aircraft name that identifies all aircraft of this type you want to capture, and no others.
Doing this will match the aircraft to the profile regardless of livery.

Link to comment
Share on other sites

1 minute ago, John Dowson said:

Btw, are all your devices attached to the server PC, or do you have some attached to the client PC?

When the profile buttons are not working, are these in a device attached to the server PC or the client?

At this moment the client has only the button screen.
Buttons in the profile are all on the server machine, the device connected on the client died some time ago and was disconnected and not replaced anymore.
About the 2 joystick devices those are not in use anymore and detached.
At this moment i hesitate to make any changes that may complicate troubleshooting as it has always worked this way, but i definitely cleanup my ini file one of these days

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.