Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using multiple threads #7

Open
tanasi opened this issue May 2, 2014 · 0 comments
Open

Error when using multiple threads #7

tanasi opened this issue May 2, 2014 · 0 comments

Comments

@tanasi
Copy link

tanasi commented May 2, 2014

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant