response timing with python

Hello -

I am having some trouble using my Cedrus RB-730 within a python program written with the PsychoPy library. I just need to record the exact time an observer makes a response on the response pad. Has anyone out there successfully done anything like that?

Here is a sample error I get from the python command line:

>>>>from psychopy import serial
>>>>from struct import unpack
Traceback (most recent call last):
File “<stdin>”, line 1, in ?
File “/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/psychopy/serial/”, line 142, in init
File “/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/psychopy/serial/”, line 146, in open
raise SerialException(“Could not open port: %s” % msg)
psychopy.serial.serialutil.SerialException: Could not open port: [Errno 2] No such file or directory: ‘/dev/cuaa0’


Alex White
University of Sydney

I don’t have any experience in the python area, but I can tell you that you’re not opening the correct serial port. The RB-830 I have connected to my machine right now is /dev/cu.usbserial-FT3DEE5S. The exact path to the serial port, however, depends on the serial number of the device.

If you have a copy of SuperLab 4, the available serial ports will show up in the RB Series Earlier Model Pad input dialog under the Setup tab (yes, earlier model, and not the RB-x30). If not, the latter portion of the path can be found in the Network settings in System Preferences. In the “Show” pop-up menu, select “Network Port Configurations.”

Of course, if you’re comfortable at the Unix terminal, you could also just type the following command to find the FTDI serial ports connected to your machine:

ls /dev/cu.usbserial*

If there isn’t an easy way to specify the exact path in your python utilities, you could do a soft link in the file system, but you’d need root (admin) access to do this, though I have a suspicion this solution may not survive a reboot due to the nature of the devfs file system.