Bluetooth Beta Driver question

A long winded question but I wanted to explain some background.
I have a Samsung tablet that never has a problem connection to a bluetooth device. That said, I cannot connect to my fez.Spider. It seens that it Pairs (red and blue Led’s blinking) Samsung shows that the Fez.Spider is available and all ‘seems well’. But I never receive a ‘connect’ from the spider application.

My device is a Bluetooth 1.1 Gadgeteer Module

I am using the code from CodePlex
by: Eduardo Velloso, BETA drivers for the .NET Gadgeteer Bluetooth module.
Last edited Apr 2 at 9:13 AM by eduardovelloso, version 2

I’ll start by saying I am NOT blaming the code. I DO have a question about the code and I though someone in here may be using it successfully with a Android bluetooth device.
Status codes
0 - Initializing
1 - Ready
2 - Inquiring
3 - Connecting
4 - Connected < Never received

My PC shows the following

From PC Device Manager and Bluetooth taskbar Icon

Bluetooth device shows up as FezSpider
Right click FezSpider Icon and select Properties

In Dialog FezSpider Properties, Select Bluetooth Tab

For my Bluetooth Module it shows

MAC address: shows Unavailable
Unique identifier: 00:18:a1:12:0d:1b << I think BD_ADDR is unique address of a Bluetooth device

I have not tried using the Unique identifier: 00:18:a1:12:0d:1b YET.
I wanted to see any answer received here first.



Bluetooth.cs
	/// <summary>
	/// Connects the module to a device.
	/// </summary>
	/// <param name="macAddress">The MAC address which to pair to.</param>
	public void ConnectAsync(string macAddress)
	{
	    if (Utilities.IsNullOrEmpty(macAddress))
	    {
	         throw new ArgumentNullException("macAddress");
	    }

	   if (this.Mode != BluetoothMode.Client)
	   {
	           throw new NotSupportedException("This method may only be called while in the client mode.");
	   }

	         this.SendCommand("+CONN=" + macAddress, false);
                }

AND in Program.cs

        private void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            ////this.bt.IsPairingEnabled = !this.bt.IsPairingEnabled;
            this.bt.ConnectAsync("9C,B7,0D,A9,D0,EE");
        }


The Seeed document shows something like this:
//macAddress \r\n+CONN=aa,bb,cc,dd,ee,ff\r\n
//Connect to a device with address of "aa,bb,cc,dd,ee,ff

I am not ‘seeing’ the relation of "9C,B7,0D,A9,D0,EE"
to a device Mac Address OR my Unique identifier: 00:18:a1:12:0d:1b

I cannot find any documentation on the Beta bluetooth driver

I guess that the MAC Address and the unique identifier are considered the same thing…

Have a great day!

I have successfully paired my Hydra with my wife’s Samsung Galaxy Tab 10.1 and used a serial program to communicate to it.

Red/blue toggle on LEDs is what happens when you enter pairing mode, not when you have paired. Once pairing has finished, you get a blue-flash only.

You can ignore some of this to get started. I posted a sample app that will let you sort this out. http://www.tinyclr.com/codeshare/entry/446

One thing, when you have not paired, you can’t then use code to force connection. Both devices need to have associated to allow that.

My suggestion to get working is use my code and pair (the joystick press method is the most reliable way to do that - you need to wait for the module to initialise and stabilise before trying to enter pairing mode). Then pair with it on your tablet - I can’t remember the steps on the tablet but you enable BT if needed, then open Settings, Wireless and BT, BT settings, then Scan For Devices, and select the Fez and put in the PIN code.

Hope that helps

oh and also note, I extended the Bluetooth.cs driver code to handle switching serial port speeds up. My updated version is in the project.

Brett

Thank You

I’ll give your code a try. Like your wife, I have the Galaxy Tab 2 10.1.

Update…

My Samsung tells be that it is Paired to my Spider and the Bluetooth blue led is double blinking approx 1 second apart.
So it is Paired. <<< Wrong! The Seeed data states “While disconnected only blue led blinks 2times/s.”

In the Bluetooth code it has a button to connect ie. this.bt.ConnectAsync(“9C,B7,0D,A9,D0,EE”); That is why I asked about the (“9C,B7,0D,A9,D0,EE”). When pressing the button the code always returns NOT CONNECTED!!! :frowning:

I tried my bluetooth unique identifier in the code: this.bt.ConnectAsync(“00,18,A1,12,0D,1B”); and this makes no difference!

Note: I modified the beta driver code so I could return string messages to send to the Fez.Spider T35 display.
Note2: I am using Net Micro 4.2 because the sample code for the Beta Bluetooth uses/requires it.
The beta driver will not work in 4.1 without code modification.

oh she only has the V1 device. Not that I know what the differences with the 2 were :slight_smile:

Info on my question posted here.

Bending over so everyone can have a kick…

It was so obvious that I could not see it!

Using the Bluetooth address of my Samsung Tab 2 solved it. The trouble is that I did not know where to find it.
It was in Settings, About device, Status. For some reason I never looked inside Status for the Bluetooth address of my device.

Brett steered me in the right direction

Yes, two-flash unpaired, one-flash paired. Great to see you made progress.