Psychopy and Cedrus Lumina LSC-400

Dear All,

I am desperately seeking help with integration of Cedrus Lumina response pads with PsychoPy…I’m using Psychopy (1.84.1) on Windows 7. The Lumina box is working fine with Presentation, E-prime and PsychToolBox. It’s connected via a Sunix serial interface card, with the serial port assigned to be COM1.

I have posted this on the Cedrus support forum, but haven’t had any feedback.

If I just add in the Cedrus module into a standard builder view experiment in psychopy then run it, I get the following output:

ERROR could not find a Cedrus device

If instead I create a python script (using the CEDRUS suggested code) and put the following in:

import pyxid

# get a list of all attached XID devices
devices = pyxid.get_xid_devices()
devices = pyxid.get_xid_devices() # based on the suggestion that you might need to run this twice

dev = devices[0] # get the first device to use
if dev.is_response_device():
    dev.reset_base_timer()
    dev.reset_rt_timer()

    while True:
        dev.poll_for_response()
        if dev.response_queue_size() > 0:
            response = dev.get_next_response()
            # do something with the response

Then I get the following:

####### Running: C:\Users\fmri\Documents\PsychoPy\cedrusTest2\newte st.py #######
Traceback (most recent call last):
File "C:\Users\fmri\Documents\PsychoPy\cedrusTest2\newt est.py", line 6, in <module>
devices = pyxid.get_xid_devices()
File "build\bdist.win32\egg\pyxid\__init__.py", line 19, in get_xid_devices
File "build\bdist.win32\egg\pyxid\pyxid_impl.py", line 17, in __init__
File "build\bdist.win32\egg\pyxid\serial_wrapper.py ", line 27, in available_ports
File "build\bdist.win32\egg\pyxid\serial_wrapper.py ", line 72, in available_ports
File "C:\Program Files\PsychoPy2\lib\site-packages\serial\serialwin32.py", line 31, in __init__
super(Serial, self).__init__(*args, **kwargs)
File "C:\Program Files\PsychoPy2\lib\site-packages\serial\serialutil.py", line 162, in __init__
self.port = port
File "C:\Program Files\PsychoPy2\lib\site-packages\serial\serialutil.py", line 206, in port
raise ValueError('"port" must be None or a string, not {}'.format(type(port)))
ValueError: "port" must be None or a string, not <type 'int'>

Please can anyone help with this as I was hoping to use the Lumina with PsychoPy to run an experiment this week - and I’m completely stuck without it.

Best wishes,

Jon

I don’t know if you’ve seen this, but this seems to be a known issue with the pyxid module:

It may be worth reviving that thread to see if they can help you out.

Actually this is a matter of having the right version of pyserial to match with the current version of pyxid. The latest version of pyserial and the latest version of pyxid together are fine. PsychoPy 1.85 will provide these in the Standalone

Thanks for the hints - I had spotted that message, and was going to try updating pyxid, which appears to have been patched(?). However, I’m now worried that I might be making more problems for myself.

Given that 1.85 isn’t available yet (?), and that I need to run a demo on the scanner next Monday, is there an easy way to get hold of the latest pyserial and pyxid?

Apologies for the dumb question, but I’m no python expert - I have run pip install on the Mac before to update things, but I’m not sure whether this will work with the standalone version of PsychoPy that I installed on this particular Windows machine.

Any advice would be much appreciated.

Best,

Jon

Thanks Jon & Jan (from Jon) - weird…

I bit the bullet and installed PsychoPy/Python2.7/etc/etc by hand, and finally worked out how to install the github version of pyxid - all good fun…

Of the packages listed for manual install on psychopy.org there were a few (scipy, lxml, numexpr) that failed to install using the conventional pip install. Apparently this is quite common, a bit of digging around and I found that there were pre-built binaries to be found here (http://www.lfd.uci.edu/~gohlke/pythonlibs/). Once you’ve downloaded the appropriate version for your machine. Note: download for the appropriate python “cp27” and Windows OS version 32/64bit “e.g. win32” you have installed.

My best guess is that the simple install failed some dependency and so tried to resort to building the package (and since there’s no gcc or Visual C++ installed on this machine it failed spectacularly).

The good news is that all is well - PychoPy can now “see” the Lumina LSC-400 and I can record button presses etc.

Thanks for all the pointers and suggestons…hope the extra bits I included help someone.

Cheers, Jon

Uh-oh - spoke too soon.

If I add the cedrus module from the Builder view, and click run I get:

ImportError: No module named pyxid

Where does PsychoPy expect to find these modules?

I guess I didn’t manage to install pyxid properly - any help would be much appreciated.

Best,

Jon

Sorry for cross posting - the solution was there of course…