marcus-nystrom / Titta

Python and PsychoPy interface to Tobii eye trackers using Tobii Pro SDK
Other
64 stars 27 forks source link

TalkToProLab - Issue with External Presenter Communication #48

Closed jojoschmitt closed 8 months ago

jojoschmitt commented 9 months ago

Hey everyone,

We have been trying to get the demo experiment read_me_TalkToProLab.py running. Before I continue, I want to apologize for the potential lack of information. We currently have no access to a Tobii Pro Lab version that supports creating an external presenter project. We did, however, and will hopefully have access soon again. Now here is the issue:

After opening Tobii Pro Lab and creating an external presenter project, the execution of the read_me_TalkToProLab.py crashes with an unmet exception when calling ttl.get_state() in line 111.

As you can imagine, everything else that comes before works as intended. We can create a participant and several AOIs that are also visible in the Tobii Pro Lab project after incomplete execution. The exception unmet is probably thrown in respones of the message get_state() wants to send in file TalkToProLab.py in line 533 et seqq.

response = self.send_message(self.external_presenter_address,
                                      {"operation": "GetState"})  

assert response['status_code'] == 0, response

However, at this point in time, the demo script has already sent a message when calling ttl.add_participant() in line 59.

The only remarkable differene between the two calls to ttl.send_message() is the adress of the receiving web socket that is being used. When adding a participant the project_adress is used. When requesting the state, the external_presenter_adress is used.

Could there be an issue with the external_presenter_adress or why does the Tobii Pro Lab web socket report the unmet status?

Thanks for your help!

jojoschmitt commented 9 months ago

Hey, so turned out Tobii's external presenter was really not ready to receive messages on the external_presenter_adress. The reason for this is very simple though: Tobii Pro Lab does not start the websocker server for the external presenter unless the Record tab in Tobii Pro Lab is selected. So remaining on the Project overview tab after creating the external presenter project does not suffice to get the read_me_TalkToProLab.py working.

I leave this issue open with the request to extend on point 3 in chapter To get started with the Tobii Pro Lab integration of your README.md. Please make clear that people also need to switch to the Record tab for the communication with Tobii Pro Lab to work.

Thanks!

marcus-nystrom commented 8 months ago

Thanks for the feedback! The README has been updated.