Issue with LiveTrack Camera and Cedrus Button Box

OS (e.g. Win10): Win 11
PsychoPy version (e.g. 1.84.x): 2024.2.4

I am currently having an issue where if I have both, a Cedrus button box (RB-540) and an eye tracker/camera (LiveTrack Lightning with the Presto Unit) being used in the same experiment, psychopy doesn’t register anything from the Cedrus Box.
To preface this, I originally was unable to get the LiveTrack Lightning to work as it would give me this error:

Traceback (most recent call last):
  File "C:\Users\Name\AppData\Local\Programs\PsychoPy\lib\site-packages\psychopy\iohub\start_iohub_process.py", line 56, in run
    s.udpService.start()
  File "C:\Users\Name\AppData\Local\Programs\PsychoPy\lib\site-packages\gevent\baseserver.py", line 336, in start
    self.init_socket()
  File "C:\Users\Name\AppData\Local\Programs\PsychoPy\lib\site-packages\gevent\server.py", line 229, in init_socket
    self.socket = self.get_listener(self.address, self.family)
  File "C:\Users\Name\AppData\Local\Programs\PsychoPy\lib\site-packages\gevent\server.py", line 239, in get_listener
    return _udp_socket(address, reuse_addr=cls.reuse_addr, family=family)
  File "C:\Users\Name\AppData\Local\Programs\PsychoPy\lib\site-packages\gevent\server.py", line 284, in _udp_socket
    sock.bind(address)
  File "C:\Users\Name\AppData\Local\Programs\PsychoPy\lib\site-packages\gevent\_socketcommon.py", line 543, in bind
    return self._sock.bind(address)
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted: ('', 9036)

In order to correct this error, I changed the keyboard backend from ioHub to PsychToolbox and that was the solution, and it didn’t seem to affect the keyboard inputs at all. The inputs are keyboard components.
Now with trying to implement the Cedrus Button box (RB-540) the experiment doesn’t see anything being pressed. The Cedrus box itself is functional when testing it in other psychopy experiments. I also tried used a Cedrus RB-740, but the same thing occurred. The port switches are (1Up,2Dwn,3Up, 4Dwn). I also tried using the Button Box component, but the same issue occurred.
Any solutions I can do in order to have the cedrus box functionality with this experiment after changing the keyboard backend? Is there something with the Cedrus switches I need to change?

Issac

Greeting from Cedrus.

If button 1 is up, then the RB-540 is in keyboard mode and its output is indistinguishable from that of a keyboard. The Button Box component will not be able to “see it” when in keyboard mode.

This page, The Response Pad DIP Switches, might also be useful.

I use a button box component with a Black Box Toolkit keyboard emulator button box. You can select keyboard as the device for the button box component.

Thanks for your quick response @habboud ! Both the 1-switch is in the up position for both buttons boxes that I tested. It’s functional as a keyboard outside of psychopy. However, I think the problem is swapping the Keyboard backend from ioHub to Psych Toolbox. As that seems to have caused the Cedrus to not function as a keyboard anymore. The actual keyboard still works though.
@wakecarter That was the setting I also selected in that module (and the only setting available), but it still didn’t fix the issue. Do you know if it is because of the keyboard backend being changed? I do get a warning with when I changed the keyboard backend:


Any ideas as to the fix? I can still run the experiment with the keyboard if that’s the concession I need to make, but I would much prefer using the Cedrus box.

1 Like

As an update to this. I tried testing with it some more, and I am able to have psychopy get an input from the Cedrus box, but only if I press the buttons at an extremely fast rate. What I think is happening is that in some way PsychToolbox makes it so the Cedrus signals are only being accepted/interpreted by Psychopy if they occur in a specific time window in the code. In addition, the keyboard functions as normal.

I also tried Pyglet, and that was even more strange. As for the keyboard, the escape key was non-functional as a way to get out of the experiment, and instead would act as any other key press. @wakecarter Is this a known issue for keyboard functionality when using Pyglet as backend?

In addition, the Cedrus box itself was non-functional still. HOWEVER, without pressing anything on the Cedrus box, psychopy would randomly (or maybe at some interval, not sure) get a signal from the cedrus box. I confirmed this via testing what happens if either device is plugged in or not.

This obviously still means it is unusable for experiments using the eyetracker and the cedrus box at the moment. Do you have other solutions @habboud?

Issac