Coder Social home page Coder Social logo

mindwave-python's People

Contributors

alanchrt 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

Watchers

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

mindwave-python's Issues

Error when using multiple threads

Hi,
first of all thanks for this valuable work.
I am trying to use the mindwave functionality into another python script which uses threading. I can see that threading is used inside mindwave.py in order to get data from dongle. What I am trying to accomplish is to have a master python script which runs 2 or 3 threads. One of them will be mindwave.py.
So, for example I have the following code:

!/usr/bin/env python

from future import print_function
import threading
import time
import mindwave

class MyThread(threading.Thread):
def run(self):
print("{} started!".format(self.getName()))
time.sleep(1)
print("{} finished!".format(self.getName()))

if name == 'main':
mythread = MyThread()
mythread.start()
h1 = mindwave.Headset('/dev/rfcomm0')
h1.connect()
time.sleep(.9)

and I get the following error:
Thread-1 started!
Thread-1 finished!
Exception in thread Thread-2 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
File "/usr/lib/python2.7/dist-packages/mindwave.py", line 74, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'

Do you have any ideas?

?Device is busy

Are there any problem with connecting two mindwave mobile at the same time via bluetooth?

It is giving me this error

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/serial/serialposix.py", line 278, in open
raise SerialException("could not open port %s: %s" % (self._port, msg))
SerialException: could not open port /dev/tty.MindWaveMobile-DevA: [Errno 16] Resource busy: '/dev/tty.MindWaveMobile-DevA'

Is there any solution?

I appreciate your response.

MindSet support?

Hi - I just bought a MindSet with the intention of developing against it in Linux. I was under the (I now think mistaken) impression that the MindWave wouldn't allow capturing real-time raw data, but the MindSet would. Does this library support the MindSet as well? Should I just buy a MindWave instead?

OS X requires driver

On Linux, you can use the MindWave just like that but on OS X 10.10, even though /dev/ttys001 appears, it cannot be used. headset.status will be None and usually there will be the error

serial.serialutil.SerialException: Attempting to use a port that is not open

To fix this and to make /dev/tty.MindWave appear, you need to install the Mac OS X NeuroSky MindWave driver from http://support.neurosky.com/kb/mindwave/cant-get-the-connection-with-mindwave-in-mac-os-x-1010

You could add the info to your readme, even though having it here will be helpful already I hope.

Error with Mindwave headset and RF dongle

I have the Mindset headset with the RF dongle.
I've tested with various scripts including the code snipped from your example.

The headset connects but just after that it receives the following error:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
    self.run()
  File "F:\code\EEG_Python_learning\mindwave.py", line 73, in run
    self.parse_payload(payload)
  File "F:\code\EEG_Python_learning\mindwave.py", line 143, in parse_payload
    raw=ord(value[0])*256+ord(value[1])
IndexError: string index out of range

I can't seem to figure out what the correct value should be and why I'm getting this error.

This happens all the time

Cannot Connect to MindWave Mobile (Mac OS 13.0 Python 3.11.1)

Hi, I'm having some difficulty connecting to my MindWave Mobile- just blew the dust off of it, and am hoping it's not so far in the past it's unuseable.

Running:

import mindwave
headset = mindwave.Headset("/dev/tty.MindWaveMobile", '3A8B')

Yields:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/pizzmancer/miniconda3/envs/mindwaveproject/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
>>>     self.run()
  File "/Users/pizzmancer/_Code/python-mindwave/mindwave.py", line 122, in run
    s.write(DISCONNECT)
  File "/Users/pizzmancer/miniconda3/envs/mindwaveproject/lib/python3.11/site-packages/serial/serialposix.py", line 616, in write
    d = to_bytes(data)
        ^^^^^^^^^^^^^^
  File "/Users/pizzmancer/miniconda3/envs/mindwaveproject/lib/python3.11/site-packages/serial/serialutil.py", line 65, in to_bytes
    raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))
TypeError: unicode strings are not supported, please encode to bytes: 'ร'

I understand there is a difference between having
pip install serial
and
pip install pyserial
but neither library seems resolve this issue. Any help would be much appreciated!

(The NeuroSky drivers have been installed on my Mac, if that's a concern)

About Blink

Hello
I don't know if I have a problem but I can't get the blink value

Blink value is always zero

Meditation and attention work perfectly, but I can't get blink detection to work. It is always at zero.

Exception in thread Thread-1

Hi after few seconds running fine, the script throws this error and it will stop reading from the mindwave. Any solution?

Thanks

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/home/pi/python/Mindwave/mindwave.py", line 73, in run
    self.parse_payload(payload)
  File "/home/pi/python/Mindwave/mindwave.py", line 143, in parse_payload
    raw=ord(value[0])*256+ord(value[1])
IndexError: string index out of range

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.