-
Notifications
You must be signed in to change notification settings - Fork 9
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
Help needed: "Failed to initialize EyeTribe object in the Server" #9
Comments
Hi Hannah, Thanks for the clear report! I'm not entirely sure what is happening, but some quick suggestions:
Some more information could come from the EyeTribe's log. Could you access it, and copy the relevant entries in here? Cheers, |
Hi Edwin, thank you for your super speedy reply.
Matlab Command Window:
Terminal:
The log fie (you mean the file that I pass through matlab when calling init-eyetribe(), right?) contains the title line: Any clue what could be going on? Thank you!! Hannah |
So, the program gets stuck in eyetribe_send_command in the while loop at the bottom because the BytesAvailable doesn't get larger than 0. This is what connection contains: TCPIP Object : TCPIP-localhost Communication Settings Communication State Read/Write State |
Hi Hannah, Sorry, my bad about explaining the port number badly. There are two port numbers. One is for the connection between Python and the EyeTribe. This is 6555, as is the default for the EyeTribe. If you haven't changed that setting, you should be good. (You can find this default value in pytribe.py, and you shouldn't change it without also changing the actual EyeTribe!). The other port number is for the connection between Python and Matlab. This defaults to 5666, but the actual value doesn't really matter. As long as you make sure it's the same between the Python source and eyetribe_init.m. You should also make sure that all port numbers are available on your machine, otherwise you get the error you had after you changed the port numbers (Matlab listening/taling via the same connection as the EyeTribe, meaning that Python couldn't understand what Matlab was saying.) Usually, the default numbers are free and allowed. For debugging, I actually meant the EyeTribe's log. You can find this in the AppData folder on Windows (e.g. Cheers, |
Hi Edwin, okay, it is solved! I did not initiate the EyeTribe unix executable from the EyeTribe SDK. When I open this in Terminal it opens the connection to the EyeTribe, I then start the python script followed by the Matlab script and ....tadaaaaa! It is running! It was probably obvious to most other people that this is the way it should be done... For those who did not, I hope my description helps. Thank you for your speedy replies Edwin! Cheers, |
Hi Edwin, I met a few people this week who are also using your scripts to get their EyeTribes running and indeed they ran into the same problem (Mac users). Can I add this part about starting the EyeTribe executable over terminal in MacOS to your documentation? I think it would make it very simple for many users to get started.
Hannah |
@HannaHMK I am having this exact same issue but I'm not using any python scripts. Do you know the cause of the fwrite error? My script worked fine on an older laptop, but it is no longer reliable and I'm trying to transfer the code to a more stable machine. |
@Beuks: Did you follow the instructions here and elsewhere? I.e. start the EyeTribe Server in a terminal; run the Python script as mentioned above in an additional server (this is the additional server that bridges Matlab and the EyeTribe server); then run your Matlab script. |
@esdalmaijer I have followed the instructions both here and under another commit with a similar issue that was solved using the instructions in this thread. So far I either still get the fwrite error, or Matlab gets stuck on busy. Admittedly, I don't have much experience using terminal commands, so it's possible I'm setting it up incorrectly |
@Beuks, would you be able to share what the different terminals say? That is:
|
@esdalmaijer I've got a different issue now so potentially progress? 1. Text in the Terminal that runs the EyeTribe Server [13:37:49.263] INF: Initializing environment ** The EYE TRIBE TRACKER Server ** Version: 0.9.77 Settings applied: Initializing the Eye Tribe Server The Eye Tribe Tracker stands ready! [13:37:52.403] INF: Default calibration profile loaded! 2. Text in the Terminal that runs Python C:\Users\steve\Documents\MATLAB\EyeTribe-Toolbox-for-Matlab-master\python_source>python EyeTribe_Matlab_server.py Starting new socket connection (ip=localhost, port=5666). During handling of the above exception, another exception occurred: Traceback (most recent call last): 3. Text in the Matlab window There is no text this time, it gets stuck on Busy. I used to open the EyeTribe_Matlab_server.exe within the EyeTribe_for_Matlab folder without issue. Doing that now gives the fwrite error discussed in this thread. Following these new steps gives the above output. If I Ctrl+C the Matlab script to force cancel, I get this output (full text from opening Matlab and cancelling script): PsychStartup: Adding path of installed GStreamer runtime to library path. [D:\gstreamer\1.0\x86_64\bin]
ans =
Opening new connection. In instrument/get (line 49) In instrument/subsref (line 117) In eyetribe_send_command (line 22) In eyetribe_init (line 23) In SYMMETRY_EyeTribe (line 42) |
Ahhhh, yes! Try running the Python script using Python 2 rather than 3. I realise Python 2 is no longer supported (as of 1 Jan), but this is an older project, and the long-term stable should be fine for now. |
@esdalmaijer Okay I'm back to getting the same fwrite error with python 2.7.16 (should I downgrade python even further?). As above, here are the outputs of each terminal: 1. Text in the Terminal that runs the EyeTribe Server [14:34:28.137] INF: Initializing environment ** The EYE TRIBE TRACKER Server ** Version: 0.9.77 Settings applied: Initializing the Eye Tribe Server The Eye Tribe Tracker stands ready! [14:34:30.125] INF: Default calibration profile loaded! 2. Text in the Terminal that runs Python C:\Users\steve\Documents\MATLAB\EyeTribe-Toolbox-for-Matlab-master\python_source>python EyeTribe_Matlab_server.py 3. Text in the Matlab window
ans =
Opening new connection. a bunch of PTB-INFO lines appear here but that's normal Starting calibration. Error in eyetribe_send_command (line 17) Error in eyetribe_calibrate (line 44) Error in SYMMETRY_EyeTribe (line 52) |
@esdalmaijer solved! It turns out I forgot to pre-create a raw data folder for the eyetribe to store the gaze data inside. Because the errors were similar to the ones in this thread, I thought it was the same problem. I mistakenly assumed matlab would generate the folder itself on the fly. Rookie mistake! |
Ohhhh, that makes sense now! I guess the error message for the initial connection should be more specific about what prevented the EyeTribe instance to be initialised in the Python server. |
Hi EyeTribe for Matlab writer and users,
first of all: Thank you Edwin for posting this script!
I am trying to set up an EyeTribe experiment, but the initialization is not working out for me. Python is running, I call (for example) the script 'EXAMPLE.m' or 'EXAMPLE_PTB.m' and get this message printed in the command window in Matlab:
and this printed in the Terminal:
Has anyone had this problem? And/Or does anyone have suggestions on what to do?
Help is vastly appreciated!
Hannah
PS: I use a Mac (OS X El Capitan), Matlab 2014b with the latest PTB and also the latest version of Python.
The text was updated successfully, but these errors were encountered: