Set up connections between two BluetoothBee step by step

Thank you so much Chris!

Your particular description should help many others who may encounter the same question. In fact,when the module as a slave, it should also be connected by the computer. However, it may fail sometimes, so you need to try many times. If it can’t work at last, set the module as a master is also a feasible way.

Regards,

-Icing

Hy,

i have a bluetooth master/slave device.

The device is configured as master, but i have a problem!

I have a laptop pc and a bluetooth master/slave configured as master.

If i try to discover devices using the bluetooth device i find my pc and can connect to the pc, but i want also to do the oposite, but my laptop pc doesn’t find the bluetooth module!
How can i put the master device in discoverable mode?

Thanks

Try to make the buletooth module as a slave by using command \r\n+STWMOD=0\r\n;
Then make the module be inquiredable \r\n+INQ=0\r\n,

At this point, your pc should find the buletooth device!

May this helpful to you, and feel free to ask any quesiton!

Regards,

-Icing

I need to set the module as master!

I have another problem! How can the master connect with 2 or more slaves ??
If i connect to one slave if i try the +conn, the command is interpreted as a string to send to the first slave!!

The module could not be searched when in master mode. So you must set it to slave.

The master moulde can only connect to one slave at a time.

Try to use command \r\n+STAUTO=0\r\n to forbidden auto-connect the last paired device before the slave device is powering.
So that the buletooth module will be in command mode when powered.

Regards,

-Icing

Hello everyone I have a problem I should set it to master links sonop I state that all correct because when I insert the Windows 7 at command responds ok but when I send the command +STWMOD=1 says nothing please help me thanks :wink:

I have the same problem :
I connected this module trought my uart pcb to my pc . and i have configurated
When i send ‘at’ the module respond ‘ok’ but it dosn’t respond to any other commands .
Please i need help too .

I have tried everything mentioned here to make BTBee work with Bees Shield and still it is not working !

Hi,

How did you do that? General progress will be helpful me to analyze the problem.

Regards,

-Icing

Hello Icing,

I have successfully connected from my PC and windows phone and terminal on the android phone. However, I am not able to connect using the amarino app on android.

So I do not think that the bluetooth bee is the problem.
I guess i will contact the amarino developer… any suggestions?

Thanks !

Hi,

I configure the master/slave as slave, if i power up the device it starts as a slave, i put the slave device discoverable using INQ comand, but when i power off the device and power up again the slave is no more in discoverable mode! how can i maintain the discoverable mode after power down?

Thanks for any help

Hello! im stacked in this step! i cant keep going with my project if i cant conect this…
How i can configure a bluetooth bee without a UartSB?? i got a arduino Uno, and a Seeeduino xbee shield.
thanks for ur help !

hi everyone, firs, my english isn’t realy good, and i started playing with electronics recently.
I bought the Bluetoth in seeedstudio, and i’m trying to get it working: i’m using as arduino uno, i bought also a xbee shiled (only the pcb and de pins), finally, i’m using the following code:[code]#include <NewSoftSerial.h> //Software Serial Port

#define RxD 11
#define TxD 12

#define DEBUG_ENABLED 1

NewSoftSerial blueToothSerial(RxD,TxD);

void setup()
{
pinMode(RxD, INPUT);
pinMode(TxD, OUTPUT);
setupBlueToothConnection();

}

void loop()
{

if(blueToothSerial.read() == ‘a’)

{
blueToothSerial.println(“You are connected to Bluetooth Bee”);
//You can write you BT communication logic here
}

}

void setupBlueToothConnection()
{
blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
delay(1000);
sendBlueToothCommand("\r\n+STWMOD=0\r\n");
sendBlueToothCommand("\r\n+STNA=SeeeduinoBluetooth\r\n");
sendBlueToothCommand("\r\n+STAUTO=0\r\n");
sendBlueToothCommand("\r\n+STOAUT=1\r\n");
sendBlueToothCommand("\r\n +STPIN=0000\r\n");
delay(2000); // This delay is required.
sendBlueToothCommand("\r\n+INQ=1\r\n");
delay(2000); // This delay is required.

}

//Checks if the response “OK” is received.
void CheckOK()
{
char a,b;
while(1)
{
if(int len = blueToothSerial.available())
{
a = blueToothSerial.read();

if('O' == a)
{
  b = blueToothSerial.read();
  if('K' == b)
  {
    break;
  }

}

}
}

while( (a = blueToothSerial.read()) != -1)
{
//Wait until all response chars are received
}
}

//Send the command to Bluetooth Bee
void sendBlueToothCommand(char command[])
{
blueToothSerial.print(command);
CheckOK();
}[/code] in spit off this, when i’m trying to find the device with a cellphone or a laptop, nothing apens, the green keeps blinks two times / second, what i’m missing? someone can help me?

regards.

#include <NewSoftSerial.h>

NewSoftSerial mySerial(11, 12);

void setup() {
Serial.begin(38400);

mySerial.begin(38400);

}

void loop() {
if (mySerial.available()) {
Serial.print((char)mySerial.read());
}
if (Serial.available()) {
mySerial.print((char)Serial.read());
}
}

This is the code Fanfarra, with this code you have to configure xbee with sscomm
sorry for my english

AHA!!! Thanks Mazz!

Ridiculous as it may seem… I’ve been bashing my head against the wall with this… your addition of “b[/b]” makes it all work. In the code example from the Seeeduino wiki, there’s no “b[/b]”. GRRR.

Thanks for that little gem!

Hi,
i have a little prob. with my new Serial port bluetooth module (Master/Slave)
if i connect it with my pc via sscom32e i got for example:
+
+STWMOD=1
OK
WORK:MASTER
+BTSTATE:0
+BTSTATE:1
+BTSTATE:3
CONNECT:FAIL
+BTSTATE:1

+INQ=1
OK

+BTSTATE:2

+RTINQ=44,11,E0,AC,70,2A;Galaxy S
+
+CONN=44,11,E0,AC,70,2A

OK

+BTSTATE:3

CONNECT:FAIL

+BTSTATE:1

and my mobile phone gave me an error! Phone it’s a <> BT 3.0
if i try as Slave i don’t get anything (no Require; pincode)

And what is the meaning of this message?
+BTSTATE:0
+BTSTATE:1
+BTSTATE:3
CONNECT:FAIL
+BTSTATE:1

Please Help!

TY :slight_smile:

Hi,

I have problems connecting my Bee in Linux.
I tried to follow the guide from the wiki. So I can see it, and pair it. But I cannot open the rfcomm via cutecom. The error message didn’t really help. Is there another way I can try (maybe via commandline) to open the rfcomm device?
I also tried pairing via hcitool. It works too. But browsing the device with sdptool doesn’t show any services. Is that supposed to be that way?

I tried it with Windows and it worked. But it won’t help me with my Linux application :wink:

So has someone a suggestion?

Thank you in advance.

Best regards,

Hello,
I have a ARM Cortex M3 Board and connected the Module, but when I use this Code, I dont see the BT Device in my Windows. :frowning:
What I’m doing wrong ???

void SetupBT (void)
{

/* USART2 Clock an*/
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);

/*Init USART2 USART2: CTS PA0, RTS PA1, TX PA2, RX PA3 */

/* Configure USART2 RTS and USART2 Tx as alternate function push-pull */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);

/* Configure USART2 CTS and USART2 Rx as input floating */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_3;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);

USART_InitStructure.USART_BaudRate = 115200;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_RTS_CTS;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_Init(USART2, &USART_InitStructure);
USART_Cmd(USART2, ENABLE);

/* Init BT */
Delay(200);
send_string("\r\n+STWMOD=0\r\n");
send_string("\r\n+STNA=IMU200\r\n");
send_string("\r\n+STAUTO=0\r\n");
send_string("\r\n+STOAUT=1\r\n");
send_string("\r\n +STPIN=0000\r\n");
Delay(200);
send_string("\r\n+INQ=1\r\n");
Delay(200);

}

please help me, I’ve bought 10 modules for my ten devices.
I want to setup a connection with my PC but I dont find the device with my BT Dongle. I measured VCC and its at 2,7V-3V

I’m using it with ARM Cortex M3 from ST (STM32F103ZE)

Is my procedure correct?

with regards
Sam

push