Set up connections between two BluetoothBee step by step

wireless communication and related Bees.

Moderators: lily.li, violet, jessie

marco_righe
Pre-kindergarten
Pre-kindergarten
Posts: 3
Joined: Sat Feb 27, 2010 12:44 am

Re: Set up connections between two BluetoothBee step by step

Post by marco_righe » Tue Aug 03, 2010 4:50 am

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 .

coolgreenguy
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Tue Aug 17, 2010 11:16 am

Re: Set up connections between two BluetoothBee step by step

Post by coolgreenguy » Tue Aug 17, 2010 11:32 am

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

Icing
Elementary-1
Elementary-1
Posts: 140
Joined: Wed Oct 21, 2009 10:39 pm

Re: Set up connections between two BluetoothBee step by step

Post by Icing » Wed Aug 18, 2010 12:33 am

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

coolgreenguy
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Tue Aug 17, 2010 11:16 am

Re: Set up connections between two BluetoothBee step by step

Post by coolgreenguy » Sat Aug 21, 2010 1:18 pm

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 !

miguelx
Pre-kindergarten
Pre-kindergarten
Posts: 3
Joined: Mon Jul 12, 2010 7:41 pm

Re: Set up connections between two BluetoothBee step by step

Post by miguelx » Sat Sep 18, 2010 8:52 pm

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

mazz1
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Tue Jan 25, 2011 10:13 am
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: bluetooth bee

Re: Set up connections between two BluetoothBee step by step

Post by mazz1 » Fri Jan 28, 2011 9:30 pm

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 !

fanfarra
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Sun Feb 06, 2011 12:03 am
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: arduino uno

Re: Set up connections between two BluetoothBee step by step

Post by fanfarra » Sun Feb 06, 2011 12:10 am

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: Select all

#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();   
}
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.

mazz1
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Tue Jan 25, 2011 10:13 am
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: bluetooth bee

Re: Set up connections between two BluetoothBee step by step

Post by mazz1 » Sun Feb 06, 2011 6:38 am

#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

beardy241
Pre-kindergarten
Pre-kindergarten
Posts: 8
Joined: Sun Feb 08, 2009 10:51 am

Re: Set up connections between two BluetoothBee step by step

Post by beardy241 » Thu Jun 02, 2011 8:29 am

void loop() {
if (mySerial.available()) {
Serial.print((char)mySerial.read());
}
if (Serial.available()) {
mySerial.print((char)Serial.read());
}
}
AHA!!! Thanks Mazz!

Ridiculous as it may seem... I've been bashing my head against the wall with this... your addition of "(char)" makes it all work. In the code example from the Seeeduino wiki, there's no "(char)". GRRR.

Thanks for that little gem!

TheFoxy
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Tue Sep 27, 2011 3:15 am
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: Bluetooth, Clock usw

Re: Set up connections between two BluetoothBee step by step

Post by TheFoxy » Tue Sep 27, 2011 4:14 am

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 <<Samsung galaxy>> 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 :)

Post Reply