Sending triggers to NetStation - Error 10051: "A socket operation was attempted to an unreachable network"

Continuing the discussion from Egi library and python3:

Hi! I am stuck trying to establish a connection between the Psychopy stimulus presentation computer and the EEG recording computer (Mac) running EGI Netstation Acquisition.
I have used the code suggested in GitHub by @gstothart as follows:

##set up connection
from egi import simple as egi
ms_localtime = egi.ms_localtime
ns = egi.Netstation()
ns.connect(‘’, 53239) → my mac IP address and port address

##send trigger

##close up NS

However, I always get Error 10051: “A socket operation was attempted to an unreachable network”.

How can I work it out?

Many thanks

Hi, I have given up on EGI and bought a BrainProducts system instead, sorry I can’t be more help!

Can you try to execute the following in the command prompt (assuming Windows) on the stimulus computer:


This would verify that your PsychoPy computer at least ‘sees’ the recording computer.

Have you done any special network configuration in addition to just executing the code that you mention? Usually for these computers to interact this way over a local network you need to configure the Ethernet connection explicitly (see this link). This would usually give an ip that looks like ‘192.168.x.x’.

I have no experience with the EGI Netstation so I might also totally be on the wrong track here :slight_smile: