Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, it took a bit of playing around to get the MindSet connected reliably.</p> <p>The command-line bluetooth tools are more or less useless. The only repeatable way to read off the Mindset (once paired via BlueMan) was to do this:</p> <pre><code> bash$ sudo /etc/init.d/bluetooth stop bash$ sudo /etc/init.d/bluetooth start bash$ sudo rfcomm connect /dev/rfcomm0 00:13:##:##:##:## 1 bash$ ./mindset_capture.rb </code></pre> <p>...but this reaches EOF before a valid ThinkGear packet has been received.</p> <p>Instead, pair using Blueman.</p> <p>Setup:</p> <ol> <li>bash$ blueman-manager &amp;</li> <li>enable pairing on MindSet</li> <li>Click Search in BlueMan</li> <li>Select MindSet device</li> <li>Click on Pair</li> <li>Enter PIN (0000)</li> </ol> <p>Connect:</p> <ol> <li>bash$ blueman-manager &amp;</li> <li>Right-click on MindSet and select "Connect To: Dev B" (serial connector icon)</li> <li>Run capture utility (e.g. bash$ ./mindset_capture.rb)</li> <li>Right-click on MindSet and select "Disconnect: Dev B"</li> <li>Quit Blueman</li> <li><p>Restart bluetooth to release rfcomm0 (thanks, BlueMan!) </p> <p>bash$ sudo /etc/init.d/bluetooth stop; sudo /etc/init.d/bluetooth start</p></li> </ol> <p>Wouldn't it be better to have a completely command-line driven solution? Yes, yes it would. Unfortunately, the Bluetooth stack on Linux seems to be in a state where the GUI tools and the command line tools do not cooperate -- and the command-line tools do not support pairing (* UPDATE - see comments).</p> <p>Reading from the device is straightforward. It continuously transmits bytes, so read from it until you encounter two SYNC bytes (0xAA), which mark the beginning of a packet. The structure of the packet is described in <strong>mindset_communications_protocol.pdf</strong>, which is supplied in the MDT.</p> <p>Ruby code for reading from the MindSet:</p> <pre><code> require 'rubygems' # gem install serialport require 'serialport' conn = SerialPort.new "/dev/rfcomm0", 57600 while true next if conn.readbyte != 0xAA next if conn.readbyte != 0xAA while true c = conn.readbyte break if c == 0xAA puts "%02X" % c end end </code></pre> <p>It's not perfect as it does no real parsing, but that's how bytes are read from the device.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload