Hello,
I’m brand new to TD and I’ve been trying to read in EEG headset data from a NeuroSky Mindwave.
Here’s what I’ve hacked together using the Binary Socket Packet Format.The headset automatically starts transmitting at 1 Hz, which is fine for now (I don’t need the raw EEG data, only the highly processed eSense attention/relaxation values). See here for the format: cs.mcgill.ca/~bdever1/306/binary … otocol.pdf
I did this:
- Set up a TCP IN DAT on port 13854 set to one row per message. This gives one message per second. So far so good, data comes streaming in.
- Now, I would like to parse each message. In particular, I would like bytes 0x04 and 0x05, corresponding to the eSense attention/mediation values. I tried using string operations with an Evaluate DAT, eg. ctof(substr($V,6,1)) to try and parse out something useful. Hopefully I could also get the big-endian floats for low alpha, high alpha, low beta, and high beta (at index 18-21,22-25,26-29,30-33). However, parsing this out properly has stumped me.
Eventually I would like to communicate with the server to do things like change the sample rate. It looks like I would need a JSON parser to do things properly (see developer.neurosky.com/docs/lib/ … otocol.pdf ).
Any ideas on how to parse the binary so I could get some integers and floats for the right attention/relaxation/alpha/beta bytes? My newness to tscript has been holding me back here.
jd
EEG test 1.1.toe (13.5 KB)