EEG + Eye Tracker Experiment crashes, problem saving edf file

Hello everyone,
I am currently trying to run an EEG + Eye Tracker experiment in PsychoPy (v.2022.2.5) and Eye Link 1000 plus (v.5.09).
I obtained the EEG and ET script from a colleague from another university which had no problem with it. I have managed to make it run with my specific experiment perfectly with only EEG, but, when I include the ET a persistent error arises: when it is supposed to save the edf file and close the experiment, it crashes and an error from outside of psychopy pops up. A temporal edf file is created, but not a permanent one.
The pop up window says: “Psychopy stopped working. The program stopped working correctly due to an issue. Windows will close the program and will notify yo if there is any solution.”

The line where we obtain the error in our code is:
eyeTracker.receiveDataFile(dataFileName, local_file_name)

and the error we obtain is:
AttributeError: ‘NoneType’ object has no attribute ‘get_input_key’
Fatal Python error: (pygame parachute) Segmentation Fault
Python runtime state: initialized

We think that it has something to do with pygame and maybe the screen?

We have contacted SR Research Support Staff and they provided us with sample experiments which worked perfectly in the same computer and in the same Psychopy environment, after comparing those to ours, we dont seem to find where the problem is.
I would very much appreciate any type of insights or comments!!

Hi,

Were you able to find a solution to this issue? I am having the same problem. My project is just ET, it does not include EEG. The error is occurring in the line where I call receiveDataFile() and the same line of code works when I run the sample code from SR Research. Any help would be appreciated!

Hello Tiffany,
we did solve it! The problem for us was that in the script, we closed the edf file too early.

This is what we had:

This is our working script:

I hope this helps you out!

Thank you! The problem persisted when I tried this solution, but, as a backup, I was able to access the host PC’s file manager on the display PC by entering the host PC’s IP address in the address bar of a web browser on the display PC.