1
\$\begingroup\$

I recently bought a Star Wars Force Trainer II with the intention of using it to read the attention and meditation values.

I looked at the Arduino Brain library but that didn't work.

I started reading the serial data at a 9600 baud rate and got this data (https://pastebin.com/2SH1yarQ). Can anyone help me figure out how to use this data to find the attention and meditation values or how to get the Arduino Brain library to start working?

\$\endgroup\$
1
  • \$\begingroup\$ This sounds like the type of situation where you need to find a group of people who have been hacking on those devices, or contact the author of the library you are trying to use. Debugging questions here must be fully supported by detail, which is going to be hard to do when you don't really know how the apparently undocumented(?) product you are trying to work with is supposed to work. \$\endgroup\$ – Chris Stratton May 15 '20 at 23:13
1
\$\begingroup\$

http://developer.neurosky.com/docs/lib/exe/fetch.php?media=mindset_communications_protocol.pdf

This is fully documented, the 2 0xAA bytes (170) are the sync bytes at the start of a message, the next byte is the payload length, and finally you have the CRC.

The linked pdf even has example code for parsing the data,

\$\endgroup\$
8
  • \$\begingroup\$ I did this but the value after the payload length should be the attention which is 1-100 but the value I am getting seems to be 1-256. \$\endgroup\$ – Nikhil Nayak May 16 '20 at 0:03
  • \$\begingroup\$ While I am not familiar with these devices, is it possible its 0-100% stored as 0-255, e.g. roughly 0.4% per value? \$\endgroup\$ – Reroute May 16 '20 at 0:05
  • \$\begingroup\$ That's possible. I'll try that out and see what happens. \$\endgroup\$ – Nikhil Nayak May 16 '20 at 0:08
  • \$\begingroup\$ Also, should i be listening at a 56700 baud rate? \$\endgroup\$ – Nikhil Nayak May 16 '20 at 1:29
  • \$\begingroup\$ seems over bluetooth is that baud rate, your decodes looked valid, so I suspect you have either got the baud rate correct, or what your using is "auto-bauding" the correct rate and just delivering it to you like that. \$\endgroup\$ – Reroute May 16 '20 at 1:32
1
\$\begingroup\$

21:39:50.754 -> 170 [Sync] 21:39:50.754 -> 170 [Sync] 21:39:50.754 -> 4 [Payload Length] 21:39:50.754 -> 128 [Code] 21:39:50.754 -> 2 [Length (how many bytes)] 21:39:50.754 -> 0 [Low Order Byte] 21:39:50.754 -> 26 [High Order Byte] 21:39:50.754 -> 99 [Checksum]

Your High Order Byte and Low Order Byte are your "true" data in a Raw wave value form. Check "Multi-Bytes" CODE here: http://developer.neurosky.com/docs/doku.php?id=thinkgear_communications_protocol#code_definitions_table

\$\endgroup\$
1
  • \$\begingroup\$ I like the link, it is a good explanation along with usable examples. \$\endgroup\$ – Gil May 27 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.