Jump to content
The simFlight Network Forums

issue with use of buttons on joystick connected via widefs


Recommended Posts

Hi Pete,

I got an issue with my joystick button assignments. I assigned in FSUIPC some joystick buttons from a ajoystick physically

connected on a second computer linked via wideFS. All is working well.

Then I copied the wideclient link into the startup folder on the 2nd PC so wideclient starts up after boot and then waits

for the connection of the FS PC. When this FS PC is ready (wideserver ready) the wideclient starts FSCOMMUNICATOR.

Now what happens is that my defined joystick buttons dont work after startup. Fsuipc does not see any button pressed

on that remote joystick. When I close fscommunicator and wideclient on that remote PC and start wideclient back up however

it works again.

Any ideas?

I guess it could have something to do with the fact the wideclient starts very fast after the PC comes online and the joystick driver is not ready at that moment?

Functionally it works because if I dont start wideclient during startup but I start it manually, the buttons do get seen in fsuipc and everything works. The problem is I would like to remove the screen from that PC, so it should all start automatically when I switch on the PC

thanks Peter

Link to comment
Share on other sites

I copied the wideclient link into the startup folder on the 2nd PC so wideclient starts up after boot and then waits for the connection of the FS PC. When this FS PC is ready (wideserver ready) the wideclient starts FSCOMMUNICATOR. Now what happens is that my defined joystick buttons dont work after startup. Fsuipc does not see any button pressed on that remote joystick. When I close fscommunicator and wideclient on that remote PC and start wideclient back up however it works again. Any ideas?

Sorry, no. I don't know FSCommunicator at all -- is that something which is reading your buttons and switches?

I guess it could have something to do with the fact the wideclient starts very fast after the PC comes online and the joystick driver is not ready at that moment?

Joystick drivers are part of the Windows system and should be loaded and ready long before any "start up" program is loaded. Putting a program in the start-up folder is just the same as starting the program as soon as you can access the icon on screen, which is wel after any drivers are running.

I have WideClient starting up automatically, via the StartUp folder, on all my cockpit client PCs (6 of them), and none of them have any trouble recognising any switches (though I don't have switches on them all).

I can only wonder if the devices you have the buttons and switches on aren't fully powered up and responding to the drivers in time. Could that be? Are they USB devices? Can you make sure USB power management is turned off on every hub, just in case -- having it turned on may make Windows apply power later.

Let me know. If you still cannot make it work I can look at adding a periodic check for joysticks in WideClient, or at least a re-check when WideServer responds. It isn't difficult, just never come up before. The way it is at present all joysticks to be used need to be connected prior to WideClient running.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

the joystick is a USB device

FSCOMMUNICATOR is a program that reads the joystick axes and buttons and implements a very detailed airbus fly by wire system. You can connect in this way two joysticks and let them work like the sidesticks of an airbus with priority function.

This program reads my joystick axes and I have set it up for one button for the priority switch. The other buttons on the joystick are defined in FSUIPC for braking, PTT, outside view, plane view.

I will try tonight to remove the autostart of fscommunicator to see if it would be related to this. But I guess not, since when I close it and then I close wideclient, then open wideclient again (fscommunicator is also started automatically) it works again and my buttons are seen in fsuipc. Strange not.

Anyway, i'll try it and let you know.

The only difference I see is that in the case that it doesnt work, wideclient waits first for wideserver to be up and then starts fscommunicator. in the case that it works I start wideclient when wideserver is already running, and FS is running.

We'll see....

Peter

Link to comment
Share on other sites

the joystick is a USB device

Okay, then please do check that you have power management turned off on the USB hub. To do this go into the Device manager (Settings-System-Device manager), select each Hub in turn, right-click, select Properties-Pwer Management, and untick "allow the computer to turn off ...".

I will try tonight to remove the autostart of fscommunicator to see if it would be related to this.

I wouldn't think so. But as FSCommunicator is also reading the joystick/buttons, do I assume that those parts ARE okay, and only the buttons being read/transmitted by WideFS are not seen?

The only difference I see is that in the case that it doesnt work, wideclient waits first for wideserver to be up and then starts fscommunicator. in the case that it works I start wideclient when wideserver is already running, and FS is running.

Ah, then I misunderstood your first message. What about the case where you start WideClient manually, well after Windows has loaded, but before you start FS? You need that case to determine whether it is anything to do with Windows startup or not. It will be no good for me to alter WideClient to scan for new joysticks periodically if this isn't where the problem lies.

Regards

Pete

Link to comment
Share on other sites

Pete,

I will try to see this USB power managment for sure

I have found some program on internet where I can specify delays for startup of programs after windows has loaded, will see what that does

When FS comes Ok and fscommunicator starts up it can read the joystick axes and button while the other buttons are not seen in fsuipc

Greetz Peter

I'll keep you informed

Link to comment
Share on other sites

I have found some program on internet where I can specify delays for startup of programs after windows has loaded, will see what that does

Okay. But it is also fairly easy for me to change WideClient slightly to try every few seconds to see if new joystick devices have been connected. I suppose there may be other occasions where this could be useful, in any case.

Regards

Pete

Link to comment
Share on other sites

... it is also fairly easy for me to change WideClient slightly to try every few seconds to see if new joystick devices have been connected. I suppose there may be other occasions where this could be useful, in any case.

It was actually almost as easy to do it as to describe it, so here's Wideclient 6.755. Please try it and let me know. All it does is rescan the Windows joysticks 0-15 every 5 seconds even if it didn't see any on first initialisation.

Let me know.

Regards

Pete

WideClient6755.zip

Link to comment
Share on other sites

Hi Pete,

tried lots of things this night, also your new version which is not the solution.

It all boiled down to the same situation where my buttons do not get seen in FSUIPC

and that is when the wideclient is started before the wideserver is ready. Whatever I do in my client PC (delay start of wideclient with 20secs after start, dont start fscommunicator, start wideclient manually) if FS is not running yet. The client goes to waiting for connection and then I start my FSbuttons not seen.

When I start my FS first and only start the PC with the client afterwards (when FS has started) there is no issue.

On my FS PC I also start automatically project magenta FCU and AST server software via the intif lines in fsuipc.ini.

Thats it...

Greetz Peter

PS time to dig into the code? :-) Im off to sleep

Link to comment
Share on other sites

It all boiled down to the same situation where my buttons do not get seen in FSUIPC

and that is when the wideclient is started before the wideserver is ready.

So it is nothing whatsoever to do with the StartUp folder and WideClient getting started early?! Have you never ever before started WideClient first? You only discovered this when using the StartUp folder?

I don't understand how we exchanged so many messages before we found out we weren't talking about the same thing at all! :-(

Whatever I do in my client PC (delay start of wideclient with 20secs after start, dont start fscommunicator, start wideclient manually) if FS is not running yet. The client goes to waiting for connection and then I start my FSbuttons not seen. When I start my FS first and only start the PC with the client afterwards (when FS has started) there is no issue.

When WideClient is waiting for a connection, after FS is started and FS is ready, does WideClient connect? If it isn't connecting it cannot transmit button information!

If it is connecting but still not sending button data, there's something extra weird going on. Let me know, I may have to devise some logging options.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

all my PC's (4 of them) are starting wideclient at startup and then start the needed applications when the FS (wideserver) is ready. Never had any issue. I also never used buttons on a remotely connected joystick. Its only since last week I started using fscommunicator which made me move my joystick to that remote PC and have my buttons of my joystick being connected to a wideclient connected PC.

When FS is ready the wideclient is getting connected nicely and fscommunicator starts up (via runready in wideclient.ini) exchanging data with the server. Its purely these buttons which show some problem.

Sorry, if I caused extra work. I dont know how wideserver/wideclient do their communication but I assumed that the joystick buttons also are just like transfering data and this transfer never showed any problem if wideclient started first, waiting for the server. Since it was working when I closed wideclient and start it back up I assumed it had something to do with starting it at startup of the PC. Overlooking the fact that at that moment also FS was running already.

Greetz Peter

Link to comment
Share on other sites

all my PC's (4 of them) are starting wideclient at startup and then start the needed applications when the FS (wideserver) is ready. Never had any issue. I also never used buttons on a remotely connected joystick. Its only since last week ...

Okay. I'll have to work out how to find out what is going on.

There is nothing complicated about the button transmission to the Server, it is only setting or clearing bits in offsets exactly the same as FS Communicator is doing. So it must be something to do with the thread in WideClient which scans the buttons. Maybe, if FS isn't already running at start up, the thread doesn't get started. However, if that were always the case some things wouldn't work here either.

I'll get back to you.

Regards

Pete

Link to comment
Share on other sites

Okay. I'll have to work out how to find out what is going on.

I can't reproduce the problem here no matter what I do. I checked the code also, and the button scanning actions in WideClient are not at all related to its connection to the Server. So it remains a mystery at present.

Just in case it is related to a configuration setting, could you just run a simple test please. Rename the WideClient.INI file the problem client is using, so it doesn't get used, and allow WideClient to run purely on default settings. [i'm hoping here that you are using XP throughout and have WideFS automatically connecting. If not, let me know in case that is related, and just edit the default INI to insert your ServerName and Protocol parameters].

Let me know the result, and please show me or append the WideClient.INI file you normally use.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

we are making progress....I have removed wideclient.ini and started the client, then I started the FS. Buttons were seenas you also see it

Then I checked the differences between the newly created wideclient.ini and my settings. First impression, no many differences. Then i added the [user] section where I start the fscommunicator. Retested it, buttons seen immediately. Then I added two lines to the wideclient.ini : protocol=UDP and ServerName=10.0.0.5 (ip address of my FS PC). after adding those two lines I retested it and the buttons were not seen again.

So there lies the clue...how to link this to what we see...thats up to you...

For the moment its now Ok with me since the wideclient connects also without those two lines.

-> update : for the problem written below I was reading the document and I noticed the the serverName should have a name rather then the ipaddr So I changed it to ServerIPAddr=10.0.0.5 and then tested the buttons again but buttons are not seen again

I got only one remaining problem now. It must be related to fscommunicator I think because it started only when I started using that. Before this PC was used for the project magenta PFD/ND and when I shut my FS PC this PC also shut down. Now that I put fscommunicator wideclient shut the fscommunicator program and itself but it does not shut the PC anymore. Any idea?

-> update1 : if I close fscommunicator by hand and then shut FS2004 then the remote computer shuts down nicely

-> update2 : when I close FS2004 (FS communicator still running) then the computer does not shut down and I notice on the taskbar that it takes longer to close fscommunicator then wideclient itself

-> update 3 : there is already another post in this forum about this

called computer not shutting down using wideFS

and its also related to FS Communicator

is it difficult to introduce the same timeout as DelayReady1 after each close of an application

to try. I mean with RUNREADY1=xxxx and DELAYREADY1=y the program will wait some seconds after it started this appl then move on to the next. Can this wait also be done after each CLOSEREADY entry?

Greetz Peter

PS : if you still want to test something for this , just keep this thread going..i´ll be checking it daily

Link to comment
Share on other sites

Retested it, buttons seen immediately. Then I added two lines to the wideclient.ini : protocol=UDP and ServerName=10.0.0.5 (ip address of my FS PC). after adding those two lines I retested it and the buttons were not seen again.

Okay. Good clue. I try it with explicit Server/Protocol details here.

I was reading the document and I noticed the the serverName should have a name rather then the ipaddr So I changed it to ServerIPAddr=10.0.0.5 and then tested the buttons again but buttons are not seen again

I never understand why anyone ever uses explicit IP addresses in the first place. Isn't a name easier to read? My FS test Pc in the corner is called "CORNER". The one on its left is called "LEFT". I could never remember IP addresses anyway. And a lot of folks leave them dynamically assignable by their Router, so they couldn't realy on them anyway.

I got only one remaining problem now. It must be related to fscommunicator I think because it started only when I started using that. Before this PC was used for the project magenta PFD/ND and when I shut my FS PC this PC also shut down. Now that I put fscommunicator wideclient shut the fscommunicator program and itself but it does not shut the PC anymore. Any idea?

It sounds like FSCommunicator is not quite so well designed in this area and is hanging in its FSUIPC interrogation thread or section and not checking/obeying the Close message it gets from Windows.

is it difficult to introduce the same timeout as DelayReady1 after each close of an application to try. I mean with RUNREADY1=xxxx and DELAYREADY1=y the program will wait some seconds after it started this appl then move on to the next. Can this wait also be done after each CLOSEREADY entry?

The CloseReady is not so relevant to shutting the PC down. For PC shutdown all WideClient needs to do is call the Windows facility to ask it to close down the system. It is then Windows which sends closing messages to all of the processes.

I'll take a look, but I'm not sure there's a lot I can do. Has anyone written to the FSCommunicator chap about it? I'm sure it is something he could easily fix.

PS : if you still want to test something for this , just keep this thread going..i´ll be checking it daily

I may have another WideClient to try tomorrow. I'll look at the Close Down timing too, see if i can make WideClient hold out a bit longer. How many seconds does it need?

Regards

Pete

Link to comment
Share on other sites

PS : if you still want to test something for this , just keep this thread going..i´ll be checking it daily

Okay. Here's version 6.756 for testing.

The problem with the buttons was quite simple to see once I had the clues. In order for WideServer to assign a distinct Button number to pass to FSUIPC it needs to know the NAME of the client PC sending the button data. The names are kept in a list in the INI file and used to ensure consistency across many clients (up to 32 with buttons).

When TCP or IPX protocols are used, the connection is made before anything is sent in either direction. The computer name is sent to FS when it is connected,.

Equally, when you let the clients connect automatically, since they don't know what protocol to use nor which Server until they get the broadcast from WideServer, when the client sends the Computer name, FS is certainly running and can receive it.

The only combination which didn't work is UDP (which is connectionless) AND non-automatic connection. In this case the Client continually sends the Computer name and other stuff until it gets a responsethen it knows it is "connected". Unfortunately, however, the first part of what it sent in order to elicit the response is lost by then -- the server is responding to the last bit!

I've fixed it by repeating the computer name block after receiving something if this is more than 5 seconds since it last sent it. It seems to work fine here, now. Please verify on your set-up.

On the shutdown problem, I've changed it so that it does the closedown differently:

1. If there are Applications started by Wideclient and waiting to be closed, it sends them Close messages first, then tries to continue normally for 5 seconds before telling windows to close down.

2. If there are no applications it knows about, it does as now, immediate close down via Windows.

I've not been able to test this yet -- maybe I won't be till Friday. So please let me know.

Regards

Pete

WideClient6756.zip

Link to comment
Share on other sites

HI Pete,

I think the latest update is not good. The button case is still there. Do not see the joystick buttons again. Added to the first two lines in the ini file Protocol=UDP ServerIPAddr=10.0.0.5.

The shutdown is completely messed up I think. When I shut my FS PC I see on the remote PC FSCOMMUNICATOR being closed and started again iso closing, I think. Anyway, for sure I see it starting again since I see again the opening page appearing. Then some short time later, as well the window for wideserver closes as the fscommunicator but the PC does not shut down.

The idea you put forward to contact the chap from fscommunicator will be difficult since he stopped any development on his program some time ago (due to hackers who craked his code

and spread out an older version of his software for free on the net) However if you insist to him and pay some money he gives you the needed keys for activate the licenses of the latest version. If you like I can send you the latest version (without keys of course). Then you can start and use the program (full version) but after one hour it closes down and needs to be restarted.

So to get serious support (like you provide us) from him will be difficult I guess.

Of course we can always try but then we need to know exactly what wideclient is sending to

the process.

To start and stop I got the following lines:

[uSER]

AllowShutDown=yes

RUNREADY1=c:\FCOM\FSCOM.EXE

CLOSEREADY1=Yes

Greetz Peter

(PS tonight I can check with spy++ what exactly you are sending in the new version)

Link to comment
Share on other sites

I think the latest update is not good. The button case is still there. Do not see the joystick buttons again. Added to the first two lines in the ini file Protocol=UDP ServerIPAddr=10.0.0.5.

Hmm. Strange. It works every time here. Must be a timing difference. Maybe the 5 seconds is too long.

Could you set "Log=DebugAll" in the Wideclient.INI file (instead of the usual Log=Errors+), try again -- keep it as short as possible as the log will get big -- then Zip up the Log and send it to petedowson@btconnect.com? Thanks.

When I shut my FS PC I see on the remote PC FSCOMMUNICATOR being closed and started again iso closing, I think.

Not sure what you mean by "iso closing" ("instead of closing" perhaps), but I think I know what is happening. The connection from WideServer isn't yet severed, so it looks like a new connection so I should start any 2RunReady" programs again. I need to check the flag that I'm closing down, in another place.

Then some short time later, as well the window for wideserver closes as the fscommunicator but the PC does not shut down.

Do you mean Wideclient window, not WideServer here? Else I'm confused!

The idea you put forward to contact the chap from fscommunicator will be difficult since he stopped any development on his program some time ago

Oh, shame.

Of course we can always try but then we need to know exactly what wideclient is sending to the process.

Not WideClient. In the case of a Windows shut down, Windows will automatically send a WM_CLOSE message to all Windows. The problem will be that he is either not processing this when he thinks he is connected to FSUIPC, or has a separate thread for FSUIPC which he is not forcibly terminating when Windows says to close. It would probably be a deadlock if he is waiting for a response from a long-terminated FSUIPC or Wideclient.

Regards

Pete

Link to comment
Share on other sites

The button case is still there.

I'm a bit puzzled by this, because, whilst timing differences may just make it a little inconsistent, in general it should work most times irrespective of timing.

I was using 5 seconds -- if the Computer name block was sent more than 5 seconds ago, when the first data is received from the Server, then it is sent again.

The Client, when not receiving from the Server, normally repeats these every 20 seconds, so the chances of it occurring in the last 5 are small UNLESS it was this data to which the Server is responding, in which case all would be well.

The client polls the Server every 2 seconds (default), with a simply polling block, so it is possible for a polling block to come between a Computer data block and the receipt of data from the Server, within the last 5 seconds. But that can happen only in one 2.5 second period every 20 seconds (a 7-1 odds against).

See my puzzle? I will of course change my 5 second time to 1.5 x the polling interval (so, 3 seconds by default, which should guarantee things), but I am concerned now that there is something rather different going on with your system,nullifying the 7-1 odds against the buttons not being seen.

So, the log please, espcially if it is still failing with the version I attach below (with the new timing).

Version 6.756 also should certainly not restart any programs once shutdown is initiated. Let me know.

Regards

Pete

WideClient6757.zip

Link to comment
Share on other sites

Hi Pete,

you've done it somehow....

I tried only onestonight there will be more trials...

Now my buttons were working from the first time.

Anyway, i'll remove those lines with the protocol and the serverip in order to avoid any further

occurences of this.

When I shut down the FS, I saw on the remote computer fscommunicator closing down

and then wideclient stayed up for some time and eventually the wideclient closed down

followed by the computer...

Greetz Peter

Link to comment
Share on other sites

you've done it somehow....

I tried only onestonight there will be more trials...

I only changed 5 seconds to 3 seconds, so the odds were changed from 7 to 1 against it going wrong to definitely shouldn't go wrong. So, yes, please try a few times to be sure.

When I shut down the FS, I saw on the remote computer fscommunicator closing down

and then wideclient stayed up for some time and eventually the wideclient closed down

followed by the computer...

That sounds right, though when you say "stayed up for some time and eventually ...", does that appear too long now? It should only be 5 seconds AFTER the programs are closed properly. If a shorter time would be better I can do that easily, but I don't really want yet another adjustable parameter.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

just leave that at this 5 sec. You never know another appl needs also some time to shut down

and after all what is 5 secs when you want your PC to shut anyway.

For me is more important the PC shuts, so when I close FS all my cockpit PCs shut themselves

nicely and I dont find one of them still on the next day :-)

For the buttons i'll keep an eye on it for the coming days. Its quite important it works consistently since one of the buttons is the push to talk and like some days before I was talking to the controller but he wasnt responding to me. After some time I saw in the teamspeak that this wasnt sending since the PTT was not seen.

But I have now put 2 buttons to change the view so I verify here first if its working.

Ready for the next problem/question?

Maybe better a new thread?

Greetz Peter

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.