Unable to get data from mindwave
I am running this program :
from NeuroPy import NeuroPy from time import sleep
> abc = NeuroPy("COM13",9600)
>
> def attention_callback(attention_value):
> """this function will be called everytime NeuroPy has a new value for attention"""
> print ("Value of attention is: ", attention_value)
> return None
>
> abc.setCallBack("attention", attention_callback)
> abc.start()
>
> try:
> while True:
> sleep(0.2)
> finally:
> abc.stop()
I am getting the following output:
attention: 0%| | 0/100 [00:00<?, ?it/s] meditation: 0%| | 0/100 [00:00<?, ?it/s]Exception in thread Thread-8: Traceback (most recent call last): File "C:\anaconda\lib\threading.py", line 916, in _bootstrap_inner self.run() File "C:\anaconda\lib\threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "C:\Users\sweetie\NeuroPy\NeuroPy.py", line 146, in __packetParser p1 = self.__srl.read(1).encode("hex") # read first 2 packets AttributeError: 'bytes' object has no attribute 'encode'
Please help
Which version of Python are you using?
-
Hello, I'm exactly same issues. I'm using following version in Anaconda Prompt
-
Python 3.6.0
-
- |Anaconda custom (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
-
I'm using Brainsense EEG headset which is also using the same TGAM1 which is same to NeuroSky circuit
What was the problem. I completed my project and also forgotten.
On Tue, Aug 20, 2019, 5:09 PM SaiDharshan [email protected] wrote:
Hello, I'm exactly same issues. I'm using following version in Anaconda Prompt Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lihas/NeuroPy/issues/17?email_source=notifications&email_token=AL4ZCUPRZ3BUZMLFCB75KG3QFPJXRA5CNFSM4HMIT44KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4V7MJQ#issuecomment-522974758, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4ZCUMDZOV3XEI7LUOBC3LQFPJXRANCNFSM4HMIT44A .
Hello, @saishan27!
Can you test this library in Python 2.7? As far as I know, this library does not work with Python 3.x.

Hello, @PetreBoboc will try and let you know the result
What was the problem. I completed my project and also forgotten. …
Hello @Sweetzaline
- Im unable to get any valid values. All i get for all the function is 0 . and sometimes i get following error similar to yours "File "C:\Users\sweetie\NeuroPy\NeuroPy.py", line 146, in __packetParser p1 = self.__srl.read(1).encode("hex") # read first 2 packets AttributeError: 'bytes' object has no attribute 'encode'"
Yes, YOU CANT GET IT IN PYTHON 3. THAT WAS WHAT I WAS FIGHTING WITH FOR A LONG TIME.
On Tue, Aug 20, 2019, 5:13 PM Petre Boboc [email protected] wrote:
Hello, @saishan27 https://github.com/saishan27!
Can you test this library in Python 2.7? As far as I know, this library does not work with Python 3.x.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lihas/NeuroPy/issues/17?email_source=notifications&email_token=AL4ZCUNJCCM2JQOO6C4K6YTQFPKGDA5CNFSM4HMIT44KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4V7WGA#issuecomment-522976024, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4ZCUNQBWXH5MUT4TQWGZDQFPKGDANCNFSM4HMIT44A .
@Sweetzaline ... Awesome Sauce!. ill try with python 2.7 then... thanks alot
Earlier I was using Python 3. Then I discontinued and used Python 2 that solved my problem.
On Thu, May 30, 2019, 2:44 AM Petre Boboc [email protected] wrote:
Which version of Python are you using?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lihas/NeuroPy/issues/17?email_source=notifications&email_token=AL4ZCUL6MMZLPYC3KDMDURTPX3W37A5CNFSM4HMIT44KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWQVFHY#issuecomment-497111711, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4ZCUNE7SV2PPO5AFKQGJ3PX3W37ANCNFSM4HMIT44A .
Use Python 2.7. If you are doing in Python 3, Make an environment where you can use both Python 2 and Python 3. Yes this is possible and very feasible. I did that.
On Tue, Aug 20, 2019, 5:09 PM SaiDharshan [email protected] wrote:
Hello, I'm exactly same issues. I'm using following version in Anaconda Prompt Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lihas/NeuroPy/issues/17?email_source=notifications&email_token=AL4ZCUPRZ3BUZMLFCB75KG3QFPJXRA5CNFSM4HMIT44KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4V7MJQ#issuecomment-522974758, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4ZCUMDZOV3XEI7LUOBC3LQFPJXRANCNFSM4HMIT44A .
Use Python 2.7. If you are doing in Python 3, Make an environment where you can use both Python 2 and Python 3. Yes this is possible and very feasible. I did that. In Anaconda!
On Tue, Aug 20, 2019, 5:19 PM SaiDharshan [email protected] wrote:
@Sweetzaline https://github.com/Sweetzaline ... Awesome Sauce!. ill try with python 2.7 then... thanks alot
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lihas/NeuroPy/issues/17?email_source=notifications&email_token=AL4ZCUKTYSNIXTP36AR6VQLQFPK5DA5CNFSM4HMIT44KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4WAGTA#issuecomment-522978124, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4ZCULBU7CKAI37DRQVZRLQFPK5DANCNFSM4HMIT44A .
I created a new Environment in Anaconda for this project.
It works fine now i guess

Thanks Alott
Yoohoo! You are done with this problem. Goodluck!!
On Tue, Aug 20, 2019, 5:42 PM SaiDharshan [email protected] wrote:
I created a new Environment in Anaconda for this project. It works fine now i guess [image: image] https://user-images.githubusercontent.com/22054711/63346028-c0825b00-c371-11e9-9417-651418f358d1.png Thanks Alott
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lihas/NeuroPy/issues/17?email_source=notifications&email_token=AL4ZCUMYPVX5QGYPYRAKVS3QFPNR3A5CNFSM4HMIT44KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4WCBCI#issuecomment-522985609, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4ZCUNKLDC2KN46GBKYQGDQFPNR3ANCNFSM4HMIT44A .
You welcome!
On Tue, Aug 20, 2019, 5:42 PM SaiDharshan [email protected] wrote:
I created a new Environment in Anaconda for this project. It works fine now i guess [image: image] https://user-images.githubusercontent.com/22054711/63346028-c0825b00-c371-11e9-9417-651418f358d1.png Thanks Alott
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lihas/NeuroPy/issues/17?email_source=notifications&email_token=AL4ZCUMYPVX5QGYPYRAKVS3QFPNR3A5CNFSM4HMIT44KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4WCBCI#issuecomment-522985609, or mute the thread https://github.com/notifications/unsubscribe-auth/AL4ZCUNKLDC2KN46GBKYQGDQFPNR3ANCNFSM4HMIT44A .