Set up connections between two BluetoothBee step by step

Hi Chris,

I tried again some of our bluetooth module(master/slave), and as a result, I did find the “LOSSRECONN” command was not recognized by the module. And also some of them as slave can not be successfully connected by computer . We are so sorry about that, and trying to figure it out as soon as possible.
You may try to set the module as a master, connecting to the computer actively. If it still can’t work,
mail it back and we will take a replacement for you.

Sorry again to bring you so much trouble :blush:

All the best,

-Icing

I got it!

Set the module to master mode
+conn=[enter the bluetooth address of your computer xx,xx,xx,xx,xx,xx] (When I did a search with +inq=1, my computer did not show up)

Your computer will ask for the pin # and install the drivers
Once everything is installed, connect again, same as above (you may not need to do this, but it’s what I tried)

On your computer, open up whatever terminal program you use, Putty, Realterm, SSCOM, and open a connection to the primary serial port. (Windows sets up two, a transmit and a receiving, but that primary one does both, normally, the primary is the lower of the two ports)

The connection should start automatically once you open the port. There will be not be a connection if you do not have a terminal program running. If you close the terminal, then try to reconnect, you may get some error, this has to do with the previous connection not timing out yet, just try reconnecting until it works.

All settings on the module are saved automatically, you should be able to cycle it’s power, reopen the terminal on your computer, and it should connect again.

FYI: Rx of the bluetooth module goes to Tx of the microcontroller, Tx module goes to Rx microcontroller
Also, if you’re connected to a microcontroller and start both at the same time, either put it in reset mode or do not have the microcontroller transmitting, it will lock up the boot sequence of the bluetooth module.

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);

}