0

I am trying to connect a Mindwave (NOT Mindwave Mobile) headset to my raspberry pi4 in order to complete my MSc project.

I am struggling to get it to consistently report the attention setting and have recently found out that - despite all documentation - the blink function is not present either.

My supervisor has suggested some code using the NeuroPy library instead but he only has the mindwave mobile headset available (due to covid lockdown) and I was wondering if anyone in this fine community had succeeded in modifying the connection code to work.

The line in question (I assume) is:

neuropy = NeuroPy(port="/dev/rfcomm1") 

I don't even know if its possible to be fair but am hoping as this is I think my last chance to get the system working. Any help or suggestions for getting a blink reading would be gratefully accepted too.

Andy
  • 3
  • 2

1 Answers1

0

Use this for Python 3+

https://github.com/dweidai/NeuroPy-Python3.0

and then call it like this:

from NeuroPy import NeuroPy
object1=NeuroPy.NeuroPy("COM9",9600) #If port not given 57600 is automatically assumed
                        #object1=NeuroPy("/dev/rfcomm0") for linux
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)
    #do other stuff (fire a rocket), based on the obtained value of attention_value
    #do some more stuff
    return None


#set call back:
object1.setCallBack("attention",attention_callback)

#call start method
object1.start()

In python 3 you may want to use NeuroPy.NeuroPy("COM9") <- Use your port ofc
To get the blink variable you will need to call the socket on the Neurosky connector, because it is broken in the NeuroPy library. To do that connect to the socket with any good lib and get the variable. (duh)

padaleiana
  • 955
  • 1
  • 14
  • 23