Iohub_server_response_error

I am trying to run a eye-tracking experiment, I would like to use the Eyelink 1000 to capture eye movements. I am experiencing difficulties starting the iohub server.

A snippet of the code im using:

class ExperimentRuntime(ioHubExperimentRuntime):
    def run(self,*args):
        # Use the follofing settings for the eyelink 
        win = visual.Window(size=(1920,1080), fullscr=False, units='norm', monitor='Eyelink', color='white',winType='pyglet')

        #set up iohub connection
        tracker=self.hub.devices.tracker
        display=self.hub.devices.display
        kb=self.hub.devices.kb
        mouse=self.hub.devices.mouse
        KEYBOARD_PRESS=EventConstants.KEYBOARD_PRESS

        #calibrate
        tracker.runSetupProcedure()

        flip_time=win.flip()
        
        self.hub.sendMessageEvent(text="EXPERIMENT_START",sec_time=flip_time)
        self.hub.sendMessageEvent(text="IO_HUB EXPERIMENT_INFO START")
        self.hub.sendMessageEvent(text="ioHub Experiment started {0}".format(getCurrentDateTimeString()))
        self.hub.sendMessageEvent(text="Stimulus Screen ID: {0}, Size (pixels): {1}, CoordType: {2}".format(display.getIndex(),display.getPixelResolution(),display.getCoordinateType()))
        self.hub.sendMessageEvent(text="Calculated Pixels Per Degree: {0} x, {1} y".format(*display.getPixelsPerDegree()))
        self.hub.sendMessageEvent(text="Participant ID: {0} START".format(expInfo['ParticipantID']))
        self.hub.sendMessageEvent(text="IO_HUB EXPERIMENT_INFO END")
        self.hub.clearEvents('all') 


I keep getting the following error:
The following is the full error

Error trying to send data to experiment process:
max_size: 32748
data length: -1
num_packets: -1
=============================
##### Running: C:\Users\shd-cobelab-user\Desktop\RFExperiment\ReadingEXP_eyetracking.py #####
Error trying to send data to experiment process:
max_size: 32748
data length: -1
num_packets: -1
=============================
<type 'exceptions.TypeError'>
TypeError('Cannot serialize 19',)
['  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\psychopy\\iohub\\server.py", line 282, in sendResponse\n    packet_data = self.pack(data)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 738, in pack\n    self._pack(obj)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 726, in _pack\n    self._pack(obj[i], nest_limit - 1)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 735, in _pack\n    raise TypeError("Cannot serialize %r" % obj)\n']
=============================
Data was [('RPC_RESULT', 'setExperimentInfo', 19)]
IOHUB_SERVER_RESPONSE_ERROR
False
2.2808 	ERROR 	avbin.dll failed to load. Try importing psychopy.visual
  as the first library (before anything that uses scipy)
  and make sure that avbin is installed.
<type 'exceptions.TypeError'>
TypeError('Cannot serialize 19',)
['  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\psychopy\\iohub\\server.py", line 282, in sendResponse\n    packet_data = self.pack(data)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 738, in pack\n    self._pack(obj)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 726, in _pack\n    self._pack(obj[i], nest_limit - 1)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 735, in _pack\n    raise TypeError("Cannot serialize %r" % obj)\n']
ioHub Server Process Completed With Code:  0

Who can help with this please.

Firstly:

Secondly, was that the whole error message?

Hi Michael,
Thank you for your fast respons, I am new to the forum and appreciate the comments.
I have updated the post with the full message, and changed the code.
What happens is that i run the code, and the following pops up:

Error trying to send data to experiment process:
max_size: 32748
data length: -1
num_packets: -1
=============================
<type 'exceptions.TypeError'>
TypeError('Cannot serialize 19',)
['  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\psychopy\\iohub\\server.py", line 282, in sendResponse\n    packet_data = self.pack(data)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 738, in pack\n    self._pack(obj)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 726, in _pack\n    self._pack(obj[i], nest_limit - 1)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 735, in _pack\n    raise TypeError("Cannot serialize %r" % obj)\n']
=============================
Data was [('RPC_RESULT', 'setExperimentInfo', 19)]
IOHUB_SERVER_RESPONSE_ERROR

Then it starts my experiment, and connects to the eyelink calibration screen, however it will not start the calibration and the screen is stuck, keyboard does not respond to any entry except ESC. Following the ESC it produces the following message:

False
2.2808 	ERROR 	avbin.dll failed to load. Try importing psychopy.visual
  as the first library (before anything that uses scipy)
  and make sure that avbin is installed.
<type 'exceptions.TypeError'>
TypeError('Cannot serialize 19',)
['  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\psychopy\\iohub\\server.py", line 282, in sendResponse\n    packet_data = self.pack(data)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 738, in pack\n    self._pack(obj)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 726, in _pack\n    self._pack(obj[i], nest_limit - 1)\n',
 '  File "C:\\Program Files (x86)\\PsychoPy2\\lib\\site-packages\\msgpack\\fallback.py", line 735, in _pack\n    raise TypeError("Cannot serialize %r" % obj)\n']
ioHub Server Process Completed With Code:  0

The false is not a part of the message, I just tried to debug.

I found the issue related to the iohub_server_response_error. It was related to the experiment_config.yaml where I had indicated an additional user variable that should not have been there.

1 Like