Now we have set up a basic pipeline in Tutorial 2, we can replace the playback of EEG with real-time recordings of EEG.
The EEGsynth supports many EEG devices, thanks to fact that we use FieldTrip's support of EEG devices in its real-time development. Read the FieldTrip realtime development documentation for more information. By default we only distribute the interface to OpenBCI, Jaga and GTec devices with the EEGsynth. These modules (e.g. openbci2ft, jaga2ft and gtec2ft) are written in C, because they rely on very specific interfacing with their devices and software. However, we use them as we would any other module, i.e. start them up with a user-specified .ini file. Similarly as the playback module, these write to the buffer. They do this typically in blocks of data that are relatively small number of samples compared to the time we use to analyze the data and control devices.
Boxes depict EEGsynth modules. Orange arrows describe time-series data. Blue arrows describe Redis data.
The most important lesson here is actually how to set up proper EEG recordings, but this falls outside of the scope of this tutorial. Please refer to our recording tutorial to familiarize yourself with the recording procedure first. When you did so, and got some experience (best is to do so under supervision of a more experienced EEG user), we will patch the EEG real-time recording in the pipeline of the previous tutorial, replacing the playback module with the openbci2ft module. If you are using another device, the principle will be the same.
-
Navigate to openbci2ftmodule directory /eegsynth/module/openbci2ft
-
Copy the openbci2ft.ini to your own ini directory (e.g. to /eegsynth/inifiles, which would be in ../../inifiles relative to the openbci2ftmodule directory)
-
We will need to plug in the OpenBCI dongle into a USB port. But before you do so, do the following:
- Open a new terminal window and list the devices of the kernel, by typing
ls /dev. - Plug in the OpenBCI dongle in a USB port
- List the device again using
ls /dev - If you compare the two lists, you should see that another device was added after you plugged in the dongle. It will probably start with ttyUSB followed with a number. This is the USB port number at which the dongle is connected. If you unplug or restart your computer, this number might change, and therefor you will probably need to do this check regularly. There might be easier ways of finding the USB port number, but this, at least, is fool-proof.
- Open a new terminal window and list the devices of the kernel, by typing
-
Edit your openbci2ft.ini file and enter the right port name for the dongle, which you can find under [General], e.g
serial = /dev/ttyUSB1 -
Start up the openbci2ft module, using your own ini file:
python openbci2ft.py -i ../../inifiles/openbci2ft.ini. If things are working, you the terminal will print a message that it is waiting to connect. -
You can now turn on the EEG board (not the dongle) by moving the little switch to either side. After a couple of second you should see the dongle starting to blink a green and red light. This means it is configuring the EEG board with the settings specified in the .ini file, which will take a couple of seconds. After that you should have your data coming in, being transferred into the fieldtrip buffer.
-
Now you can check the incoming data with the plotsignal module.
Return to the Documentation overview
