This is my project for Advanced Authentic Research (AAR). Follow the progress of this project on my blog. This project uses emokit which is an open source driver used to access the Emotiv Device raw data.
Extracting the Raw Data
- Download the repository
$ git clone https://github.com/nikhiljay/brainwaves.git
Plug in your Emotiv's USB dongle.
Find the Serial Number of the Emotiv by downloading HIDAPI.
$ git clone https://github.com/signal11/hidapi.git $ cd hidapi
- In the HIDAPI go to the directory that corresponds to your operating system and run:
$ make -f Makefile-manual
A hidtest file should be created in the same directory. Open the hidtest to run it. On linux, you must run this using sudo.
The output should be a list of devices that are connected to the computer. Look at the Emotiv device information and copy the Serial Number.
In the brianwaves project, go to the emokit directory.
$ cd emokit/python/emokit
- Open "emotiv.py" and paste the serial number on line 361 where it says:
- Run the "emotiv.py" file.
$ python emotiv.py
- If there are any dependencies that need to be installed used the "pip" command.
$ sudo pip install [missing dependency goes here]
- Install all dependencies until the following error is produced:
Traceback (most recent call last): File "emotiv.py", line 674, in <module> a.setup() File "emotiv.py", line 432, in setup self.setup_darwin() File "emotiv.py", line 537, in setup_darwin hidraw = hid.device(0x21a1, 0x0001) File "hid.pyx", line 45, in hid.device.__cinit__ (hid.c:1280)
- Turn on the Emotiv and try again. A succesful output should be printed:
These electrodes in the picture above represent certain parts of the brain shown here:
Displaying Data on an iOS Device
After extracting the Emotiv data, I sent the data as a JSON file to a local server. Then, I created an iOS app and used Alamofire to get request the data from the server. I created the app so that it would display the raw data on the iOS device. Here is what it looks like so far: