Triggers to EGI system via serial port before 2022 version

Hi everybody,

I have an experiment which has been created in Psychopy version 3.0.6. We have Windows 10 on the stimulation PC. In our lab we use an EGI Geodesic EEG System with 256 channels. I would like to set triggers via serial port.
Do you have any code to send triggers to an EGI system via serial port without using the library ‘egi pynetstation’ (supported just from Psychopy version 2022)?

Thank you very much

I’m the maintainer of the egi-pynetstation project, is there a reason you’d prefer serial triggers?

I ask because we’re in the midst of writing GUI package calls for communicating with the amplifier both for ECI events but also for stimulation and trying to get a sense for the needs of other labs.

Dear pmolfese,
In our lab we are not able to implement a parallel connection between EGI and stimulation pc, that’s the reason the reason why we need to use serial triggers. And the egi-pynetstation works fine.

Hello,

My main recommendation would be to update your PsychoPy to a newer version since 3.0.6 is pretty old (2019) and at least one of the more modern ones should be able to run your experiment.

You can also install egi-pynetstation on older versions of PsychoPy. I haven’t tested it, but there’s no real requirement for Python 3.8 in the package, Python 3.6 in Psychopy 3.0.x should be fine. Git clone the repo, and copy the package folder into your PsychoPy directory with other dependences on windows.

If you’re set on serial, what code do you currently have and what errors are you receiving? The gist of the code should be:

begin experiment

import serial
port = serial.Serial(port = 'COM4', baudrate = 115200) #COM settings whatever windows thinks it is
tiggerSent = False

In Each Frame, the only thing to modify from sending events in egi-pynetstation is:

port.write(str.encode('1')) #can also embed in a CallOnFlip
triggerSent = True
#don't forget to later clear this after routine with a port.write(str.encode('1'))
#also reset your triggerSent variable