isolver / ioHub

A Python program, running as an independent process, that provides a 'proxy like' service for experiment runtimes ( psychopy ) and devices ( keyboard, mouse, parallel port, eye tracker, ... ).
19 stars 14 forks source link

ioHub SMI eyetracker device creation Psychopy 1.84.2 #83

Open hannehuygelier opened 7 years ago

hannehuygelier commented 7 years ago

The launchHubServer function to create a device that refers to the SMI RedM eyetracker throws a Yaml scanner error (in Psychopy 1.84.2). I checked the yaml file that contains the description of my device that I refer to in the launchHubServer function and I cannot find any formatting errors (extra tabs, etc...). I also double checked with an online tool called "YAML Lint". I also did the same check for the "default_eyetracker.yaml" file that is located in this folder: "C:\Python27\Lib\site-packages\psychopy\iohub\devices\eyetracker\hw\smi\iviewx". So the YAML scanner error must be coming from a different YAML file, but I have no idea which one.

This is the error that I get:

Error

during device creation .... <class 'yaml.scanner.ScannerError'> ScannerError() [' File "C:\Python27\lib\site-packages\psychopy\iohub\server.py", line 591, in createNewMonitoredDevice\n device_instance_and_config=self.addDeviceToMonitor(device_class_name,deviceConfig)\n', ' File "C:\Python27\lib\site-packages\psychopy\iohub\server.py", line 754, in addDeviceToMonitor\n self.processDeviceConfigDictionary(device_module_path, device_class_name, device_config,default_device_config)\n', ' File "C:\Python27\lib\site-packages\psychopy\iohub\server.py", line 564, in processDeviceConfigDictionary\n device_config_errors=validateDeviceConfiguration(device_module_path,device_class_name,device_config_dict)\n', ' File "C:\Python27\lib\site-packages\psychopy\iohub\devices\deviceConfigValidation.py", line 423, in validateDeviceConfiguration\n device_settings_validation_dict=loadYamlFile(validation_file_path,print_file=True)\n', ' File "C:\Python27\lib\site-packages\psychopy\iohub\devices\deviceConfigValidation.py", line 351, in loadYamlFile\n yaml_file_contents=load(file(yaml_file_path,\'r\'), Loader=Loader)\n', ' File "C:\Python27\lib\site-packages\yaml\init.py", line 71, in load\n return loader.get_single_data()\n', ' File "C:\Python27\lib\site-packages\yaml\constructor.py", line 37, in get_single_data\n node = self.get_single_node()\n', ' File "C:\Python27\lib\site-packages\yaml\composer.py", line 36, in get_single_node\n document = self.compose_document()\n', ' File "C:\Python27\lib\site-packages\yaml\composer.py", line 55, in compose_document\n node = self.compose_node(None, None)\n', ' File "C:\Python27\lib\site-packages\yaml\composer.py", line 84, in compose_node\n node = self.compose_mapping_node(anchor)\n', ' File "C:\Python27\lib\site-packages\yaml\composer.py", line 133, in compose_mapping_node\n item_value = self.compose_node(node, item_key)\n', ' File "C:\Python27\lib\site-packages\yaml\composer.py", line 84, in compose_node\n node = self.compose_mapping_node(anchor)\n', ' File "C:\Python27\lib\site-packages\yaml\composer.py", line 133, in compose_mapping_node\n item_value = self.compose_node(node, item_key)\n', ' File "C:\Python27\lib\site-packages\yaml\composer.py", line 84, in compose_node\n node = self.compose_mapping_node(anchor)\n', ' File "C:\Python27\lib\site-packages\yaml\composer.py", line 133, in compose_mapping_node\n item_value = self.compose_node(node, item_key)\n', ' File "C:\Python27\lib\site-packages\yaml\composer.py", line 64, in compose_node\n if self.check_event(AliasEvent):\n', ' File "C:\Python27\lib\site-packages\yaml\parser.py", line 98, in check_event\n self.current_event = self.state()\n', ' File "C:\Python27\lib\site-packages\yaml\parser.py", line 449, in parse_block_mapping_value\n if not self.check_token(KeyToken, ValueToken, BlockEndToken):\n', ' File "C:\Python27\lib\site-packages\yaml\scanner.py", line 116, in check_token\n self.fetch_more_tokens()\n', ' File "C:\Python27\lib\site-packages\yaml\scanner.py", line 257, in fetch_more_tokens\n % ch.encode(\'utf-8\'), self.get_mark())\n'] Error during device creation .... <class 'psychopy.iohub.util.exception_tools.ioHubError'> ioHubError: Args: ('Error during device creation ....',)

[' File "C:\Python27\lib\site-packages\psychopy\iohub\server.py", line 520, in init\n self.createNewMonitoredDevice(device_class_name,deviceConfig)\n', ' File "C:\Python27\lib\site-packages\psychopy\iohub\server.py", line 603, in createNewMonitoredDevice\n raise ioHubError("Error during device creation ....")\n'] <class 'psychopy.iohub.util.exception_tools.ioHubError'> ioHubError: Args: ('Error during device creation ....',)

[' File "C:\Python27\lib\site-packages\psychopy\iohub\launchHubProcess.py", line 35, in run\n s = ioServer(rootScriptPathDir, ioHubConfig)\n', ' File "C:\Python27\lib\site-packages\psychopy\iohub\server.py", line 524, in init\n raise ioHubError("Error during device creation ....")\n'] Traceback (most recent call last): File "C:\Dropbox\PHD_MultisensoryNeglect\ExperimentScripts\BasicEyeTracking\IoHubTest.py", line 27, in io = launchHubServer(iohub_config_name = "iohub_config_SMI.yaml") File "C:\Python27\lib\site-packages\psychopy\iohub\client__init.py", line 1504, in launchHubServer return ioHubConnection(ioConfig) File "C:\Python27\lib\site-packages\psychopy\iohub\client\init.py", line 285, in init self.iohub_status = self._startServer(ioHubConfig, ioHubConfigAbsPath) File "C:\Python27\lib\site-packages\psychopy\iohub\client\init.py", line 943, in _startServer isDataAvail=self._serverStdOutHasData() File "C:\Python27\lib\site-packages\psychopy\iohub\client\init__.py", line 1052, in _serverStdOutHasData raise e pywintypes.error: (109, 'PeekNamedPipe', 'The pipe has been ended.')

And this is my code:

`#============================================================================#

Figuring out IoHub for Eyetracking with SMI RedM eyetracker

Date: 10/03/2017

Author: Hanne Huygelier

============================================================================

-----------------------

LIBRARIES:

-----------------------

from psychopy import iohub, monitors from psychopy.iohub import launchHubServer, devices import os

---------------------------------

FOLDERS

---------------------------------

RootFolder = os.getcwd()

EyeTrackerFile = RootFolder + "\" + 'default_eyetracker.yaml'

---------------------------------

Initialize Monitor & EyeTracker

---------------------------------

mon = monitors.Monitor("00.68", distance = 50, width = 52) mon.setSizePix([1920, 1080]) mon.saveMon()

io = launchHubServer(iohub_config_name = "iohub_config_SMI.yaml")`

I posted this here instead of stackoverflow, because I think it might be a bug, but I'm not 100% sure.

Any help would be much appreciated!