Installation

To install BrainAccess C/C++ API follow installer instructions in the provided user manual.

Setup

Bluetooth connection setup

To connect the BrainAccess device on windows:

  1. Plug-in Bluetooth adapter. Skip this step using an integrated Bluetooth adapter.

  2. Select BrainAccess device from the available Bluetooth devices and connect.

  3. Note which COM port is used by the device. Note: typically two com ports are shown ‘incoming’ and ‘outgoing’, ‘outgoing is the once that’s needed.

  4. In the code enter the COM port when connecting

To connect the BrainAccess device on Linux:

  1. Plug-in Bluetooth adapter. Skip this step using an integrated Bluetooth adapter. Connect to the device via Bluetooth. If using Ubuntu/GNOME, this can be done through the GNOME Control Center, or using the bluetoothctl or bluez tools as shown in examples/linux_setup_bluetooth_1.sh

  2. Install the bluez-utils package (Ubuntu/Debian: sudo apt install bluez-utils)

  3. Enter the following command: sudo rfcomm bind <DEVICE> <MAC_ADDRESS>, where

  • <DEVICE> is the port you will enter into the application to connect to the device (/dev/<DEVICE>). By default, you should use rfcomm0

  • <MAC_ADDRESS> is the Bluetooth address of the device (example: B8:F0:09:AA:28:6A)

  • Example command: sudo rfcomm bind rfcomm0 B8:F0:09:AA:28:6A

  • Example script examples/linux_setup_bluetooth_2.sh

  1. Once finished, you can do sudo rfcomm unbind <DEVICE> to remove the port and free it for usage by another EEG device.

Step 3 has to be repeated every time the PC is restarted.

If you have trouble connecting to the device, turn it off, remove the device from the Bluetooth menu in GNOME Control Center, kill any program that might be using the port, and try again (no need to unbind / bind the rfcomm port). While using the library enter the <DEVICE> when connecting

Configuration file

bacore.json describes additional core parameters

Main components:

  • chunk_size: size of chunks to be acquired from core (Default: 25)

  • logging parameters for debugging.

  • model_path: alternative location of the model file (Default: empty)

The example file is provided in the root directory of BrainAccess package

{
    "logging_enabled": false,
    "log_path": "bacore.log",
    "log_level": 0,
    "append_logs": true,
    "timestamps_enabled": true,
    "autoflush": true,
    "log_buffer_size": 512,
    "thread_ids_enabled": false,
    "model_path": "",
    "chunk_size": 25
}