Git Product home page Git Product logo

cykit's Introduction

CyKIT 3.0 for Python 3.x (Linux)

Until MAC/Linux support can be integrated into this repository,
Please see this branch for MAC/Linux support.
https://github.com/tahesse/CyKITv2

CyKIT 3.0 for Python 3.7.x (Windows)

Last Updated: [ December 27, 2018 - 1:00pm ]

Language Support (Python 3.x)


 Supported Python 3 Versions
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Python 3.4.x  (32-bit or 64-bit)
Python 3.6.x  (32-bit or 64-bit) 
Python 3.7.x  (32-bit or 64-bit) 
Python 3.8.x  (32-bit or 64-bit) 
Python 3.9.x  (32-bit or 64-bit)

Latest Python Build: Python 3.9.5

Python 2.7.6 support will now be limited.
Python 3+ will be the focus. (Please upgrade accordingly.)

Headset Support

Does not currently work with Epoc-X
See Discord for details about Flex.

Program Flowchart

(MATLAB/Unity3D plugins have been created, but currently not included in repository)

Browser Interface

Documentation

Introduction
Software (How To)

Communication

Chat Discussion: https://discordapp.com/invite/gTYNWc7
(Do not need discord app, just click for browser chat)

Version History

Deprecated CyKIT versions can be found here:
(CyKIT Version History)

CyKIT v1.0 python 2.7.6 (2014)
CyKIT v1.0 python 3.3.x (2015)
CyKIT v2.0 Python 2.7.6 (2018.Jan.29)

Documentation

Bluetooth Development Documentation



cykit's People

Contributors

warrenarea 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

cykit's Issues

About Epoc X

How Can I connect Epoc X via Cykit? What is the Key Number of it?

Have a nice day.

Is Epoc Flex supported?

First, thank you all for the huge effort done towards this project.

I wanted to know if the current code will support Epoc Flex 1.0

If so, do I need to use keymodel 4 (insight) to get it working?

I've been reading old discussions from the past years about this topic, but I'm not sure what part of the discussion was already incorporated to the current code.

Version for Mac and Linux

Would be awesome when you guys could port/modify in a way that it will also work on Mac and/or Linux.

About developing the adapted version of EPOC X

Hello, I really admire the work you have done, and I‘m about to use the project you have developed.
I found that the device I bought was EPOC X, which is the unsupported version you marked in the documentation. However, I can still read the data, but the data seems to have some problems.
I wonder if you have any plans to continue updating the EPOC X version?
Thanks in advance!

Stucks on "Connecting..."

Hello, CyKit.py can see Epoc+ USB dongle but stucks on "Connecting..."
Can you help me to troubleshoot this plz?

Environment: Win10 x64, Python 3.7.2 x86

image

Emotiv Insight

Hey There

I have followed you How-to-Install-CyKIT'

https://github.com/CymatiCorp/CyKit/wiki/How-to-Install-CyKIT

and get to Step 5. and get...

C:\CyKit-master\Py3>c:/Users/Blair/AppData/Local/Programs/Python/Python38-32/python.exe .\CyKIT.py
Traceback (most recent call last):
File ".\CyKIT.py", line 16, in
import eeg
File "C:\CyKit-master\Py3\eeg.py", line 161, in
from cyCrypto.Cipher import AES
File ".\cyCrypto\Cipher_init_.py", line 3, in
from cyCrypto.Cipher._mode_ecb import _create_ecb_cipher
File ".\cyCrypto\Cipher_mode_ecb.py", line 40, in
raw_ecb_lib = load_pycryptodome_raw_lib("cyCrypto.Cipher._raw_ecb" + cyVersion, """
File ".\cyCrypto\Util_raw_api.py", line 259, in load_pycryptodome_raw_lib
raise OSError("Cannot load native module '%s': %s" % (name, ", ".join(attempts)))
OSError: Cannot load native module 'cyCrypto.Cipher._raw_ecb38x32': Trying '_raw_ecb38x32.cp38-win32.pyd': Could not find module 'C:\CyKit-master\Py3\cyCrypto\Cipher_raw_ecb38x32.cp38-win32.pyd' (or one of its dependencies). Try using the full path with constructor syntax., Trying '_raw_ecb38x32.pyd': Could not find module 'C:\CyKit-master\Py3\cyCrypto\Cipher_raw_ecb38x32.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

any ideas? I really dont know python at all...

I am on a macbook 2020 in win 10 with boot camp with a Emotiv Insight with dongle, trying to get OSC into touchdesigner. most interested in the emotion performance metrics, but would also like the raw data and the brainwaves (alpha, beta, etc)

I downloaded the latest python 3.8 but maybe I need to try with 3.7? anything else i need to try?
I havnt been in MS-DOS or Command prompt for years.. Been hiding in MacOS since 2012 :)

Archiving emokit and pointing README to CyKit?

Looks like Cykit has come a long way since I last looked! Emokit is going to continue to stay dead (I have zero time to even think about EEGs anymore), and I was considering archiving it, so I should I just point people over here in the README?

Error in Core.py causing the device not to close properly

In multi-trial scene, emotiv may open and close for many times, but the device not close as expect, because the function 'close' in /Py3/cyPyWinUSB/core.py erroneously returns on the first line which may make the device reopen and caused data stream problem, please fix this.

Possibility of development in pure bluetooth

Hi,

I was wondering if it's possible to access raw data through bluetooth. That way we can also connect to headset with smartphones. Otherwise can you recommend another way to connect with smartphone.
If there's possibility I'm willing to put time on it. Just let me know the steps.

Thanks,
Ali Assar

A question about sample rate

When I chose EPOC+(Research) model or EPOC+(Standard) model, the data sample rate is supposed to be 256Hz(Mentioned in ./eeg.py Code).

But the result I got is 128Hz data with 64Hz gyro data.
So what should I do to access 256Hz data? Does Cykit support high sample rate?

Thanks!

KeyError: 'Sec-WebSocket-Key'

KeyError: Exception in line: 185, message: 'Sec-WebSocket-Key'
Traceback (most recent call last):
File "C:\Users\Rust\Desktop\CyKit-master\Py3\CyWebSocket.py", line 185, in run
secKey = header['Sec-WebSocket-Key']
I was tried to connect to the helmet.Here's the issue.

The units of voltage values imported into OPENViBE

When the signal acquired from Cyckit is used as an input to the OPENViBE, the plotted signal range seems to be the usual EEG (-100 to +100). However the documentation says that the values imported are signed integers with range (-8192 to 8192). Is there built in conversion from bits to uV in the acquisition? Do I have to manually correct the voltage range.

Thanks for the help

How to solve the problem of device drift?

I used the EPOC+ to collect the raw EEG data, when I connected to openvibe-aquisition-server and click "play", the device drift showed in the bottom is around 5000ms, and I increased the sampling rate to 256Hz and change the packge sending parameter to 032 instead of 004, the device drift is decrease to about 100ms, but it can't be lower whatever I have done, so ,is this number correct or there are some other solutions? please help me with this issue, thank you in advance!

Error when trying to connect EMOTIV Insight via Bluetooth

Hi,
I have an EMOTIV Insight headset (first model in white colour) and i would like to access the data by using CyKIT and connecting via BT (since my device doesn't include any USB dongle). However, after installing CyKIT for Windows and executing the command python cykit.py 127.0.0.1 54123 4 info+verbose+bluetooth=XXXXXXXX (with XXXXXXXX the bluetooth id for the headset), the following error was reported:

imagen

After looking at the code for file eeg.py, i found that the error was at line 150, so i modify the code from:

imagen

to:

imagen

So, after that modification, the command ran with any other error:

imagen

However, after opening file Web\CyKIT.html from Firefox, and connecting to the headset, none the EEG nor Gyro displayed data make sense.

imagen

imagen

I would appreciate any help in order to try solving this issue. Thanks.

Emotiv Epoc X data verification.

Hi, thank you for this amazing repository.

I'm aware that CyKit does not support Epoc X model, but I have both emotiv epoc + as well as epoc x headsets and I noticed both use the same usb dongle (has same print of "EPOC +" on the backside of the dongle), and I'm also aware that the data is captured via the dongle. After connecting my epoc x via the dongle I don't see the waveforms on the webpage CyKit.html but I analysed the data and the readings that have eeg data are in the range 0 to 8192.

So I'm wondering if the data gathered from the epoc x model is also correct and is just not averaged and subtracted as the documentation states, using the reference sensors? That would mean that even emotiv epoc x headsets are supported with cykit?
I need help confirming this!

Thanks in advance!

i have some issue about data recording

when i tried to save data using cykit, what i got was an empty csv file.
how can i get raw data??

i used emotiv insight equipment, and the connection was good.
image

image

why i can't see the signals in the html?

I tried to connect epoc flex, but failed.
Then I tried epoc insight, it shows that the status is connected, the controller id insight, but i can't see the signals.
I entered the following in CMD:
CyKIT.py 127.0.0.1 5151 4 info+confirm

I tried 12991, it worked. But when I tried to connect to openvibe, the signals disappeared.
I entered the following in CMD:
\CyKIT.py 127.0.0.1 5151 4 openvibe+generic+nocounter+noheader+nobattery+ovdelay:100+float+ovsamples:004

Could you help me find out what's the problem? Thank you very much!!!

local variable 'uid' referenced before assignment

The datastream works pretty great, but after roughly 30 seconds of running, I get the following error:

Exception in thread ioThread:
Traceback (most recent call last):
  File "C:\Python377\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "C:\Python377\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File ".\CyWebSocket.py", line 272, in run
    self.onData(true_data)
  File ".\CyWebSocket.py", line 300, in onData
    hashStr = hashlib.new("md5",(str(uid)+self.signKey).encode('utf-8')).hexdigest()
UnboundLocalError: local variable 'uid' referenced before assignment

I am streaming the data to Matlab using this addon: https://www.mathworks.com/matlabcentral/fileexchange/50040-jebej-matlabwebsocket.

I use a .bat with the following config to start the server:

C:\Python377\python.exe .\cyKIT.py 127.0.0.1 5151 4 verbose

About the waves

How can I obtain the waves in another program in python in real time?

AttributeError: 'module' object has no attribute 'Emotiv'

Hi,
I get this error when running the example.py file. I have installed all the require packges in python and have connected the USB dongle and it is paired. but I still receive this error. Quick reply is very much appriciated

Traceback (most recent call last):
File "example.py", line 10, in
headset = emotiv.Emotiv(False, False)
AttributeError: 'module' object has no attribute 'Emotiv'

The selected device is always 0

Hi, I have previously installed cykit and used it with OpenVibe with my windows 7 computer with python 2.7.11. However when I followed the same procedure on another computer with windows 7 and python 2.7.14, I cannot get the device selected to be 1. So when I proceed with that selection I see only the values printed as 0s for all the signal values.

I am attaching a screen capture of the error (top right) of which I cannot understand the cause. I will be much thankful if you could point the correct direction.

openvibeerror

emotiv epoc flex

Hi! Is it possible to use the Emotiv Epoc Flex?

From the code (eeg.py) I see that only these devices are supported: epoc, epoc + and insight:

` # --- Model 1 > [Epoc::Premium]
if model == 1:
k = [sn[-1],00,sn[-2],72,sn[-1],00,sn[-2],84,sn[-3],16,sn[-4],66,sn[-3],00,sn[-4],80]
self.samplingRate = 128
self.channels = 40

    # --- Model 2 > [Epoc::Consumer]
    if model == 2:   
        k = [sn[-1],00,sn[-2],84,sn[-3],16,sn[-4],66,sn[-1],00,sn[-2],72,sn[-3],00,sn[-4],80]
        self.samplingRate = 128
        self.channels = 40
        
    # --- Model 3 >  [Insight::Premium]
    if model == 3:
        k = [sn[-2],00,sn[-1],68,sn[-2],00,sn[-1],12,sn[-4],00,sn[-3],21,sn[-4],00,sn[-3],88]
        self.samplingRate = 128
        self.channels = 20
        
    # --- Model 4 > [Insight::Consumer]
    if model == 4: 
        k = [sn[-1],00,sn[-2],21,sn[-3],00,sn[-4],12,sn[-3],00,sn[-2],68,sn[-1],00,sn[-2],88]
        self.samplingRate = 128
        self.channels = 20
        
    # --- Model 5 > [Epoc+::Premium]
    if model == 5:
        k = [sn[-2],sn[-1],sn[-2],sn[-1],sn[-3],sn[-4],sn[-3],sn[-4],sn[-4],sn[-3],sn[-4],sn[-3],sn[-1],sn[-2],sn[-1],sn[-2]]
        self.samplingRate = 256
        self.channels = 40
        
    # --- Model 6 >  [Epoc+::Consumer]
    if model == 6:
        k = [sn[-1],sn[-2],sn[-2],sn[-3],sn[-3],sn[-3],sn[-2],sn[-4],sn[-1],sn[-4],sn[-2],sn[-2],sn[-4],sn[-4],sn[-2],sn[-1]]
        self.samplingRate = 256
        self.channels = 40
    
    # --- Model 7 > [EPOC+::Standard]-(14-bit mode)
    if model == 7: 
        k = [sn[-1],00,sn[-2],21,sn[-3],00,sn[-4],12,sn[-3],00,sn[-2],68,sn[-1],00,sn[-2],88]
        self.samplingRate = 128
        self.channels = 40 `

Matlab script

Hello,

We have an Emotiv insight headset and research license. It would be great if you could let me know how to stream data with Cykit to the ERPLAB or similar tools in the Matlab.

I've read in the documents, there is a script for streaming data to the Matlab but it is not in this repository.

Thank you.
Reza

Linux Error

Hello,

I am trying to run this code on a Raspberry Pi 3 model.
I keep getting this error:

Linux detected.
Traceback (most recent call last):
File "/home/pi/folder/emotiv.py", line 674, in
a.setup()
File "/home/pi/folder/emotiv.py", line 404, in setup
self.setup_posix()
File "/home/pi/folder/emotiv.py", line 508, in setup_posix
serial,hidraw_filename = get_linux_setup()
TypeError: 'NoneType' object is not iterable

Any suggestions would be appreciated!

CyKitV3 Linux

I want to use CyKitV3 to acquire data from the Headset emotive EPOC 14 channel in our Linux Ubuntu 20.04, Is CyKitV3 is available in Linux !!
or want to acquire data from the mentioned headset in Linux
any help!!

It seems that product_name needs updating

Several days ago I bought a new EPOC+. When I use CyKit to get the data, there is no device connected. It turned out to be the fact that hid returned an unseen string ‘EEG Signals’ as device.product_name. After adding this to the possible product_name, I was able to get some data. I still need to check if the data is valid.

Importing Channel Names to OpenVibe

Hi,

When the acquisition server of OpenVibe is connected to Cykit following the instructions on Readme, 14 channels labeled 1-14 are correctly extracted and shown. However, I want to know what these channels are. For example Emotive has the following channel locations.

epoc montage

How do these channel locations map to channel 1, channel2, ... channel14 in the signal stream imported to OpenVibe. I am very thankful if you could point me the direction

Thanks a lot in advance.

Streaming Emotiv data via CyKit3

Hello Warren, it's been a couple of years since I last reached out to you about a lagging issue that I was experiencing with the previous CyKitv2 (see the original thread here: [(https://github.com/CymatiCorp/CyKITv2/issues/9)] )
Well, I'm glad to say that after I upgraded to this newer CyKit version with Python 3.4 (I couldn't get it to work with Python's higher versions), that lag in the data display has reduced significantly... and I love the updated interface too! :)

Now, for the query I have in mind: it's not really an issue but I'd like to know how I could stream the live incoming EEG data from Emotiv via CyKit into a python program. I understand it's possible to stream to OpenVibe (and even Matlab?), but all I need is a simple python listener script to receive the data. I'm not an expert in python, so if you could provide me with an example snippet or point me in the right direction, that would be most appreciated!

Oh, and it would be nice if you could include a short note on how to use the Calibration feature in this updated version.

Thanks for all the great work you've done here and for keeping this CyKit project alive, kudos to ya!!

TypeError: 'bool' object has no attribute '__getitem__'

Hi

I have set up the CyKit and followed the read me. When I run the examply.py the following error message is thrown. I understand that this should be a problem with my serial number because the serial number is apparently taken in as bool (If you see the final error message) and therefore it throws a type error. Could you please enlighten me what could be the problem

Thanks

Windows detected.
Product name Receiver Dongle L01
device path \?\hid#vid_1234&pid_ed02&mi_00#8&97ab72&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
instance id HID\VID_1234&PID_ED02&MI_00\8&97AB72&0&0000

Product name Emotiv RAW DATA
device path \?\hid#vid_1234&pid_ed02&mi_01#8&2902593b&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
instance id HID\VID_1234&PID_ED02&MI_01\8&2902593B&0&0000
Devices Selected: 0
Press Enter to continue...

File "A:\Internship\emotiv EPOC\CyKit-master\Python\emotiv.py", line 262, in is_old_model
if "GM" in serial_number[-2:]:
TypeError: 'bool' object has no attribute 'getitem'

Wed Aug 30 16:04:15 2017 <Greenlet at 0x2a49c10: <bound method Emotiv.setup_crypto of <emotiv.Emotiv object at 0x02A65A70>>(False)> failed with TypeError

Device compatibility of running the CyKIT.PY

my device: WIN 10 EDU
when I run the CyKIT.py in cykit-master(py3)and the error comes out as it can not be runned in the computer and access denied.
How can I deal with it? Can you give me some advice?

Could not open socket

Hi! I face this problem where the command prompt just disappears after i open the Cyos.py file, and when i run it through IDLE, i get this message:

_Usage: Python.exe stream.py IP Port
Defaulting to localhost:5555
Listening to localhost : 5555
Could not open socket
Windows detected.
Product name Dell KM632 Wireless Keyboard and Mouse
device path \?\hid#vid_413c&pid_2501&mi_01&col01#7&31e16739&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
instance id HID\VID_413C&PID_2501&MI_01&COL01\7&31E16739&0&0000

Product name Emotiv RAW DATA
device path \?\hid#vid_1234&pid_ed02&mi_01#8&2902593b&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
instance id HID\VID_1234&PID_ED02&MI_01\8&2902593B&0&0000

Emotiv RAW DATA Found!

Use this device? [Y]es?_

I noticed that it says "Could not open socket". Can i check what is this referring to?

EPOC + Newest Version Support

Hi. I will buy Epoc +'s newest version and I just wonder, can I use CyKit for getting raw data without any licence or package from Emotiv's website?

Have a nice day.

Inquiry about accessing battery level and channel quality data from Emotiv EPOC+ headset

Hello there,

I recently came across your GitHub repository for accessing raw data from the Emotiv EPOC+ headset. I was able to successfully obtain 32 pieces of data from the device. However, I am interested in getting additional information such as the battery level and the quality of a specific channel, like O1 and O2.

I was wondering if you could provide guidance on how I can access this information using the same or similar methods used to obtain the raw data. Any help or suggestions would be greatly appreciated.

Thank you for your time and effort in developing this repository. I'm looking forward to hearing back from you.

How to obtain the data of the old version equipment EMOTIV EPOC?

Because I use the old equipment EMOTIV EPOC,according to the instruction( https://github.com/CymatiCorp/CyKit/wiki/How-to-Stream-Data-to-OpenViBE),I choose Keymodel 2,runned “CyKIT.py 127.0.0.1 54123 2 outputdata”.
keymodel

The data I got as shown in the figure below, it seems to be problematic, because the data I get when I use EMOTIV EPOC+ are around 4200, and these data seem very unstable.
What can I do to get the correct data of EMOTIV EPOC?
outputdata

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.