[solved] Parallel port trigger stopping
Hi!
I'm trying to use OpenSesame with parallel_port_trigger plug-in to trigger events in an EEG-recording software (EMOTIV's TestBench), both run on the same machine under ubuntu.
I followed the instructions (from http://osdoc.cogsci.nl/3.0/devices/triggers/) but however my experiment is stopping right after the start with following text:
text begin =====================================
Stopped
The experiment did not finish normally for the following reason:
- Could not access the Parallel Port
Details
- item-stack:
experiment[prepare].new_parallel_port_trigger[prepare] - exception message:
[Errno 2] No such file or directory: '/dev/parport0' - time:
Wed Mar 30 17:16:33 2016 - exception type:
OSError
Traceback (also in debug window)
File "/home/nkobelev/pythonTest/OpenSesame-release-3.0.7/plugins/parallel_port_trigger/parallel_port_trigger.py", line 103, in prepare
self.experiment.pptrigger = parallel.Parallel()
File "/home/nkobelev/pythonTest/OpenSesame-release-3.0.7/plugins/parallel_port_trigger/parallelppdev.py", line 187, in __init__
self._fd = os.open(self.device, os.O_RDWR)
OSError: [Errno 2] No such file or directory: '/dev/parport0'
Any ideas what am I doing wrong?
Comments
HI Kobi,
You need to specify the device that corresponds to the parallel port. You have specified
/dev/parport0(the default on non-Windows systems), but this device apparently doesn't exist on your system. So you will need to find out what the parallel port is called. What operating system are you using?Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
thanks for Your fast response!
My operating system is Ubuntu 12.04 . I didn't specify the port as it was said in the instructions that the value for port in the parallel_port_trigger is ignored under Linux. If I do specify the port the error-text remains the same.
UPDATE: TestBench (my EEG scanning software) listens to serial port triggers not parallel port if I understand it correctly (I can choose only from ttyS0 - ttyS31).
Is there another way to produce serial port triggers in OpenSesame?
UPDATE2:
I tried to execute an
inline_scriptitem with following code:I can see
/dev/ttyS0in debug output window,but I can't see any trigger events in the EEG-software.
any other
ttySXreturn following error-text:Cheers,
Niklas
I think I've found a solution. Now I can send trigger events to serial port from OpenSesame and see them in TestBench. For the case someone else has same difficulties with TestBench and OpenSesame on Ubuntu:
Step1: open terminal and create a pair of virtual ports with socat
Step2: open another terminal and grant a read/write permissions for the new ports:
Step3: open OpenSesame and create an
inline_scriptitem.in that item write:
Step4: open TestBench, go to
marker->configure serial portand select the same port as You created with socat (ttyS11 in my case) and setbit per secondsto the same rate as you specified in socat (19200 in my case).That's It! Now as You execute the
inline_scriptin OpenSesame You should see an event with a value=1 in TestBench.I hope it works for You too!
Cheers,
Niklas