Giter VIP home page Giter VIP logo

emokit's Introduction

Emokit

Reverse engineering and original code written by

Contributions by

Headset Support

Supported: Epoc, Epoc+(Pre-2016, limited gyro sensors) Unsupported: Epoc+(2016+), other models.

Description

Emokit is a set of language for user space access to the raw stream data from the Emotiv EPOC headset. Note that this will not give you processed data (i.e. anything available in the Emo Suites in the software), just the raw sensor data.

C Library

Please note that the python and C libraries are now in different repos. If you would like to use the C version of emokit, the repo is at

http://www.github.com/openyou/emokit-c

Information

FAQ (READ BEFORE FILING ISSUES): https://github.com/openyou/emokit/blob/master/FAQ.md

If you have a problem not covered in the FAQ, file it as an issue on the github project.

PLEASE DO NOT EMAIL OR OTHERWISE CONTACT THE DEVELOPERS DIRECTLY. Seriously. I'm sick of email and random facebook friendings asking for help. What happens on the project stays on the project.

Issues: http://github.com/openyou/emokit/issues

If you are using the Python library and a research headset you may have to change the is_research variable in emotiv.py's setup_crypto function.

Required Libraries

Python

2.x

  • future - pip install future

Windows

Linux / OS X

Running tests

You should be able to install emokit and the required python libraries using:

pip install emokit

OR

python setup.py install

hidapi will still need to be installed manually on Linux and OS X.

Usage

Python library

Code:

# -*- coding: utf-8 -*-
# This is an example of popping a packet from the Emotiv class's packet queue


import time

from emokit.emotiv import Emotiv

if __name__ == "__main__":
    with Emotiv(display_output=True, verbose=True) as headset:
        while True:
            packet = headset.dequeue()
            if packet is not None:
               pass
            time.sleep(0.001)

Bindings

Go: https://github.com/fractalcat/emogo

Running Unit Tests

From the python directory in your terminal type:

Code:

python -m pytest tests/

Platform Specifics Issues

Linux

Due to the way hidapi works, the linux version of emokit can run using either hidraw calls or libusb. These will require different udev rules for each. We've tried to cover both (as based on hidapi's example udev file), but your mileage may vary. If you have problems, please post them to the github issues page (http://github.com/openyou/emokit/issues).

Your kernel may not support /dev/hidraw devices by default, such as an RPi. To fix that re-comiple your kernel with /dev/hidraw support

OS X

The render.py file uses pygame, visit http://pygame.org/wiki/MacCompile Do not export the architecture compiler flags for recent 64bit versions of OS X.

Credits - Cody

Huge thanks to everyone who donated to the fund drive that got the hardware into my hands to build this.

Thanks to Bryan Bishop and the other guys in #hplusroadmap on Freenode for your help and support.

And as always, thanks to my friends and family for supporting me and suffering through my obsession of the week.

Credits - Kyle

Kyle would like to thank Cody for doing the hard part.

He would also like to thank emotiv for putting emo on the front of everything because it's god damn hilarious. I mean, really, Emo Suites? Saddest hotel EVER.

Frequently asked questions

  • What unit is the data I'm getting back in? How do I get volts out of it?

One least-significant-bit of the fourteen-bit value you get back is 0.51 microvolts. See the specification for more details. (Broken Link)

  • What should my output look like?

Idling, not on someone's head it should look something like this:

Emokit - v0.0.8 SN: ActualSerialNumberHere Old Model: False +========================================================+ | Sensor | Value | Quality | Quality L1 | Quality L2 | +--------+----------+----------+------------+------------+ | F3 | 292 | 24 | Nothing | Nothing | | FC5 | 1069 | 0 | Nothing | Nothing | | AF3 | 110 | 8 | Nothing | Nothing | | F7 | 63 | 24 | Nothing | Nothing | | T7 | 322 | 8 | Nothing | Nothing | | P7 | 166 | 0 | Nothing | Nothing | | O1 | -62 | 24 | Nothing | Nothing | | O2 | 235 | 24 | Nothing | Nothing | | P8 | -63 | 24 | Nothing | Nothing | | T8 | 626 | 16 | Nothing | Nothing | | F8 | 1045 | 16 | Nothing | Nothing | | AF4 | 578 | 8 | Nothing | Nothing | | FC6 | 973 | 16 | Nothing | Nothing | | F4 | 780 | 8 | Nothing | Nothing | | X | 2 | N/A | N/A | N/A | | Y | 1 | N/A | N/A | N/A | | Z | ? | N/A | N/A | N/A | | Batt | 46 | N/A | N/A | N/A | +--------+----------+----------+------------+------------+ |Packets Received: 452 | Packets Processed: 447 | | Sampling Rate: 2 | Crypto Rate: 0 | +========================================================+

emokit's People

Contributors

bschumacher avatar daeken avatar digma avatar fnielsen avatar fundamental avatar henrybond158 avatar jscastanoc avatar kanzure avatar kuz avatar minifiredragon avatar mishugana avatar morgan243 avatar olorin avatar ppasler avatar qdot avatar quixoticgithub avatar robintibor avatar zheng1i avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emokit's Issues

Can't compile on OS X 10.8.2

Hi,

I followed the instructions in the readme, installed everything that needed to be installed. Then downloaded the emokit-master, ran "cmake ." and "make", no problems.

I then used cmake/make, no problems. Then tried to compile the emokitd.c using gcc and received the following error:

emokitd.c:12:27: error: emokit/emokit.h: No such file or directory
emokitd.c: In function ‘main’:
emokitd.c:19: warning: assignment makes pointer from integer without a cast
emokitd.c:20: error: ‘EMOKIT_VID’ undeclared (first use in this function)
emokitd.c:20: error: (Each undeclared identifier is reported only once
emokitd.c:20: error: for each function it appears in.)
emokitd.c:20: error: ‘EMOKIT_PID’ undeclared (first use in this function)
emokitd.c:34: error: storage size of ‘c’ isn’t known

I then changed the path in the include linking emokit.h (added "../../"), tried to compile again and received:

Undefined symbols for architecture x86_64:
"_emokit_create", referenced from:
_main in ccPtrAz4.o
"_emokit_get_count", referenced from:
_main in ccPtrAz4.o
"_emokit_get_next_frame", referenced from:
_main in ccPtrAz4.o
"_emokit_open", referenced from:
_main in ccPtrAz4.o
"_emokit_read_data", referenced from:
_main in ccPtrAz4.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

As well as the following error when running 'make' again:
Linking C executable emokitd
ld: library not found for -lemokit
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [emokitd] Error 1
make[1]: *** [CMakeFiles/emokitd.dir/all] Error 2
make: *** [all] Error 2

I get the same error regardless of compiling in different architetures?

Has anybody got an idea what I'm doing wrong? Or is this a well known issue I'm unaware of?

Thanks

Headset type bit not working correctly

I had to flip the type bit parsing to get things to work with my prerelease headset. However, someone with a newer consumer headset just said that didn't work for them. So something is wrong in our headset type parsing.

running render.py under windows 7 with python library

Hi,

I am a student working on the EPOC BCI. I'm trying to make the python code run under windows 7. I've succeeded up to the render.py file.

Everything works (but I made a few arrangements in emotiv's code), I found my key, my PID/VID pair, my serial number if I want... But when I run the render.py file, pygame just open an empty window with a white square in the middle. I've understood that it is normal (pygame.draw.rect(screen, (255, 0, 0), (curX-5, curY-5, 5, 5), 10)), but I can't see the graphics and I don't know how to access the datas from the headset so that I could use them for an other treatment (with matlab as an example).

I must confess that I am a newby in python, it's the first time I use it. But, according to me, it seems that these lines are not executed :

for packet in emotiv.dequeue():

        updated = True
        if abs(packet.gyroX) > 1:
            curX -= packet.gyroX - 1
        if abs(packet.gyroY) > 1:
            curY += packet.gyroY
        curX = max(0, min(curX, 800))
        curY = max(0, min(curY, 600))
        gdemo = emotiv.gotData(name)
        pyplot.plot(gdemo)
        map(lambda x: x.update(packet), graphers)
        print ('packet is in dequeue')

I also would like to be able to record the incomming datas into a file. Does anyone knows how to do so?

Thank you.

emotiv python question

Hi,

I'm trying to use the python tools you've published to read raw sensor data from my EEG Epoc headset. Could you please let me know what version of python the tools will require? I'm running 3.2.2 but after looking at your python code, I'm guessing it might require some modules that were removed between 2.x and 3.x (e.g. exceptions and possibly others).

Also, I was trying to access the pywinhd project on google using the link on the github site (http://code.google.com/p/pywinusb/ ) and am getting a http 403 error with a permission denied message. I'm not sure, but am wondering if perhaps access needs to be granted by you?

Thanks,
Ilya

Installation error in Fedora14

In platform FEDORA14 - kernel linux 2.6.35.6-45.fc14.i686
I found these errors during Build process..

[root@localhost openyou-emokit]# cmake CMakeLists.txt
-- Found mcrypt: /usr/local/lib/libmcrypt.so
-- Found HIDAPI: /usr/local/lib/libhidapi.a
-- /usr/local/lib/libmcrypt.so/usr/local/lib/libhidapi.a
-- Configuring done
-- Generating done
-- Build files have been written to: /home/openyou-emokit

[root@localhost openyou-emokit]# make
[ 50%] Building C object src/CMakeFiles/emokit.dir/emokit.c.o
In file included from /home/openyou-emokit/src/emokit.c:20:0:
/home/openyou-emokit/include/emokit/emokit.h:32:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘EMOKIT_VID’
/home/openyou-emokit/include/emokit/emokit.h:34:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘EMOKIT_PID’
/home/openyou-emokit/include/emokit/emokit.h:37:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘EMOKIT_OUT_ENDPT’
/home/openyou-emokit/include/emokit/emokit.h:39:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘EMOKIT_IN_ENDPT’
/home/openyou-emokit/src/emokit.c: In function ‘emokit_get_crypto_key’:
/home/openyou-emokit/src/emokit.c:189:15: error: ‘uint8_t’ undeclared (first use in this function)
/home/openyou-emokit/src/emokit.c:189:15: note: each undeclared identifier is reported only once for each function it appears in
/home/openyou-emokit/src/emokit.c:189:23: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:191:23: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:194:24: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:196:24: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:198:24: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:200:25: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:205:24: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:207:24: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:209:24: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:211:25: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:214:24: error: expected ‘;’ before ‘s’
/home/openyou-emokit/src/emokit.c:216:24: error: expected ‘;’ before ‘s’
make[2]: *** [src/CMakeFiles/emokit.dir/emokit.c.o] Error 1
make[1]: *** [src/CMakeFiles/emokit.dir/all] Error 2
make: *** [all] Error 2


thanks for your support and pls help me to find and fix these errors..

Implement Signal Quality

We have the information in the protocol documentation. It's now just a matter of actually doing it.

Decryption problem

Hi.

I'm having problems decrypting the data from the EPOC. The values I'm getting don't change according to the device and are not on the expected order of magnitude.

I have a research edition device (although it appears as 'Developer' on lsusb);
Serial number ending in 1255;
VendorID is 4660;
ProductID is 60674;
lsusb output is: ID 1234:ed02 Brain Actuated Technologies Emotiv EPOC Developer Headset Wireless Dongle

My cipher key is: 0x35, 0x00, 0x35, 0x54, 0x32, 0x10, 0x31, 0x42, 0x35, 0x00, 0x35, 0x48, 0x32, 0x00, 0x31, 0x50

Anyone can help? Need more info?
Thanks!

Gyro values are weird

Hi,

I have a research kit. It seems that the key is successfully generated as the battery level seems reasonable and the sequence numbers are consecutive. But the gyro values are stock between -5 and +10 or something. The docs say that it is a 7bit value.

How can I debug the issue?

Thanks.

Fix udev rules file

We should just be able to copy hidapi's udev example, along with all VID/PID pairs for the dongles.

Installer can't find mcypt

Despite cmake finding mcrypt the make file can't find mcrypt.h - see below

This is on OSX10.7 and mcrypt was installed via mac ports

MrLaptop:c jrs$ cmake CMakeLists.txt
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found mcrypt: /opt/local/lib/libmcrypt.dylib
-- Found libusb-1.0:
-- - Includes: /usr/local/include/libusb-1.0
-- - Libraries: /usr/local/lib/libusb-1.0.dylib
-- /opt/local/lib/libmcrypt.dylib/usr/local/lib/libusb-1.0.dylib
-- Found oscpack: /usr/local/lib/liboscpack.so
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/jrs/Documents/Uni/Code/Emotive/emokit/c
MrLaptop:c jrs$ make
[ 25%] Building C object src/CMakeFiles/epoc.dir/epoc.c.o
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c:1:20: error: mcrypt.h: No such file or directory
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘td’
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c: In function ‘epoc_init’:
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c:46: error: ‘td’ undeclared (first use in this function)
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c:46: error: (Each undeclared identifier is reported only once
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c:46: error: for each function it appears in.)
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c:46: error: ‘MCRYPT_RIJNDAEL_128’ undeclared (first use in this function)
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c:46: error: ‘MCRYPT_ECB’ undeclared (first use in this function)
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c: In function ‘epoc_deinit’:
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c:56: error: ‘td’ undeclared (first use in this function)
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c: In function ‘epoc_get_next_raw’:
/Users/jrs/Documents/Uni/Code/Emotive/emokit/c/src/epoc.c:81: error: ‘td’ undeclared (first use in this function)
make[2]: *** [src/CMakeFiles/epoc.dir/epoc.c.o] Error 1
make[1]: *** [src/CMakeFiles/epoc.dir/all] Error 2
make: *** [all] Error 2
MrLaptop:c jrs$

Decryption problems in C library

Hi there!

I've been playing around with the emokit C library on OS X 10.7 for a bit and was getting pretty excited about it until I ran into a bit of a roadblock. The values I'm getting from the sensors don't make any sense - they're more or less random - and the contact quality signals are always zero, regardless of the state of the headset. If I boot in Windows and run TestBench, I can see sensible signals and non-zero contact quality.

I suspect that the problem is the decryption.

Do I need to manually crack the encryption key of my headset, and if so, how do I let the C library know what it is?

Also, as far as I can tell, the emokit_osc.cpp file has variables named with "epoc" rather than "emokit", which prevents it from compiling, as there are no libraries with "epoc"-style variables in the repo. I replaced them, modified the arguments to a couple functions (emokit_get_next_frame() and emokit_read_data()), added a missing function declaration to emokit.h, and it seems to work (apart from the decryption, that is). Hopefully I haven't misunderstood something and there actually isn't anything wrong with those variable names.

Most of the issues I see being raised regarding decryption are about the python library. The ones that mention the C library talk about functions with "epoc" prefixes, and so I'm not sure that they totally apply to the current state of things.

Changing the third argument of what is now emokit_open(d, EMOKIT_VID, EMOKIT_PID, 0) to a 1 does not fix the problem and makes it impossible to connect. Obviously something else has to be changed before that step, but what? Where in the C library is the encryption key hardcoded? Or is it not supposed to be hardcoded?

thanks!

FAQ link broken

README says:

FAQ (READ BEFORE FILING ISSUES): http://github.com/openyou/emokit/FAQ.md

That link gives 404, and if I click on the Wiki tab in Github, it redirects to the main page?!

How did you do it?

I can sort of see how you could have reverse engineered the crypto as its fairly standard, but how on earth did you manage to figure out the get_levels method (with corresponding bits) – it looks like a completely crazy obfuscation pattern. I'm trying to rack my brain to see if it is a bizarre assembly-reconstructed version of something rather trivial – like a traditional bitmask.

Also, how did you work out the quality channel rotation and the battery level translation?

Wrong paths to header emokit.h

Files:

src/emokit.c
src/lib_usbamp.c
examples/emokitd/emokitd.c

all have wrong paths to include/emokit.h

This is easily fixable. Please, update it.

'Emotiv' object has no attribute 'rijn'

Hello, we (a student colleague and I) are on a project using the emotiv device and wanted to use the emokit python library with linux.
We are now constantly facing the same AttributeError and might have pointed to a specific line reading:
"if self.setupWin(headsetId) if windows else self.setupPosix(headsetId):"
at line 73 in emotiv.py

Can someone please explain what it does and if it is correct?
Thank you

Packet length wrong

Due to a debug value left in, we're only reading 16 bytes of a packet instead of 32.

Find way to build against mcrypt on 64-bit windows

Hello,

I have a problem for installing mcrypt correctly on windows 7 64bit. I tried to download the mcrypt-2.6.7-win32.zip, it is just an exe i can use with the terminal. I also tried to download the libmcrypt library but i have no idea what i need to do after that. I didn't find any answer in google so I'd love your help.

How do I install this library on windows 7 64bit?

C code is ignoring the repeating 77-80 quality pattern

The emotive protocol doc in the repo says "77-80 Pattern repeats until counter hits 127" which means the F4, F8, AF4, FC6 sensors have a much higher fidelity in their signal quality reading.

However, the C code just ignores anything over 80 – can I trust the documentation in my Java port or should I just follow the example set by the C code?

HID device on Mac OS X Lion 10.7.3

Hello,

I am currently testing the Emokit on OS X 10.7.3,
However the problem is that no hid devices (named /dev/hidraw5 or else) is listed in the /dev directory.

The following command gives no result:
$ ls -l /dev | grep -i raw
$

I tried to figured it out why, ran an hidapi (https://github.com/signal11/hidapi/downloads) to see what it detects and apparently it detect the usb device, as you can see:

Device Found
type: 1234 ed02
path: USB_1234_ed02_0x7f9c985020e0
serial_number: SN20110525001425
Manufacturer: Emotiv Systems Pty Ltd
Product: Receiver Dongle L01
Release: 3
Interface: -1

But I cannot manage to access it, I have no clue of its path... And without it, I cannot obviously read the raw data from the device.

Finally here is the output of the render.py script:

$ ./render.py
No psyco. Expect poor performance.
Fine, connected to the Emotiv EPOC receiver
Exception in thread Thread-1:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 530, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 483, in run
self.__target(_self.__args, *_self.__kwargs)
File "/path/to/the/qdot-emokit-5ee6d54/python/emotiv.py", line 99, in reader
self.hidraw = open("/dev/hidraw5")
IOError: [Errno 2] No such file or directory: '/dev/hidraw5'

Fun fact: So far, I understand that the "setupPosix" function in emotiv.py always return True (no matter if the device has been found or not), which makes the script display: "Fine, connected to the Emotiv EPOC receiver" :D

Note: I have pyusb (1.0.0a2) and libusb (1.0) installed on my machine.

Please let me know, if I forgot to mention any other important information.

Thank you,

Unable to run example

I have compiled the Emokit C code, installed the udev rules,but I have these errors:

Jun 18 02:54:00 localhost mtp-probe: checking bus 1, device 4: "/sys/devices/pci0000:00/0000:00:06.0/usb1/1-2"
Jun 18 02:54:00 localhost mtp-probe: bus: 1, device: 4 was not an MTP device
Jun 18 02:54:00 localhost udevd[988]: NAME="eeg/epoc%2" ignored, kernel device nodes can not be renamed; please fix it in /etc/udev/rules.d/epoc.rules:10
Jun 18 02:54:00 localhost udevd[1149]: NAME="eeg/encrypted%n" ignored, kernel device nodes can not be renamed; please fix it in /etc/udev/rules.d/epoc.rules:16
Jun 18 02:54:01 localhost udevd[1499]: failed to execute '/usr/lib/udev/decrypt_emotiv.sh' 'decrypt_emotiv.sh research': No such file or directory

I am running Fedora 17 32 bit. Where is the "decrypt_emotiv.sh"?

Bring in DSP Example

We have a nice DSP example using FFTW in #30, but it'll need to be updated for the new HIDAPI changes, plus have FFTW finding added to cmake.

New Headset has different vendor and product ids

$ lsusb
<snip>
Bus 005 Device 008: ID 1234:ed02 Unknown Emotiv EPOC Developer Headset Wireless Dongle

Changing the values of EMOKIT_VID and EMOKID_PID in emokit/emokit.h lets me get a little farther with the contact example, although hid_open_path() is still failing.

CMake says: Could NOT find HIDAPI (missing: HIDAPI_LIBRARY)

Hello there,

I'm just trying to run cmake so I can compile and use the examples (I'm OS X 10.7.3), but it tells me this:

CMake Error at /opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (MESSAGE):
Could NOT find HIDAPI (missing: HIDAPI_LIBRARY)
Call Stack (most recent call first):
/opt/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:288 (_FPHSA_FAILURE_MESSAGE)
cmake_modules/FindHIDAPI.cmake:33 (find_package_handle_standard_args)
CMakeLists.txt:11 (FIND_PACKAGE)

I thought this was supposed to work out of the box? Where am I supposed to put hidapi.h for cmake to be able to find it? I've got it in /opt/local/include and that's in my path...

Is there some directory variable that I have to change in one of the cmake config files? I tried changing HID_INCLUDE_DIR in FindHIDAPI.cmake to no avail.

Thanks!

Fix Python Code

I removed the python classes at 59b14aa because they simply didn't work anymore. We should fix them up and bring them back, as they are handy.

OpenVibe driver

Heya,

As mentioned earlier I wrote an openvibe driver using the emokit library. The code is there: https://github.com/antoche/openvibe
I've sent it to the openvibe developers (http://openvibe.inria.fr/forum/viewtopic.php?f=14&t=1023), hopefully it will be incorporated into their repo.

To get it to work, I had to add the emokit_get_next_frame declaration in emokit.h. I don't know why it wasn't there, I suppose it's an error. It's funny that the examples compiled without it (I suppose the compiler options must be quite lax). I also had to set type=1 in emokit_get_crypto_key to get the correct data.

There was a couple other things not quite right either in the API (e.g., according to the docstring, emokit_read_data returns 0 on success, but in reality it returns the number of bytes read off the device), but since the API is going to change anyway it's not really worth going over it.

Cheers,
A.

Access violation reading location - VS2008 Win7

I just found that in compile time the Emokit - compiles fine in VS2008 - Windows7 for the Epoc Headset - developer edition.

But during the runtime , it throws " Access violation reading location"
the error listed follows:
.
.
First-chance exception at 0x67b730c0 in emokitd.exe: 0xC0000005: Access violation reading location 0xcdcdcdcd.
Unhandled exception at 0x67b730c0 in emokitd.exe: 0xC0000005: Access violation reading location 0xcdcdcdcd.
The program '[8020] emokitd.exe: Native' has exited with code -1073741819 (0xc0000005).
.
.
it shows the runtime error in the function -- nbytes = hid_get_feature_report(dev, buf, sizeof(buf));
int emokit_identify_device(hid_device dev) {
/
currently we check to see if the feature report matches the consumer
model and if not we assume it's a research model.*/
int nbytes=0;
int i, dev_type = EMOKIT_CONSUMER;
char buf[EMOKIT_REPORT_SIZE];
char report_consumer[] = {0x00, 0xa0, 0xff, 0x1f, 0xff, 0x00, 0x00, 0x00, 0x00};
buf[0] = EMOKIT_REPORT_ID;
nbytes = hid_get_feature_report(dev, buf, sizeof(buf));
if (nbytes != EMOKIT_REPORT_SIZE)
{
return -1;
}
for (i=0; i < nbytes; ++i) {
if (buf[i] != report_consumer[i]) {
dev_type = EMOKIT_RESEARCH;
break;
}
}
return dev_type;
}

pls help me to fix this..

udev, C, python and gyro...

Hi there,

I've just received my (consumer) headset and started playing around with emokit (awesome effort,by the way!). I'm running into some issues under linux that I hoped you could help me solve.

I've copied the udev rules and restarted udev as described in the docs, but I'm not seeing any /dev/eeg device. I see that the rules reference a script (decrypt_emotiv.sh) that doesn't seem to exist in the repo. I guess that's why the device is not created? What's supposed to be in that script? Is it meant to call the emokitd binary?

I've tried compiling the C code, but I'm getting a "fatal error: emokit/emokit.h: No such file or directory" unless I symlink the include/emokit folder from /usr/include. Is that the correct way to do or am I missing a step?

I've tried running the python code, but because the /dev/eeg device does not exist, it takes a path where it tries to decrypt the packets from /dev/hidraw in python but the self.rijn object doesn't exist. I managed to work around the problem by creating self.rijn in setupPosix() using my consumer key (that I retrieved under Windows using the steps provided by eskel). This way I managed to get the render.py script to plot the correct EEG data. I also had to correct a few changes that were added lately that were making that path work even less (the _dataReader thread got removed, gotData was not appending to self.packets, etc.).

I also noticed that the gyro data, when the headset is immobile, gives me a value of -4 for X and 1 for Y instead of (0,0) in python (haven't tried C yet). The gyro works correctly with Emotiv's tools. Could there be an error in the gyro decoding?

Cheers,
A.

Write some build documentation

Unless you know what you're doing with cmake, building might look a little weird. Add documentation to readme to fix that.

Help with integrating emokit with another project

I wish to make a emokit driver for this project: https://github.com/SmartphoneBrainScanner/smartphonebrainscanner2-core/tree/master/src/hardware . I understand what interfaces I need to implement in the above project and how I need to use the emokit library, but i'm a bit lost in terms of the building side of things with the emokit library... I notice they have hidapi covered in here
[https://github.com/SmartphoneBrainScanner/smartphonebrainscanner2-core/blob/master/src/sbs2.pri], and i could refer to that header file in emokit.c/h, but I'm not sure what I need to do about mcrypt... can anybody give me a much appreciated hand?

I'm only accustomed to using standard libraries with C and writing uncomplicated Makefiles... I wish I had more experience! Sorry if this question is ill posed...

Closed: I seem to have a better idea of how libraries work in C now... Found libemokit.a. Sorry for posing this question at all!

ioctl (GFEATURE): Invalid argument error

Hi,
I have setup EMOKIT on CentOS 6.4 and tried using bin/contact and bin/emokitd and received the next:

Current epic devices connected: 2
ioctl (GFEATURE): Invalid argument error
Connected to headset

but nothing more. Any idea what is the problem

Channels masks ? / errors in doc ?

hello,

I don't understand the definition of channels mask seen in emokit.c. For each channels there are a list of bit position, but this list does not match the bits showed in the documentation:https://github.com/qdot/emokit/blob/master/doc/emotiv_protocol.asciidoc.

Anyway, it seems to work like this, but so it would mean raw data for a given channel may be scattered all around a frame ? then how did you do to find these masks??

Also I suppose these lines are wrong in the doc:

  • 121:133 TP7 DATA should be '121:134' (and the following positions accordingly to this shift)
  • TP8 DATA has only 8 bits ??

well maybe this part of the doc is not up to date, or does it? Im a little lost here..
If someone can confirm there are some problems here (or confirm I didnot understand a thing!) I may try to correct these in the coming days

How is the Encryption key generated?

Does anyone know if the Encryption key of the dongle that Daeken figured out to break is static? Or a new one is generated every time you connect the dongle into the USB port?

I'm trying to extract the EEG raw data from the headset in an Android device.

Thanks in advance

I`M SORRY I DIDN'T READ THE emokit / doc / emotiv_protocol.asciidoc BEFORE, AND THERE IS THE ANSWER TO MY QUESTION.

Is it possible to read the reference ?

Hi,
I just got an emotiv epoc headset.
I am trying the python and the c libraries.
In both libraries data is decrypted for 14 sensors.
Has anyone ever looked if the reference electrodes' data can be also read from the usb stream?

Thank you in advance
Best
tsalafatinos

Unable to compile emokit_osc in Mac OSX 10.6

Hi all,

I have install everything indicated so far in the README for OSX.
Then, when I do a cmake, I get a :

-- Found mcrypt: /usr/local/lib/libmcrypt.dylib
-- Found libusb-1.0:
-- - Includes: /usr/local/include/libusb-1.0
-- - Libraries: /usr/local/lib/libusb-1.0.dylib
-- /usr/local/lib/libmcrypt.dylib/usr/local/lib/libusb-1.0.dylib
-- Found oscpack: /usr/local/lib/liboscpack.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/XXX/Downloads/qdot-emokit-2fa5e40/qdot-emokit-2fa5e40
XXX:qdot-emokit-2fa5e40

However, nothing seems compiled so far.
What is the procedure for running the C examples?

Thanks for your help,

Guillaume

Build error: Redefinition of typededef ''MCRYPT" is invalid

I am trying to compile emokit on Mac OS X 10.7.4 I succesfully ran cmake and opened the project up in xcode I had a few errors relating to wrong paths to emokit.h and libusb.h after fixing those I got stuck on this error on line 37 in emokit.h:

Redefinition of typededef 'MCRYPT' is invalid

The line is: typedef struct CRYPT_STREAM *MCRYPT;

Which Emotiv?

Could the readme make clear which Emotiv model(s) this library works with? I'm unclear if the $300 consumer model is enough or if the $500 kit is necessary. Thanks!

Various problems

I have a consumer headset and i'm having some issues, the signal quality number isn't correct, is always 4 even if the headset isn't being used. with example render.py i'm having a lot of activity even is not being used (always color green). Also, all sensor values seems like print random cause i get similar data with headset than without it

Seeing 2 devices when there's only 1 connected on windows/linux+libusb

Whenever we run hid_enumerate on windows or linux using libusb, we get a device count of 2 even when there's only one device available. This means that if we try to connect to device index 0 instead of device index 1, we don't actually read anything (epocd example hangs on "Starting read").

CURRENT WORKAROUND:

If you are seeing 2 devices in count when you only have 1 connected, try changing emokit_open's device index (the last argument of the function) to 1 instead of 0. Opening the 2nd device that we see tends to make emokit work. That said, we're still looking to fix this so that doesn't need to happen.

python port doesn't work in OS X

Looks like the python code is expecting to see the Linux /sys/class/hidraw

python render.py 
No psyco.  Expect poor performance. Not really...
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gevent/greenlet.py", line 390, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/samuel/Documents/Projects/emokit/python/emotiv.py", line 234, in setup
    self.setupPosix()
  File "/Users/samuel/Documents/Projects/emokit/python/emotiv.py", line 331, in setupPosix
    setup = self.getLinuxSetup()
  File "/Users/samuel/Documents/Projects/emokit/python/emotiv.py", line 250, in getLinuxSetup
    for filename in os.listdir("/sys/class/hidraw"):
OSError: [Errno 2] No such file or directory: '/sys/class/hidraw'
<Greenlet at 0x107b09eb0: <bound method Emotiv.setup of <emotiv.Emotiv object at 0x1078073d0>>> failed with OSError

Emokit Setup on Windows 7 64-bit using MSVC 2008

I am trying to setup Emokit using MSVC 2008, I have installed the prerequisites like WDK and libmcrypt. include paths are set as well. But still i am getting too many strange errors, which i am trying to figure out, Any help regarding that would really be great.

There is also confusion regarding C implementation of Emokit on windows . as it is mentioned in the readme file that

"
The C library is currently supported on:

OS X/Linux - Via libusb-1.0
Windows - Coming soon (via good ol' Win32 HID calls)

"
Is it kind of old readme or what??? , kindly confirm me that Emokit C implementation works on Windows platform or not .
i am using Win 7 64-bit, i have a Research Emotive headset, although i have access to raw data but i want to compare the data rates provided by Emotiv SDK and from the USB interface directly.

here are the Errors

2>Compiling...
2>epoc.c
2>epoc_win32.c
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(307) : error C2085: 'HidP_GetCaps' : not in formal parameter list
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(323) : error C2061: syntax error : identifier '__drv_maxIRQL'
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(360) : error C2085: 'HidP_GetSpecificButtonCaps' : not in formal parameter list
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(413) : error C2061: syntax error : identifier '__drv_maxIRQL'
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(433) : error C2085: 'HidP_GetSpecificValueCaps' : not in formal parameter list
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(488) : error C2061: syntax error : identifier '__drv_maxIRQL'
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(506) : error C2085: 'HidP_GetExtendedAttributes' : not in formal parameter list
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(531) : error C2061: syntax error : identifier '__drv_maxIRQL'
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(653) : error C2085: 'HidP_GetData' : not in formal parameter list
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(699) : error C2061: syntax error : identifier '__drv_maxIRQL'
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(1012) : error C2085: 'HidP_GetUsagesEx' : not in formal parameter list
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(1077) : error C2061: syntax error : identifier '__drv_maxIRQL'
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(1672) : error C2085: 'HidP_UsageListDifference' : not in formal parameter list
2>c:\winddk\7600.16385.1\inc\api\hidpi.h(1697) : error C2061: syntax error : identifier '__drv_maxIRQL'
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(80) : error C2143: syntax error : missing ')' before '('
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(80) : error C2081: '__drv_when' : name in formal parameter list illegal
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(80) : error C2143: syntax error : missing ')' before 'return'
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(80) : error C2091: function returns function
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(80) : error C2143: syntax error : missing '{' before 'return'
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(80) : error C2059: syntax error : 'return'
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(104) : error C2143: syntax error : missing ')' before '('
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(104) : error C2091: function returns function
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(105) : error C2059: syntax error : ')'
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(105) : error C2085: 'PreparsedData' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(110) : error C2085: 'HidD_FlushQueue' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(130) : error C2085: 'HidD_GetConfiguration' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(156) : error C2085: 'HidD_SetConfiguration' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(186) : error C2085: 'HidD_GetFeature' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(212) : error C2085: 'HidD_SetFeature' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(238) : error C2085: 'HidD_GetInputReport' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(264) : error C2085: 'HidD_SetOutputReport' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(289) : error C2085: 'HidD_GetNumInputBuffers' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(312) : error C2085: 'HidD_SetNumInputBuffers' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(337) : error C2085: 'HidD_GetPhysicalDescriptor' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(363) : error C2085: 'HidD_GetManufacturerString' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(389) : error C2085: 'HidD_GetProductString' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(416) : error C2085: 'HidD_GetIndexedString' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(443) : error C2085: 'HidD_GetSerialNumberString' : not in formal parameter list
2>C:\WinDDK\7600.16385.1\inc\api/hidsdi.h(470) : error C2085: 'HidD_GetMsGenreDescriptor' : not in formal parameter list
2>..\c\src\epoc_win32.c(17) : error C2085: 'ActualBytesRead' : not in formal parameter list
2>..\c\src\epoc_win32.c(18) : error C2085: 'BytesRead' : not in formal parameter list
2>..\c\src\epoc_win32.c(19) : error C2085: 'Capabilities' : not in formal parameter list
2>..\c\src\epoc_win32.c(20) : error C2085: 'cbBytesRead' : not in formal parameter list
2>..\c\src\epoc_win32.c(21) : error C2085: 'detailData' : not in formal parameter list
2>..\c\src\epoc_win32.c(22) : error C2085: 'dwError' : not in formal parameter list
2>..\c\src\epoc_win32.c(23) : error C2085: 'FeatureReport' : not in formal parameter list
2>..\c\src\epoc_win32.c(24) : error C2085: 'hEventObject' : not in formal parameter list
2>..\c\src\epoc_win32.c(25) : error C2085: 'hDevInfo' : not in formal parameter list
2>..\c\src\epoc_win32.c(26) : error C2085: 'HidGuid' : not in formal parameter list
2>..\c\src\epoc_win32.c(27) : error C2085: 'HIDOverlapped' : not in formal parameter list
2>..\c\src\epoc_win32.c(28) : error C2085: 'InputReport' : not in formal parameter list
2>..\c\src\epoc_win32.c(29) : error C2085: 'Length' : not in formal parameter list
2>..\c\src\epoc_win32.c(30) : error C2085: 'lpOverLap' : not in formal parameter list
2>..\c\src\epoc_win32.c(31) : error C2085: 'MyDeviceDetected' : not in formal parameter list
2>..\c\src\epoc_win32.c(31) : error C2143: syntax error : missing ';' before '='
2>..\c\src\epoc_win32.c(54) : warning C4013: 'HidD_GetPreparsedData' undefined; assuming extern returning int
2>..\c\src\epoc_win32.c(69) : warning C4013: 'HidP_GetCaps' undefined; assuming extern returning int
2>..\c\src\epoc_win32.c(70) : error C2065: 'Capabilities' : undeclared identifier
2>..\c\src\epoc_win32.c(86) : error C2065: 'Length' : undeclared identifier
2>..\c\src\epoc_win32.c(87) : error C2065: 'detailData' : undeclared identifier
2>..\c\src\epoc_win32.c(87) : warning C4047: '=' : 'int' differs in levels of indirection from 'void *'
2>..\c\src\epoc_win32.c(96) : error C2065: 'HidGuid' : undeclared identifier
2>..\c\src\epoc_win32.c(96) : warning C4133: 'function' : incompatible types - from 'int *' to 'LPGUID'
2>..\c\src\epoc_win32.c(104) : error C2065: 'hDevInfo' : undeclared identifier
2>..\c\src\epoc_win32.c(105) : error C2065: 'HidGuid' : undeclared identifier
2>..\c\src\epoc_win32.c(105) : warning C4133: 'function' : incompatible types - from 'int *' to 'const GUID *'
2>..\c\src\epoc_win32.c(108) : warning C4047: '=' : 'int' differs in levels of indirection from 'HDEVINFO'
2>..\c\src\epoc_win32.c(131) : error C2065: 'hDevInfo' : undeclared identifier
2>..\c\src\epoc_win32.c(131) : warning C4022: 'SetupDiEnumDeviceInterfaces' : pointer mismatch for actual parameter 1
2>..\c\src\epoc_win32.c(133) : error C2065: 'HidGuid' : undeclared identifier
2>..\c\src\epoc_win32.c(133) : warning C4133: 'function' : incompatible types - from 'int *' to 'const GUID *'
2>..\c\src\epoc_win32.c(163) : error C2065: 'hDevInfo' : undeclared identifier
2>..\c\src\epoc_win32.c(163) : warning C4022: 'SetupDiGetDeviceInterfaceDetailA' : pointer mismatch for actual parameter 1
2>..\c\src\epoc_win32.c(167) : error C2065: 'Length' : undeclared identifier
2>..\c\src\epoc_win32.c(172) : error C2065: 'detailData' : undeclared identifier
2>..\c\src\epoc_win32.c(172) : error C2065: 'Length' : undeclared identifier
2>..\c\src\epoc_win32.c(172) : warning C4047: '=' : 'int' differs in levels of indirection from 'PSP_DEVICE_INTERFACE_DETAIL_DATA'
2>..\c\src\epoc_win32.c(176) : error C2065: 'detailData' : undeclared identifier
2>..\c\src\epoc_win32.c(176) : error C2223: left of '->cbSize' must point to struct/union
2>..\c\src\epoc_win32.c(181) : error C2065: 'hDevInfo' : undeclared identifier
2>..\c\src\epoc_win32.c(181) : warning C4022: 'SetupDiGetDeviceInterfaceDetailA' : pointer mismatch for actual parameter 1
2>..\c\src\epoc_win32.c(183) : error C2065: 'detailData' : undeclared identifier
2>..\c\src\epoc_win32.c(183) : warning C4047: 'function' : 'PSP_DEVICE_INTERFACE_DETAIL_DATA_A' differs in levels of indirection from 'int'
2>..\c\src\epoc_win32.c(183) : warning C4024: 'SetupDiGetDeviceInterfaceDetailA' : different types for formal and actual parameter 3
2>..\c\src\epoc_win32.c(184) : error C2065: 'Length' : undeclared identifier
2>..\c\src\epoc_win32.c(185) : fatal error C1903: unable to recover from previous error(s); stopping compilation
2>Generating Code...
2>Build log was saved at "file://c:\AsimRaza\Softwares\EEG\EMOKIT_EmotivReverseEng\qdot-emokit-e72a187\qdot-emokit-e72a187\Bin\epoc.dir\Debug\BuildLog.htm"
2>epoc - 73 error(s), 13 warning(s)
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

installation on mac os x

Hi, two issues.

  1. You write that we need to install some libraries. Where do they go once downloaded? You only give instructions for the emotiv library.

  2. I followed the instructions to install it and got an error:

    andrewgoldfine$ sudo kextutil /System/Library/Extensions/EmotivNullDriver.kext
    /System/Library/Extensions/EmotivNullDriver.kext has problems:
    Authentication Failures:
    File owner/permissions are incorrect (must be root:wheel, nonwritable by group/other):
    /System/Library/Extensions/EmotivNullDriver.kext
    /System/Library/Extensions/EmotivNullDriver.kext/Contents
    /System/Library/Extensions/EmotivNullDriver.kext/Contents/Info.plist
    /System/Library/Extensions/EmotivNullDriver.kext/Contents/pbdevelopment.plist
    /System/Library/Extensions/EmotivNullDriver.kext/Contents/Resources
    /System/Library/Extensions/EmotivNullDriver.kext/Contents/Resources/English.lproj
    /System/Library/Extensions/EmotivNullDriver.kext/Contents/Resources/English.lproj/InfoPlist.strings

Warnings:
Personality CFBundleIdentifier differs from containing kext's (not necessarily a mistake, but rarely done):
Driver1
Driver2

Headset bought in 04/2011 has different key

Hi guys, I found out that the device I bought in April, 2011 has yet another key from the one posted in https://github.com/qdot/emokit/issues/4.

I had trouble following through the directions that eskel posted for extracting the key (the hardware breakpoint was not working for me, so I was unable to follow his directions from there on). I resorted to breaking on memcpy function call and looking for when the argument n = 0x10 (or 16 in decimal) to get my key. The key I found is '\x4E\x00\x53\x54\x38\x10\x37\x42\x4E\x00\x53\x48\x38\x00\x37\x50'.

Also, filter = hid.HidDeviceFilter(vendor_id=0x21A1, product_name='Brain Waves') does not work for me as the product_name has been changed. I found two devices with vendor_id=0x21A1 and product_id=0x0001. One is named 'EPOC BCI' and the other is named '00800000046'. I ended up using the one named in numbers as that was the one that provided me with the raw data.

I would appreciate it if someone knowledgeable with OllyDbg can re-outline the steps necessary in obtaining the key so that other people don't have to suffer through what I did to find the key. I think the Python code also needs to be updated with the newer keys and a better method for searching the Emotiv device.

AssertionError

Hello All,

I am trying to install and run this great hack that has been developed. Although I have been having some troubles.

When I run any of the code in python or even this simple script:

import emotiv
headset = emotiv.Emotiv()
try:
while True:
for packet in headset.dequeue():
print packet.gyroX, packet.gyroY
finally:
headset.close()

I get the following error:

Traceback (most recent call last):
File "findEmo.py", line 2, in
headset = emotiv.Emotiv()
File "C:\Users\Juan\Desktop\qdot-emokit-91497ae\python\emotiv.py", line 73, in init
if self.setupWin(headsetId) if windows else self.setupPosix(headsetId):
File "C:\Users\Juan\Desktop\qdot-emokit-91497ae\python\emotiv.py", line 82, in setupWin
assert len(devices) > headsetId
AssertionError

What would cause this problem?

Thank you for your help!!

-- Juan

Headset bought in 06/2011 not working properly

Hi,
first of all - thanks a lot for work done!

Second, I bought mine headset at end of June and have following issues:

(EDITed with new information about behaviour)

Python script:

  1. Device HID ID was changed, filter = hid.HidDeviceFilter(vendor_id=0x21A1, product_name='Brain Waves') will not return any device. If product_name='Brain Waves' is removed, two devices are returned (see bottom for full info).
  2. When number 1. is fixed, when dequeue method is called, len(self.packets) always returns 0. Method handle in set_raw_data_handler(handle) is never called. Seems to me that python code is not receiving any data from HID device.
    I tried both HID devices.

Do you have any idea if this problem can caused by pywinusb, wrong key (but decryption is never called so this is probably not the cause) or anything else?

C library:

  1. The HID device with data is now with count 1 not 0 as in code (epoc_open(d, EPOC_VID, EPOC_PID, 0) needs to be changed to epoc_open(d, EPOC_VID, EPOC_PID, 1)).
  2. Data are now pouring from epoc_get_next_frame(), but it seems that decryption key (I tried all four of them available) is incorrect. I imported resulting stream into EEGLab and channels looks random.

If I can some help to resolve this issues, please let me know,
E.

HID device (vID=0x21a1, pID=0x0001, v=0x0003); Emotiv Systems Inc.; EPOC BCI, Path: ?\hid#vid_21a1&pid_0001&mi_00#7&e2b2427&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Path: ?\hid#vid_21a1&pid_0001&mi_00#7&e2b2427&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Instance: HID\VID_21A1&PID_0001&MI_00\7&E2B2427&0&0000
Port (ID): 2976
Port (str): USB\VID_21A1&PID_0001&MI_00\6&2A34355C&0&0000

HID device (vID=0x21a1, pID=0x0001, v=0x0003); Emotiv Systems Inc.; 00000000000, Path: ?\hid#vid_21a1&pid_0001&mi_01#7&15ac199b&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Path: ?\hid#vid_21a1&pid_0001&mi_01#7&15ac199b&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Instance: HID\VID_21A1&PID_0001&MI_01\7&15AC199B&0&0000
Port (ID): 3072
Port (str): USB\VID_21A1&PID_0001&MI_01\6&2A34355C&0&0001

My gyroX is constantly -3

For some reason, my gyroX is always -3 (I use the Python code).

As a quick fix, I set

        self.gyroX = ord(data[29]) - 106 + 3

in emotiv.py.

Is this known? Why could this happen? Maybe my gyro is miscalibrated in hardware? Can somebody check with their device?

signal quality & battery values

I have two machines. both are mac and both are lion. on the first, I'm using the standard driver. when I plug the headset into that machine, I can see the current battery charge level, but using emokit on this machine, it always says 0.

second, I don't seem to get signal quality either for any of the leads.

however, I think this problem could be bigger, because the gyros don't give me constant numbers... and I'm not moving my head. in the epoc app on the other machine, it works as it should.

am I doing something wrong? perhaps I'm not decoding it right? I'm just outputting all of the terminals with the recompiled bin/emokitd

I'd really like to get this working... it'd be awesome to get my own signals :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.