LABSN / expyfun

Experimental paradigm functions.
BSD 3-Clause "New" or "Revised" License
13 stars 21 forks source link

Error using Cedrus box in 226 #274

Closed rkmaddox closed 8 years ago

rkmaddox commented 8 years ago

Trying to use the Cedrus box in 226. pyxid was not installed, so that was installed in Git Bash using pip install pyxid. Then when instantiating ExperimentController, response_device=cedrus was specified. Got the following error:

Traceback (most recent call last):
  File "C:\Users\labuser\Desktop\clds\CRM\exp_binaural.py", line 734, in <module>
    version='dev', response_device='cedrus') as ec:
  File "<string>", line 2, in __init__
  File "C:\Users\labuser\Desktop\clds\CRM\expyfun\_utils.py", line 417, in verbose_dec
    ret = function(*args, **kwargs)
  File "C:\Users\labuser\Desktop\clds\CRM\expyfun\_experiment_controller.py", line 337, in __init__
    self._response_handler = CedrusBox(self, force_quit)
  File "C:\Users\labuser\Desktop\clds\CRM\expyfun\_input_controllers.py", line 450, in __init__
    dev = pyxid.get_xid_devices()[0]
  File "C:\Miniconda2\lib\site-packages\pyxid\__init__.py", line 18, in get_xid_devices
    scanner = XidScanner()
  File "C:\Miniconda2\lib\site-packages\pyxid\pyxid_impl.py", line 16, in __init__
    self.__com_ports = SerialPort.available_ports()
  File "C:\Miniconda2\lib\site-packages\pyxid\serial_wrapper.py", line 26, in available_ports
    return GenericSerialPort.available_ports()
  File "C:\Miniconda2\lib\site-packages\pyxid\serial_wrapper.py", line 73, in available_ports
    p = Serial(i)
  File "C:\Miniconda2\lib\site-packages\serial\serialwin32.py", line 31, in __init__
    SerialBase.__init__(self, *args, **kwargs)
  File "C:\Miniconda2\lib\site-packages\serial\serialutil.py", line 180, in __init__
    self.open()
  File "C:\Miniconda2\lib\site-packages\serial\serialwin32.py", line 47, in open
    if port.upper().startswith('COM') and int(port[3:]) > 8:
AttributeError: 'int' object has no attribute 'upper'

port is an int with a value of 0, so there there was an error in pyxid's exception handling :-(

Cedrus box is connected via USB. From looking at the computers device manager, the USB-serial port should be 'COM3'.

Ideas?

larsoner commented 8 years ago

You might need to install from git source. I committed some fixes to their repo and I'm not sure they've released since then.

rkmaddox commented 8 years ago

Got it. Will try again. You'd think they would want to release the code that someone fixed for them...

On Tue, Mar 8, 2016 at 4:09 PM, Eric Larson notifications@github.com wrote:

You might need to install from git source. I committed some fixes to their repo and I'm not sure they've released since then.

— Reply to this email directly or view it on GitHub https://github.com/LABSN/expyfun/issues/274#issuecomment-194032147.

rkmaddox commented 8 years ago

Same error. Tried it again with newer version of pyxid (1.1 from git), installed thusly:

pip install git+https://github.com/cedrus-opensource/pyxid.git --upgrade

larsoner commented 8 years ago

Hmm... I wonder if it's a Python2 vs 3 or Windows vs Linux thing. I don't think I tested all combinations, and you might be in one that I didn't. It should be possible to fix their code if you're up for it, or you can wait a couple of weeks and I can do it.

rkmaddox commented 8 years ago

Might just buy a TDT ButtonBox.

On Tue, Mar 15, 2016 at 6:16 PM, Eric Larson notifications@github.com wrote:

Hmm... I wonder if it's a Python2 vs 3 or Windows vs Linux thing. I don't think I tested all combinations, and you might be in one that I didn't. It should be possible to fix their code if you're up for it, or you can wait a couple of weeks and I can do it.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/LABSN/expyfun/issues/274#issuecomment-197094554

larsoner commented 8 years ago

That's certainly an option

rkmaddox commented 8 years ago

Eh, it's probably a simple fix. Have they been responsive at all? I can post an issue on their github page.

Ross Maddox, Ph.D. Postdoctoral Fellow Institute for Learning & Brain Sciences University of Washington phone: 206-685-4662 http://faculty.washington.edu/rkmaddox/

On Tue, Mar 15, 2016 at 9:01 PM, Eric Larson notifications@github.com wrote:

That's certainly an option

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/LABSN/expyfun/issues/274#issuecomment-197142200

larsoner commented 8 years ago

They were responsive in the sense that they merged my PR. Not sure how active they'd be in fixing it themselves, but it's worth a shot

rkmaddox commented 8 years ago

OK. I'll go that route first since travel is ramping up again.

Ross Maddox, Ph.D. Postdoctoral Fellow Institute for Learning & Brain Sciences University of Washington phone: 206-685-4662 http://faculty.washington.edu/rkmaddox/

On Wed, Mar 16, 2016 at 5:46 AM, Eric Larson notifications@github.com wrote:

They were responsive in the sense that they merged my PR. Not sure how active they'd be in fixing it themselves, but it's worth a shot

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/LABSN/expyfun/issues/274#issuecomment-197303327

larsoner commented 8 years ago

Fixed a few weeks ago