This is the code for this video on Youtube by Siraj Raval. This is a Python library meant to work with the Emotiv headset.
CyKit 1.0 for Python 2.7.6 (Windows x86) using Emotiv EPOC headset.
FAQ
https://github.com/CymatiCorp/CyKit/blob/master/FAQ.md
Wiki (Updated Jan. 2015)
https://github.com/CymatiCorp/CyKit/wiki/EEG-CyKit-1.0-updates
OpenVIBE Setup (Updated Feb 25 2015)
https://github.com/CymatiCorp/CyKit/blob/master/Openvibe-Readme.md
Cyos (OpenViBE TCP Server - Revision 1.0 - Win32 Executable)
http://cymaticorp.com/edu/github/Cyos-0.1.0.win32.py2.7.zip
Hardware
https://github.com/CymatiCorp/CyKit/blob/master/Hardware-Readme.md
Questions about the project?
Contact me at warrenarea@gmail.com
CyKit 1.0 is specifically for Python development in Windows to
give access to the raw data stream from the Emotiv EPOC headset.
CyKit 1.0 is an unofficial branch to the OpenYou emoKit, check it out here
https://github.com/openyou/emokit
- pywinusb 0.2.9
- pycrypto 2.6
- gevent 1.0.1
- greenlet 0.4.2
- pygame 1.9.1 (Only required if you want to use render.py which shows the EEG graph)
Note: All of the necessary files, listed below as dependancies,
are included in the \InstallFiles directory of this repository.
- pywinusb - https://pypi.python.org/packages/source/p/pywinusb/pywinusb-0.2.9.zip
- pycrypto - http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win32-py2.7.exe
- gevent - https://dl.yooooo.us/build/windows/python/gevent-1.0.1.win32-py2.7.exe
- greenlet - https://pypi.python.org/packages/2.7/g/greenlet/greenlet-0.4.2.win32-py2.7.exe#md5=0ea8f5a14f8554919e1a136bc042d76c
- Pygame(optional) - http://pygame.org/ftp/pygame-1.9.1.win32-py2.7.msi
Note: There is an alternate version of CyKit to work with Python 3.3
See https://github.com/CymatiCorp/CyKit-Python-3.3 ( -Experimental- not heavily tested. )
- Install Python 2.7.6 https://www.python.org/ftp/python/2.7.6/python-2.7.6.msi
Extract pywinusb to any folder, and copy the folder
\pywinusb
from folder \pywinusb-0.2.9 to
Drive:\Python27\Lib\site-packages
- Install following dependancies:
gevent 1.0.1
greenlet 0.4.2
pycrypto 2.6
Install to python2.7.6 folder.
Navigate to the Python directory extracted from CyKit-master.zip
C:\Python27\Python.exe C:\Cy-master\Python\example.py
If your Emotiv USB dongle is not connected it will throw several errors ending with:
AttributeError: 'Emotiv' object has no attribute 'device'
Connect the EPOC USB dongle and run again, and it should begin streaming you data.
Added ability to stream the data to a TCP connection.
Adjust Python PATH in batch files as necessary.
Type RunStream.bat
runs: Python.exe stream.py <server> <port>
Added a mIRC script that will connect to the TCP server and display in a simple graph the activity of the sensors.
In Command Prompt type RunStream.bat
(runs: Python.exe stream.py <ip> <port> )
In mIRC "Status Window" type
/load -rs CyClient.mrc
/load -rs CySignal.mrc
This loads scripts to the remotes. Alternatives ALT+R and load manually. then in "Status Window" type.
CyClient.mrc - Connects to the socket server and breaks large packets into smaller ones. CySignal.mrc - Receives the smaller packets and handles displaying EEG results.
/EEG
or Popup Menu: EEG
Updated mIRC so that it averages out the data, creating baselines for each data channel. This means, no matter what signal variance or whether the data has a positive or negative sign, the data displayed can then be placed equally from one another on seperate lines. Setting a baseline only needs to occur once per EEG run. It will do it automatically when your device is connected to the stream, but you can optionally initiate a baseline reset manually in your status pop-up window.
- Cody Brocious (http://github.com/daeken)
- Kyle Machulis (http://github.com/qdot)
Contributions by
- Severin Lemaignan - Base C Library and mcrypt functionality
- Sharif Olorin (https://github.com/fractalcat) - hidapi support and project guru
- Bill Schumacher (https://github.com/bschumacher) - Fixed the Python library (again)
- Bryan Bishop and others in #hplusroadmap on Freenode.
- Warren - (https://github.com/CymatiCorp/CyKit) Socket server.