Bluetooth Bee Standalone baud rate

wireless communication and related Bees.

Moderators: lily.li, violet, jessie

Post Reply
mattb243
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Wed May 16, 2012 3:37 pm
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: Bluetoothbee

Bluetooth Bee Standalone baud rate

Post by mattb243 » Wed May 16, 2012 3:42 pm

I've been trying to set the baud rate on the BTB device, but the only one that seems to work is the default baud rate. It has all of these baud rates advertised "Supported baud rate: 9600,19200,38400,57600,115200,230400,460800". What am I missing?

For example, I'm trying:

void setupBlueToothConnection()
{
blueToothSerial.begin(460800); //Set BluetoothBee BaudRate to default baud rate 38400
delay(1000);
sendBlueToothCommand("\r\n+STWMOD=0\r\n");
sendBlueToothCommand("\r\n+STNA=SeeedBluetooth-st\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.
}

mattb243
Pre-kindergarten
Pre-kindergarten
Posts: 2
Joined: Wed May 16, 2012 3:37 pm
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: Bluetoothbee

Re: Bluetooth Bee Standalone baud rate

Post by mattb243 » Sun May 20, 2012 4:37 pm

I tried using increasing the baudrate using the following as well:

blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
delay(1000);
sendBlueToothCommand("\r\n+STBD=115200\r\n");

Now the device is not functioning at all. Can't get it back to default state. Why is this? I would like to know if only 38400 baud rate is supported with this device and how to recover the device after changing the baudrate to 115200.

strohkopf
Pre-kindergarten
Pre-kindergarten
Posts: 9
Joined: Wed Dec 05, 2012 4:02 pm

Re: Bluetooth Bee Standalone baud rate

Post by strohkopf » Wed Dec 05, 2012 5:00 pm

Have absolutely the same problems, need a support.

strohkopf
Pre-kindergarten
Pre-kindergarten
Posts: 9
Joined: Wed Dec 05, 2012 4:02 pm

Re: Bluetooth Bee Standalone baud rate

Post by strohkopf » Wed Dec 05, 2012 8:12 pm

Hm... seems I have solved this problem and return baud rate to default when uploaded this sketch:

Code: Select all

#include <SoftwareSerial.h>
#define RxD 0 // 2
#define TxD 1 // 3

SoftwareSerial blueToothSerial(RxD,TxD);
void setup()
{
//  Serial.begin(9600); //Serial port for debugging, Comment this line if not required
  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()
{
//  Serial.print("Setting up Bluetooth link"); //For debugging, Comment this line if not required
  blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
  delay(1000);

  sendBlueToothCommand("\r\n+STWMOD=0\r\n");
  sendBlueToothCommand("\r\n+STBD=38400\r\n"); 
  sendBlueToothCommand("\r\n+STNA=UMPT12\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.
  blueToothSerial.print("\r\n+INQ=1\r\n");
  delay(2000); // This delay is required.
//  Serial.print("Setup complete");

}

void sendBlueToothCommand(char command[])
{
  char a;
  blueToothSerial.print(command);
//  Serial.print(command); //For debugging, Comment this line if not required
  delay(1000);
/*  
  while(blueToothSerial.available()) //For debugging, Comment this line if not required
  { //For debugging, Comment this line if not required
  Serial.print(char(blueToothSerial.read())); //For debugging, Comment this line if not required
  } //For debugging, Comment this line if not required
*/  
}
Last edited by strohkopf on Fri Dec 07, 2012 4:23 am, edited 1 time in total.

strohkopf
Pre-kindergarten
Pre-kindergarten
Posts: 9
Joined: Wed Dec 05, 2012 4:02 pm

Re: Bluetooth Bee Standalone baud rate

Post by strohkopf » Fri Dec 07, 2012 4:22 am

But still dunno how to change it!

myke.predko
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Mon Jan 14, 2013 12:03 pm

Re: Bluetooth Bee Standalone baud rate

Post by myke.predko » Mon Jan 14, 2013 12:31 pm

Sorry, the example code doesn't work for me.

Anybody know of a way to restore the BT Bee Standalone to its original settings?

HugeMan
Elementary-2
Elementary-2
Posts: 248
Joined: Tue Jan 25, 2011 2:04 pm
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: DSO

Re: Bluetooth Bee Standalone baud rate

Post by HugeMan » Thu Jan 17, 2013 4:00 pm

1. bad new, it seems there is no command to reset to the original setting, you need to remember your last setting....
2. the BT moduel supports more than 115200, but it does not mean the UART of mcu supports. especilly the software serial of arduino. Jenerally, i suggest you not setting baudrate more than 115200. i tested by senting "+STBD=230400" with PC and uartsbee, it returns "OK", but very bad, there is no 230400 option on my PC comm terminal.... so, now , it is dead....!~ help....

ivwiwba35
Pre-kindergarten
Pre-kindergarten
Posts: 6
Joined: Mon Dec 03, 2012 9:10 am

Re: Bluetooth Bee Standalone baud rate

Post by ivwiwba35 » Sat Jan 26, 2013 4:05 pm


User avatar
Jacket Chen
Staff
Staff
Posts: 659
Joined: Thu Jun 21, 2012 4:25 pm
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino Shields
Location: China

Re: Bluetooth Bee Standalone baud rate

Post by Jacket Chen » Thu May 16, 2013 2:49 pm

hey , maybe you can use this tool "putty" to reset your baud rate...but i have not used it yet... :roll:
Love little, love long.

Post Reply