| Reference | Downloads | Github

Anyone using TCP or UDP to communicate with lab devices?

Hi Team,

Am just writing a section for the upcoming coder book, on using UDP to communicate with over the network with an eye tracker.

Am think that we won’t really cover TCP, as the UDP example gives enough to build on. But was wondering if anyone can give examples of:

  • hardware devices that you control or communicate with via network protocols (UDP or TCP)?
  • do you talk directly to the device, or to a computer that controls the device?
  • examples of where you might have found it useful to communicate between computers with network protocols, using your own software at each end?


Hi Michael, I use TCP ports directly to communicate with EEG devices (Wearable Sensing and, at times, Biosemi). For most EEG acquisition now, I try to use Lab Streaming Layer, but they don’t always integrate new devices fast enough. Ex. Wearable Sensing has been an open PR over a year. It would also allow, as you allude to in the last point, for other software communications.

I’m all for it!

Thanks for that info, Tab. If there is enough demand, we could add some classes to PsychoPy to conveniently bundle up UDP or TCP communication functions so people don’t have to reinvent the wheel (and to make it easy to add a graphical component to Builder).

Hi Sci-tab,
Any headway on the Psychopy classes for using TCP ports directly?


Not to my knowledge (there hasn’t been too much progress on that book chapter either…)

The code to use a TCP socket is pretty straight-forward:

So really, I guess the main impetus in adding socket classes to PsychoPy would mainly be from the Builder point of view, to allow the creation of a graphical socket component. So thanks for raising the issue again, but I suspect if you need to use this functionality at the moment, you’d be best rolling your own solution rather than waiting.

1 Like