Fez Cerberus - Comm between PC and Bluetooth module

Great! Keep us posted about your project!

Hello All,

I am verifying that the board can send data back to the PC. My test code is the example created by Brett (http://www.tinyclr.com/codeshare/entry/446)

In his example (and screen shot) Brett demonstrates that he is able to received communication from his Mainboard (MB) in the MSVS environment and view it in the output window in debug mode (http://www.tinyclr.com/uploads/code/img/446_bluetooth_usage_large.png)

I have been attempting to verify the same but my system seems to stay in +BTSTATE:2 which from the Bluetooth.cs file is the Inquiring State?

Does anyone have any suggestions as to what may be causing this? The module is visible from both PC and cellphone and I can connect to it.

Bluetooth trace messages before Joystick Press:
The thread ‘’ (0x2) has exited with code 0 (0x0).
Using mainboard GHI Electronics FEZCerberus version 1.1
Program Started
Reader Thread

WORK:SLAVER

+BTSTATE:0

+BTSTATE:1

+BTSTATE:3

Client Mode
Enter Pairing Mode

+S
Recieved:
+S

OK

Recieved:
OK

OK

Recieved:
OK

OK

Recieved:
OK

WORK:SLAVER

Recieved:
WORK:SLAVER

+BTSTATE:0

New state:0
Recieved:
+BTSTATE:0

+BTSTATE:1

New state:1
Recieved:
+BTSTATE:1

+BTSTATE:3

New state:3
Recieved:
+BTSTATE:3

CONNECT:FAIL

Recieved:
CONNECT:FAIL

+BTSTATE:1

New state:1
Recieved:
+BTSTATE:1

The thread ‘’ (0x3) has exited with code 0 (0x0).

Bluetooth trace messages after the joystick is pressed:

Enter Pairing Mode

Recieved:

+INQ=1

Recieved:
+INQ=1

OK

Recieved:
OK

+BTSTATE:2

New state:2
Recieved:
+BTSTATE:2

great to hear you got it working (in the 24 hours I was away from the forum too!)

So the LED status is the key. What is the blink pattern you’re seeing? Blue/Red means you are in pairing mode, blue double flash (flash flash pause) is unconnected mode, and single blue flash is paired and connected.

What I know works for me is to wait until I see no debug status messages coming from the device for at least a second, and then go into pairing mode by the joystick press. You only need to do this once, assuming your PC retains the connection…

When you can see the pairing mode, you should then go to the Windows box to the Bluetooth control panel, and say “Add a device” (this is from my Win7 box with inbuilt bluetooth; YMMV). When you do that, you should then be able to see the device in the “select a device” window. Then select it, and put in your PIN.

Hi Brett

First of all, thank you for the basic Bluetooth tutorial that you have posted. That post along with the forum support really saved me.

Apologies for the delay in getting back onto the forum, two things to blame

  1. Coffee good – crash after bad
  2. Presentation slides needed to be done

I realised from your suggestions that I needed to understand better how the BT module worked so I attempted to get further resources which I found at: http://www.seeedstudio.com/wiki/index.php?title=Serial_port_bluetooth_module_(Master/Slave)

This is the sequence of events on my system:

  1. I apply power to the Cerberus board
  2. I commence debugging in MSVS
  3. The BT module is in unconnected mode (blink blink pause – blue led only). And the MSVS output debug window shows the following debug status messages:
    The thread ‘’ (0x2) has exited with code 0 (0x0).
    Using mainboard GHI Electronics FEZCerberus version 1.1
    Program Started
    Reader Thread

WORK:SLAVER
+BTSTATE:0
+BTSTATE:1
+BTSTATE:3
Client Mode
+S
Recieved:
+S
OK
Recieved:
OK
OK
Recieved:
OK
OK
Recieved:
OK
WORK:SLAVER
Recieved:
WORK:SLAVER
+BTSTATE:0
New state:0
Recieved:
+BTSTATE:0
+BTSTATE:1
New state:1
Recieved:
+BTSTATE:1
+BTSTATE:3
New state:3
Recieved:
+BTSTATE:3
CONNECT:FAIL
Recieved:
CONNECT:FAIL
+BTSTATE:1
New state:1
Recieved:
+BTSTATE:1
The thread ‘’ (0x3) has exited with code 0 (0x0).

  1. At this point I press the joystick. The BT module enters pairing mode (alternating Blue/Red flashes).
    The MSVS output debug window shows the following debug status messages:
    Enter Pairing Mode
    Recieved:
    +INQ=1
    Recieved:
    +INQ=1
    OK
    Recieved:
    OK
    +BTSTATE:2
    New state:2
    Recieved:
    +BTSTATE:2

  2. At this point I go to the BT devices Windows Box (I am using a USB dongle) and select add device.
    The BT Wizard searches for and locates the BT module (currently called FezCerberus).
    The passkey is specified (currently 9999)
    Windows indicates that the drivers were successfully installed, COM5-outgoing, COM6-incoming.
    The MSVS output debug window is unchanged.
    The led lighting pattern is unchanged.

Am I skipping any steps or incorrectly using the BT Windows application?
naveej

Nope, that’s perfect.

You have successfully paired to your PC and have a com port you could open with TeraTerm if you wanted to and then you could send and recieve characters. That means you can probably start your Windows application now and it’ll all “just work” !

I would however try out Tera Term (open COM5) and then see how typing characters there then gets printed in the debug output window.

Coffee good - great to hear. Did I tell you that my BT module sends temperatures back to my PC when I am roasting coffee beans in the BBQ? :slight_smile:

Stupid question from a VC# newbie: how does one get the drivers and where does one put them so the “using Gadgeteer.Modules.Velloso” works? WHen I try to add that statement to my code, it is unable to resolve the .Velloso piece.

Its published on the internet somewhere, if you look at my codeshare entry it’ll have the pointers you need.

@ Brett - What is a codeshare entry and where do I go find that?

Codeshare is in the top menu and it’s the place where we can share code amongst others in the community.

click on my name, and you go to my profile. There’s a link to “my codeshare entries” or similar that will get you there.