dcnieho / Titta

Matlab and PsychToolbox interface to Tobii eye trackers using Tobii Pro SDK
Other
42 stars 15 forks source link

No connection to TobiiProLab on second computer #102

Open ninaalisahinz opened 3 hours ago

ninaalisahinz commented 3 hours ago

Hello team,

we have a two-computer-setup with Matlab & Titta being on one computer (Linux, Ubuntu 24.04), and TobiiProLab, the Tobii Eye Tracker Manager on the other computer (Windows 10 Educational). The eyetracker is also connected to the computer with TobiiProLab.

When trying to establish a connection with talkToProLab we always get the following error

TalkToProLab('Project28', true, '134.100.144.165') Error using assert TalkToProLab: Could not connect to clock service, did you start Tobii Pro Lab and open a project?

Error in TalkToProLab (line 64)
assert(this.clientClock.Status==1,'TalkToProLab: Could not connect to clock service, did you start Tobii Pro Lab and open a project?');

We run a lot of diagnostics and

So it cannot be due to the port being busy or not open. It can also not be due to the different operating systems as we also get the same message when running the command from another windows computer. If running Titta from the TobiProLab-computer the connection is established and we can run the example experiment.

So I guess it is due to Titta not being able to connect to the client services but we have no idea why. Has anyone ever used Titta in a two-computer-setup and maybe done some magic to make it work? Or does anyone have an idea of further diagnostics/workarounds we could try?

Very thankful for any help! Nina

ninaalisahinz commented 3 hours ago

P.S. also deactiving the clock service in the TalkToProLab command (so TalkToProLab('Project28', false, '134.100.144.165') unfortunately gives the same error.

dcnieho commented 3 hours ago

Hi Nina,

Thank you for your interest in Titta and this functionality! Running a two computer setup has never been tested and is not officially supported. I am surprised you do not run into this error https://github.com/dcnieho/Titta/blob/master/talkToProLab/TalkToProLab.m#L125, and see also the documentation here and on line 31 of TalkToProLab.m.

What version of Pro Lab are you using? There was a bug in 1.207.44884 where it would refuse remote connections completely, but it seems you get past that at least, so i guess that is fixed.

To test, can you run the following (if Python is ok):

import logging
logger = logging.getLogger('websockets')
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())

import asyncio
import websockets

async def hello():
    async with websockets.connect("ws://127.0.0.1:8080/record/externalpresenter?client_id=RemoteClient") as websocket:
        await websocket.send("Hello world!")
        await websocket.recv()

asyncio.run(hello())

changing the localhost ip to the one of the other machine and see if the connection is properly established (It'll error as this code sends a message that is not understood, but that is ok).

If it is not possible for you to run a single computer setup (I'd recommend that), I'd be happy to guide you to make it work with two computers. But note the trouble from the documentation that we'll have to implement time sync logic needed to convert stimulus computer timestamps to the time of the remote computer running pro lab.

I am just off on holiday for a week. Looking forward to hearing how you plan to continue.