Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second client cannot get datarefs #57

Open
Djeez2 opened this issue Nov 3, 2019 · 7 comments
Open

Second client cannot get datarefs #57

Djeez2 opened this issue Nov 3, 2019 · 7 comments
Labels

Comments

@Djeez2
Copy link

Djeez2 commented Nov 3, 2019

When a second client subscribes to a dataref that is already subscribed to, it does not get its value. Only when the dataref changes lateron, it will receive the value.
There is no way for the second client to synchronize on connection, even the (undocumented) 'get' function does not provide the current dataref value.

@vranki vranki added the bug label Nov 11, 2019
@vranki
Copy link
Owner

vranki commented Nov 11, 2019

Thanks for reporting. Needs to be studied & fixed.

@vranki
Copy link
Owner

vranki commented Dec 9, 2019

Tested this:

  • connected 2 clients

  • client 1 says sub , gets update

  • client 2 says sub , gets update

    -> it gets it's value so the bug is not reproducible here.

On the get command I noticed it's indeed undocumented and didn't work on the second client.
This is now fixed.

Could you try with latest build and write a easy to reproduce script for me to test this if the bug still happens?

@Djeez2
Copy link
Author

Djeez2 commented Jun 5, 2020

Sorry for getting back to you so late.
The ExtPlane from Dec 2019 crashes on startup (XPlane 11.41, Windows 10) so I tested with the Nov 2019 version. This seems to work fine, although rigorous testing is difficult as I have two small IoT devices with limited debug capabilities.
Now that I have more experience with XPlane plugins, it could be that my earlier observations were cluttered by the fact that I did not realize that you have to subscribe to the datarefs when switching aircraft, since not all datarefs are available for all aircraft. My strategy now is to subscribe to all datarefs I need whenever the aircraft ICAO code changes. Hopefully by then all required datarefs are available. Please advise if this is the wrong way to handle the datarefs.
Thanks for all your efforts, I really like ExtPlane.

@vranki
Copy link
Owner

vranki commented Jun 6, 2020

Hm, I haven't actually tested much what happens if you change aircraft. This might reveal a bug. If there is a repeatable crash, please let me know.

@Djeez2
Copy link
Author

Djeez2 commented Jun 6, 2020

I tested some scenarios. It is not related to aircraft change, nor to the startup. If I have X-Plane started with the default Cessna 172, with my instruments off, everything starts normal.
If I then power on my instruments they will connect to ExtPlane and at that moment X-Plane crashes (consistently). I believe this is the same issue as #58.
Note that this only occurs with the Dec 2019 version, the Nov 2019 version works fine.

@sum1els
Copy link
Collaborator

sum1els commented Jun 6, 2020

you will notice with Zibo too, there is a massive Lua script that create new datarefs when Zibo starts up. Obviously all those drefs are not there to begin with, so you have to subscribe after the plane loaded unfortunately. I ran into the same problem while developing ZHSI, so I subscribe to the ICAO and then when I noticed it is the Zibo, only then does it subscribe to the required datarefs.

btw, I have done a scaled down version of ExtPlane for ZHSI about a year ago when I was still doing it. It listens on port 52000, so it does not clash with ExtPlane if still installed. It can be found here: https://gitlab.com/sum1els737/zhsi-plugin and compiled versions are here: https://gitlab.com/sum1els737/zhsi-releases/-/tree/master/zhsi-plugin/64

@Djeez2
Copy link
Author

Djeez2 commented Jun 6, 2020

Indeed. I use a lot of custom Zibo datarefs as well so I have to subscribe to the datarefs whenever the Zibo plane is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants