Bluetooth Bee Standalone & DFROBOT IO Expansion Shield

wireless communication and related Bees.

Moderators: lily.li, violet, jessie

Post Reply
arduinofish
Pre-kindergarten
Pre-kindergarten
Posts: 3
Joined: Fri May 18, 2012 10:43 pm
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: Arduino Mega

Bluetooth Bee Standalone & DFROBOT IO Expansion Shield

Post by arduinofish » Fri May 18, 2012 10:49 pm

Hello,..

today i recieved a DFRobot IO Expansions Shield V5 and a Seeeduino Bluetooth Bee Standalone. My Problem is that i cant get it work together. When i plug the Xbee on the IO shield and run this code, my arduino can not be found as Bluetooth. When i plug the Bee on my Mega Sensor Shield on the COM2-Socket for XBees and set the Tx/Tx-Pin in the Code then it works.

Whats wrong?

Thanks
Peter


Code: Select all


/*
BluetoothBee Demo Code - Delay Based Implementaion
2011 Copyright (c) Seeed Technology Inc.  All right reserved.
 
Author: Visweswara R
 
This demo code is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
 
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.
 
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
For more details about the product please check http://www.seeedstudio.com/depot/
 
*/
 
/* Upload this sketch into Seeeduino and press reset*/
 
#include <NewSoftSerial.h>   //Software Serial Port
#define RxD 0
#define TxD 1
 
NewSoftSerial blueToothSerial(RxD,TxD);
 
void setup() 
{ 
    //Serial.begin(38400);          //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+STNA=Arduino\r\n");
    sendBlueToothCommand("\r\n+STAUTO=0\r\n");
    sendBlueToothCommand("\r\n+STOAUT=1\r\n");
    sendBlueToothCommand("\r\n+STPIN=987654\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(3000);
 
    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   
}


Tobe
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Tue Jan 17, 2012 11:04 am
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino

Re: Bluetooth Bee Standalone & DFROBOT IO Expansion Shield

Post by Tobe » Sat May 19, 2012 2:47 pm

For the Bluetooth Bee standalone,it already have a MCU there,so you can download the demo code directly to the Bluetooth bee.
For you code,there have a problem,for the D0,D1 is the hardware Serial port,so for you code,you use the software and the hardware serial port as the same one,so it's confuse to the Bluetooth.For the DFRobot IO Expansions Shield V5,its TX/RX is directly connect to the hardware serial,so it can not use the hardware to communicate with the PC by hardware serial.
For the Bluetooth Bee standalone you can see our wiki http://www.seeedstudio.com/wiki/Bluetoo ... Standalone

arduinofish
Pre-kindergarten
Pre-kindergarten
Posts: 3
Joined: Fri May 18, 2012 10:43 pm
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: Arduino Mega

Re: Bluetooth Bee Standalone & DFROBOT IO Expansion Shield

Post by arduinofish » Sat May 19, 2012 3:36 pm

mhh but can i use my MEGA as ISP to programm that 168? And how?

Tobe
Pre-kindergarten
Pre-kindergarten
Posts: 34
Joined: Tue Jan 17, 2012 11:04 am
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino

Re: Bluetooth Bee Standalone & DFROBOT IO Expansion Shield

Post by Tobe » Fri May 25, 2012 11:26 am

Hi,
I try the mega,but it can not work.
Try the UNO,It's ok.
I just follow the linkhttp://arduino.cc/en/Tutorial/ArduinoISP

schmron
Elementary-1
Elementary-1
Posts: 145
Joined: Mon Dec 05, 2011 6:12 am

Re: Bluetooth Bee Standalone & DFROBOT IO Expansion Shield

Post by schmron » Sat May 26, 2012 4:43 pm

Tobe wrote:Hi,
I try the mega,but it can not work.
Try the UNO,It's ok.
I just follow the linkhttp://arduino.cc/en/Tutorial/ArduinoISP
It can...
http://www.instructables.com/id/How-to- ... duino-isp/
Best regards from Vienna/Austria
Rony

arduinofish
Pre-kindergarten
Pre-kindergarten
Posts: 3
Joined: Fri May 18, 2012 10:43 pm
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: Arduino Mega

Re: Bluetooth Bee Standalone & DFROBOT IO Expansion Shield

Post by arduinofish » Wed May 30, 2012 3:34 am

Well its an Xbee. Can i programm it via a XBee-Port?

schmron
Elementary-1
Elementary-1
Posts: 145
Joined: Mon Dec 05, 2011 6:12 am

Re: Bluetooth Bee Standalone & DFROBOT IO Expansion Shield

Post by schmron » Wed May 30, 2012 5:14 am

arduinofish wrote:Well its an Xbee. Can i programm it via a XBee-Port?
Thats not necessary... on your Mega Sensor Shield it runs without problems (?).

I think the reset-circuit on the DFRobot IO Shield is incombatible with bluetooth bee. The bee already has a reset-circuit on board.

Just try a simple program (hardware serial print or blinking led) to check this.
Best regards from Vienna/Austria
Rony

Post Reply