Brain Vision Remote Control Server

Dear forum,

I’m developing a setup for ambulatory outdoors EEG studies that runs both stimulus presentation software (PsychoPy v2025.1.1) and EEG recording software (Brain Vision Recorder) on the same machine (a Windows Surface Tablet, running Win 11). I realize this is typically not recommended (I would normally use separate machines for stimulus presentation and recording) but I’m trying to use minimal hardware for this ambulatory setup, and in pilot testing the setup seems to perform well.

I’d like to use PsychoPy to remotely control BV Recorder, so that I can automatically start and stop EEG recordings using PsychoPy code. In theory, this should just be a case of installing the psychopy-brainproducts plugin in PsychoPy and running the following example code, provided by brain products here. I run this code to try and establish a connection with the BV Remote Control Server:

import time
from psychopy.hardware import brainproducts

# Host, (Port), Timeout, (Testmode)
rcs = brainproducts.RemoteControlServer(host='127.0.0.1',timeout=20)

However, I get this error:

I suspect that it might have something to do with the host port, which I have set to 127.0.0.1 in both the script and the Remote Control Server. But the error message suggests I need to install the psychopy-brainproducts plugin, which doesn’t make sense as it’s definitely installed and I’ve restarted the session multiple times.

If anyone has suggestions for how to get this working, I’d love to hear them!

Thanks in advance!

Tom

I believe this documentation is from before it was a plugin - in order to use the plugin, you need to import brainproducts from psychopy-brainproducts rather than from psychopy.hardware.

Thank you for responding. I tried importing psychopy-brainproducts a couple of different ways, but no luck.

Just following up on my previous post. I’ve attempted to import psychopy-brainproducts a few different ways, but this isn’t working. The plugin is definitely installed. Does this look like a mistake in my code, or is there an issue with the plugin? Thanks

Dear Tom,

I would check to see if the brainproducts library is installed correctly by creating a very short python file in an IDE (like VSC).

Once you can confirm it is installed correctly. I would try manually setting the path for where it is located:

\

With the correct path dictated you should just need

import brainproducts
#or
from brainproducts import something, functions

Issac

Sorry, was a typo on my part; the name of the package is psychopy-brainproducts, but you need to import it as psychopy_brainproducts (an annoying quirk of Python package naming conventions)

Thank you - that fixed it and now the RCS is working :slight_smile:

For anyone else who runs into this issue, the solution is to replace this line at the top of the script:

from psychopy.hardware import brainproducts

with:

from psychopy_brainproducts import brainproducts
1 Like