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

getDATA() function keeps timing out #258

Closed
ericjhkim opened this issue Aug 12, 2021 · 7 comments
Closed

getDATA() function keeps timing out #258

ericjhkim opened this issue Aug 12, 2021 · 7 comments

Comments

@ericjhkim
Copy link

I can send data to X-Plane 11 using the plugin's functions, but everytime I try calling the getDATA() function, I get an error message saying that the UDP timed out.

My code (Python 3, Windows 10):
`import xpc
import numpy as np

client = xpc.XPlaneConnect() # UDP connector
client.readDATA()`

Error message:
xplanetimeout

Perhaps I'm not using the function correctly? Strangely, all the other functions seem to work such as getDREF().

@jason-watkins
Copy link
Contributor

Unfortunately network issues are basically impossible to diagnose remotely. No one has ever been able to convincingly suggest that the XPC plugin is at fault, but it is odd that the other functions work. Posting your XPCLog.txt here so I can examine it would be the first step in trying to figure out what's going on.

@ericjhkim
Copy link
Author

ericjhkim commented Aug 13, 2021

For sure. This is the log file.
XPCLog2.txt

Up to 18:10:00, I was running the code outlined above with just the getDATA() function repeatedly. It looks like nothing is happening. After 18:10:00, I sent some data to X-Plane using the following code:

`
client = xpc.XPlaneConnect() # UDP connector

data = [
[18, 0, -998, 0, -998, -998, -998, -998, -998],
[ 3, 130, 130, 130, 130, -998, -998, -998, -998],
[16, 0, 0, 0, -998, -998, -998, -998, -998]
]
client.sendDATA(data)
`

I've also attached a couple more images of the in-game settings:
xplane_settings
xplane_settings_2

From the log file, it looks like the sendDATA() function is working (albeit with some errors), but I don't think it's interfering with the readDATA() function, because if I run readDATA() first, all I get is the typical "INFO|SOCK|Send succeeded." log message.
Of course, I don't really expect anything to happen when I call readDATA(), since it's returning a error on the Python terminal.

@ericjhkim
Copy link
Author

ericjhkim commented Aug 13, 2021

Interestingly, running just getDATA() on MATLAB tells me:

xplane_getDATA_MATLAB

MATLAB code:
`
%% Import XPC
addpath('../')
import XPlaneConnect.*
%% Setup
% Create variables and open connection to X-Plane

disp('xplaneconnect Example Script-');
disp('Setting up Simulation');
Socket = openUDP('127.0.0.1', 49009);

readDATA();
`

(I'm also receiving the same timeout error on Python 2 as well.

@jason-watkins
Copy link
Contributor

Okay, I have to admit that I'm confused here. The DATA functions have always been a source of issues, and we've never really been able to make them work well, but as I'm looking at the client code now, I don't understand how it's supposed to work at all (yes, I wrote the client code, but it's been years since I've looked at this particular code closely). It seems like it just blindly reads expecting something to be there, but I don't see anything in the plugin that would be constantly sending data, and even if it was it would break pretty much every other function in the client.

@ericjhkim
Copy link
Author

Ah alright, unfortunately, I'm not too well versed in network theory. Regardless, the getDREF function seems to work fine, so I'm thinking I can probably just use that to collect the data I need? I'm not quite sure what the difference is between general data and dataref, but I think all the general data values can be accessed through getDREF.

@jason-watkins
Copy link
Contributor

Yeah, my standard advice when people run into issues with DATA is that the DREF functions can do 99.9% of the work that DATA can.

@ericjhkim
Copy link
Author

Thanks for the help. I do appreciate your time and this plugin.

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

No branches or pull requests

2 participants