Update on my Bluetooth EV3 Mailbox testing.

I managed to focus some more time on tidying up my AI2 app for sending Mailbox messages via Bluetooth from my Android phone to an EV3. The EV3 code is really simple and looks like this:

Screen Shot 2016-08-24 at 21.23.05

The AI2 code provides two BT related buttons, Connect & Disconnect, a text box and a Go button to send the text:

Screenshot_20160825-211129

When the text is entered and Go pressed it is sent as a Mailbox message with the name “beep” to the EV3, and displayed on its screen. The code to send it has to construct a message in the form:

MLenL, MLenH, 0x01, 0x00, 0x81, 0x9E, NLen, NameBytes, 0x00, TLenL, TLenH, TextBytes, 0x00

Which breakdown as:

  • MLenL, MLenH = 16 bit little endian length of the rest of the message
  • 0x0001 = Message counter
  • 0x81 = System command, no reply
  • 0x9E = Mailbox message
  • NLen = 8 bit name length, including 0x00 termination
  • NameBytes + 0x00 = The Mailbox name
  • TLenL, TLenH = 16 bit little endian length of the text
  • TextBytes + 0x00 = The Mailbox text

This in terms of code looks like:

blocks (1)

If you would like to play with the code it’s available from my resources site at:

The code is released under the Creative Commons Attribution-ShareAlike 4.0 International License

One thought on “Update on my Bluetooth EV3 Mailbox testing.”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.