Hi again everybody. Since I’m preparing my next week conference about Brain Computer Interface I’ve taken time to make my Haxe bluetooth driver up again on Linux to make it work with my Mindwave Mobile Headset.
So would you have any need of using this driver you can get it there : https://bitbucket.org/fnicaise/mindwave-bluez
Setup is pretty obvious :
- get bluez development libs & headers and hcitool for your distro
- make build or make build64 will build your ndll
- then haxe linux.hxml will build a binary in bin subdir. (64bits by default, but you can change the flags)
- then modify test.sh to reflect your Bluetooth address and launch it using sh test.sh
- If you don’t get any error message and get awriting byte ok ? true it means it works :)
A few notes:
- hcitool scan will show your mindwave but if that’s not the case make sure you push the swicth on the mindwave so that it enters pairing mode (fast blue led blink)
- sudo hcitool cc YO:UR:BT:DE:VI:CE will try to setup a connection
- If it does not work start hcidump in another terminal and launch the commands again to check for error messages.
- If nothing works at all maybe your bluetooth service is not started. On OpenSuse you can launch it using sudo /usr/sbin/hciconfig hci0 up
Now to actually use this bluetooth driver with a mindwave mobile you can download the universal Mindwave connector I made last year : https://bitbucket.org/fnicaise/hxthinkgear
To try to get data from your mindwave mobile :
- haxe linux.hxml
- then switch your mindwave on
- put in pairing mode (fast blue blink)
- hcitool scan
- Clean the mindwave contactors (not joking, that’s very important)
- Put the mindwave on
- And if your mindwave has been found launch ./bin/Linux
- type choice 2
- Now stay calm and you should see success messages as well as data incoming from the headset :
MindWaveMobile : Trying to connect…
MindWaveMobile : Connection ok
MindWaveMobile : Trying to get data…
eeg:{ eSense => { meditation => 0, attention => 0 }, poorSignalLevel => 200, eegPower => { delta => 0, highGamma => 0, highBeta => 0, highAlpha => 0, lowBeta => 0, theta => 0, lowGamma => 0, lowAlpha => 0 } }
That’s it. Of course you can contact me if you wish to have more information at contact at thinkslow dot org or on twitter
Please note that the bluetooth part can be tricky but I’ve already tested it on Fedora (fuduntu), Ubuntu (11.04, 11.10, 12.04) and OpenSuse 12.3 so it should work for you too :)
I will make another blog post later with my incoming project a little game using the Mindwave Mobile which I will showcase next Wednesday. I will then release the sources so you can try to play with Haxe + NME + your mindwave mobile on linux and have fun (note for windows and mac users, the hxThingear will also work for you since it uses the default Thinkgear Connector from neurosky )
[EDIT 13-05-2013] : Don’t know if I made myself clear, but hcitool scan is just there to check if your mindwave is nearby. You do not need to use it before you actually launch your application. But if you cannot connect to your mindwave use hcitool scan to check.


