Cortex API v2
The example code uses features that are only available in Python >= 3.6
In addition, the example code only works with Cortex 2.0, it is not compatible with older versions of Cortex.
The example uses the Python websockets library to connect to Cortex. The websockets library (not to be confused with the older websocket library).
The websockets library utilizes await
and async
which were introduced in
Python 3.6.
We generally recommend using a virtual environment.
Once you've set up your environment (virtual or otherwise) install the
requirements with pip
:
pip install -r requirements.txt
To run the existing example you will need to do a few things.
- You will need an EMOTIV headset. You can purchase a headset in our online store
- Next, download and install the Cortex service. Please note that currently, the Cortex service is only available for Windows and macOS.
- We have updated our Terms of Use, Privacy Policy and EULA to comply with GDPR. Please login via the EMOTIV App to read and accept our latest policies in order to proceed using the following examples.
- Next, to get a client id and a client secret, you must connect to your Emotiv account on emotiv.com and create a Cortex app. If you don't have a EmotivID, you can register here.
- Then, if you have not already, you will need to login with your Emotiv id in the EMOTIV App.
- Finally, the first time you run these examples, you also need to authorize them in the EMOTIV App.
Place the client id, and client secrets inside lib/cortex.py
The canonical documentation for Cortex is available here. It includes full descriptions of the various methods available.