Last september, Graeme Moffat sent me the last version of their Muse EEG headset for evaluation. Unfortunately, their SDK is only compatible with the 2014 headset and I was unable to record any data from the device I received.

The situation didn’t seems to move and at the time of the writing, the research SDK isn’t compatible with the 2016 headset. So I decided to take action and give a shot at reverse-engineering the Bluetooth protocol in order to get raw data directly at the source.

BLE protocols are quite easy to decode. The device expose a list of services you can subscribes to, and with the right set of command it will start streaming data. The first step is to snoop BLE packets during the communication between the Android App and the Headset. This will give you the list of command the device receive just before streaming. By injecting the exact same sequence of packets, you can make the headset send you back packets containing EEG data. The next part (or the fun part) is then to figure out how data are encoded in the binary packet you just received. This took me a couple of hours (the headset datasheet was very helpful), and I found that the Muse headband stream data in packet (for each electrodes independently) containing a 16-bit timestamp followed by 12 12-bits data sample.

I wrote a simple python library that encapsulate the protocol, so you can just download the code and start playing muse raw data.

For now, it only retrieve EEG data, but the same workflow apply for Accelerometer data.

Enjoy !