cymaticorp / cykitv2 Goto Github PK
View Code? Open in Web Editor NEWPython Data Controller for Neural EEG headsets. (Windows)
License: Other
Python Data Controller for Neural EEG headsets. (Windows)
License: Other
Hello,
I was wondering if there is an easy way to grab the live data stream ?
I want to train a neural network to recognize emotions and then use the live data to predict an emotion. Unfortunatly I don't quite understand how you grab and save the data in the .csv (eeg.py).
Thanks in advance!
thanks for this useful code
some questions?
dose it work with epoc+ 2017+ models ?
does it work with py3+?
Hi, I have a problem when I try to connect the controller.
When I execute the example 1, python.exe CyKITv2.py 127.0.0.1 18675 2 , I get this error:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Users\SIC\Downloads\CyKITv2-master\Python\eeg.py", line 239, in run
cipher = AES.new(key, AES.MODE_ECB, iv)
File "C:\Python27\lib\site-packages\Crypto\Cipher\AES.py", line 202, in new
return create_cipher(sys.modules[name], key, mode, *args, **kwargs)
File "C:\Python27\lib\site-packages\Crypto\Cipher_init.py", line 53, in _c
reate_cipher
raise TypeError("IV is not meaningful for the ECB mode")
TypeError: IV is not meaningful for the ECB mode
What is the problem? Thanks.
Hi again Warren,
Got a couple of quick questions for ya, regarding CyKit's initialization as well as the accuracy of the data stream I'm seeing from EPOC. Please take your time to address these :
When I run the following command from a terminal in the CyKit python folder, I get a detailed list of the bluetooth/hardware devices available to me:
python CyKITv2.py 127.0.0.1 55555 2 info+confirm
The headset I have is one of the older EPOC developer models. And when I attempt to connect, the listings corresponding to my EPOC headset are usually the last 2 entries, listed as EPOC BCI and the last entry is simply identified as a string of 0s (see first attached screenshot). Your script seems to identify and accept only the last entry, if I attempt to type in anything else, it simply gives an error like Device not selected and then exits. I'm not sure if the selection is correct, how do I force the script to accept the EPOC BCI device/entry instead?
Just to test it out, I accepted the default selection and once the CyKit2 front-end comes alive, I see graphs of what seems to be data coming in from all 14 channels (plz see the 2nd screenshot). My simplest test is to blink my eyes to see if I get the corresponding artifacts from the AF sensors. However, they either come in delayed OR in some cases, I dont even see those artifacts on the graphs at all. Is there any other way for me to test if CyKit is receiving data correctly and from the correct device? Do you have a calibration routine I could probably use to test my device + CyKit2 as well??
With regards,
Teknomage
As mentioned here https://github.com/CymatiCorp/CyKITv2/blob/gitImages/Documentation/Bluetooth_Development-Epoc.pdf the data packet size is 19.
When I am capturing data packets using BTLE on Ubuntu 16.04.3, the size is 20.
Can anyone please tell me the data format or how to get data from these packets.
I have attached raw data capture from BTLE.
insight_raw_data.log
Anyone can tell me if the EPOC in the CyKITv2 option 1&2 means the Emotiv EPOC FLEX Kit, the 32-electrode saline or gel cap?
And also, since the EPOC+ supports the BLTE while EPOC FLEX doesn't, is there difference using CyKITv2 for these two devices?
Thanks a lot!
python CyKITv2.py 127.0.0.1 55555 6 info
> Listening on 127.0.0.1 : 55555
> Trying Key Model #: 6
* Connecting . . .
> Connected!
<socket._socketobject object at 0x01E7B148>
MainThread
Product name Brain Computer Interface USB Receiver/Dongle
device path \\?\hid#vid_1234&pid_ed02&mi_00#8&652ddc4&0&0000#{4d1e55b2-f16f-11cf -88cb-001111000030}
instance id HID\VID_1234&PID_ED02&MI_00\8&652DDC4&0&0000
________________________________________________________________________________
>>> Found EEG Device >>> Brain Computer Interface USB Receiver/Dongle
> Using Device: Brain Computer Interface USB Receiver/Dongle
Serial Number: UD20160303001D0F
Product name EEG Signals
device path \\?\hid#vid_1234&pid_ed02&mi_01#8&2a2a1b86&0&0000#{4d1e55b2-f16f-11c f-88cb-001111000030}
instance id HID\VID_1234&PID_ED02&MI_01\8&2A2A1B86&0&0000
________________________________________________________________________________
>>> Found EEG Device >>> EEG Signals
> Using Device: EEG Signals
Serial Number: UD20160303001D0F
Thread-1
ioThread
Thread-3
MainThread
Thread-2
eegThread
Thread-4
Active Threads = {
<InputReportProcessingThread ::: Thread-1>
<Thread ::: ioThread>
<InputReportProcessingThread ::: Thread-3>
<_MainThread ::: MainThread>
<InputReportReaderThread ::: Thread-2>
<Thread ::: eegThread>
<InputReportReaderThread ::: Thread-4>
}
Then , the console doesn't print any more, and website can't see any eeg lines. what's the problem?
How can I see which mode I should use for my device?
Can anyone please direct me towards getting raw data from Emotiv headset using BLE connection?
false alarm...
Hi warrenarea,
We're working on a BCI project using EPOC+ where we want to save the EEG data from CyKit in a numpy array, how can this be done if it's possible?
Thanks in advance.
Hi warrenarea,
It is really a nice project, given access to raw data from EEG headset.
Besides visualization of raw EEG data from the plot in web is useful, direct manipulation of raw EEG data is also very important for BCI research.
I saved some raw EEG data using the API to a CSV file. However, after some inspection, I found the data saved into the CSV file is very different from the one being plotted in web (in some way?).
Here is the example (they are roughly synchronized):
It seems to me the plot in web is quite correct (I shake gently with the headset), while the plot through the data as saved in CSV is not realistic.
I believe the data itself should be correctly fetched from EEG headset. However, I suspected that, due to some (running environment, formatting, python vs. web?) factor, the data saved in CSV file not the one we want, although it is correct in some way.
Could you please give me some hints on this discrepancy? What could be cause for this issue?
i need to know the meaning each column in recorded data
i am in the project that we want to deal with time so which refer to time ?
Hi warrenarea,
I have used your project, it's an excellent project, I can get EEG raw data to do some experiments.
But I have a question: is the raw data obtained from Cykitv2 same as from EmotivPro?
Thanks a lot!!
Hi
Do you think you will creat a Unity plugin?
I question myself about the link with the two. Epoc works only with 32bit? and Unity 64 bit?
thanks
Could you tell me how to port it to linux. Since I will be using Insight headset with ROS kinetic.
As expected, the sample rate of the Emotiv EPOC+ is 128Hz.
When I used your Tool, I used websocket to set connection, then saved the data in a file. But the sample rate of the data I collected is just about 90Hz, I can't figure out what's wrong with that?Will the data be inaccurate, and how can I solve it? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.