SOLVED: Seeedstudio BT Shield

Hi everyone! I am new to the this BT communication :confused: Ok, my end goal is to connect my android phone via the Arduino Commander app to my arduino board that is controlling different motors. I have purchased the seeedstudio BT Shield, gone to their website for instructions, read through the Wiki (and did everything it says to do), searched online for videos or simple instruction guides (no luck) and can't get it to connect through the SSCOM3.2 app provided on the Wiki(which worries me because I am not even going to be connecting through that software, I will be connecting through my phone). I changed the code (see Wiki http://www.seeedstudio.com/wiki/index.php?title=Bluetooth_Shield) as instructed for the latest version of Arduino and the sketch uploads to the board. After that, the SSCOM3.2 should let me know that the BT sheild is inquireable (I am trying to set as slave) but it does nothing. (One thing to note, on the wiki, the ComNum on the middle right side of SSCOM3.2 is COM156... mine is empty, I don't think I set up something correctly but can't find instrcution on the Wiki)

I am looking for instructions, or a starting point to read up more on connecting via BT. It would be great to talk to someone who has used the seeedstudio BT shield and had it work correclty. Any help is better than I have now :confused: Thanks.

The code for anyone that wants to know:

/*
BluetoothShield Demo Code Slave.pde. This sketch could be used with
Master.pde to establish connection between two Arduino. It can also
be used for one slave bluetooth connected by the device(PC/Smart Phone)
with bluetooth function.
2011 Copyright (c) Seeed Technology Inc.  All right reserved.
 
Author: Steve Chang
 
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*/
 
// old line: #include <NewSoftSerial.h>   //Software Serial Port
#include <SoftwareSerial.h>               //new line
#define RxD 6
#define TxD 7
 
#define DEBUG_ENABLED  1
 
// old line: NewSoftSerial blueToothSerial(RxD,TxD);
SoftwareSerial blueToothSerial(RxD,TxD);  //new line
 
void setup() 
{ 
  Serial.begin(9600);
  pinMode(RxD, INPUT);
  pinMode(TxD, OUTPUT);
  setupBlueToothConnection();
 
} 
 
void loop() 
{ 
  char recvChar;
  while(1){
    if(blueToothSerial.available()){//check if there's any data sent from the remote bluetooth shield
      recvChar = blueToothSerial.read();
      Serial.print(recvChar);
    }
    if(Serial.available()){//check if there's any data sent from the local serial terminal, you can add the other applications here
      recvChar  = Serial.read();
      blueToothSerial.print(recvChar);
    }
  }
} 
 
void setupBlueToothConnection()
{
  blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
  blueToothSerial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
  blueToothSerial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as "SeeedBTSlave"
  blueToothSerial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
  blueToothSerial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
  delay(2000); // This delay is required.
  blueToothSerial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable 
  Serial.println("The slave bluetooth is inquirable!");
  delay(2000); // This delay is required.
  blueToothSerial.flush();
}

Hello, I'm also having a problem connecting (much less seeing the Arduino/Seeeduino Bluetooth Shield) with my android phone.
You wouldn't happen to be using Froyo/Android 2.2 on your phone would you?. I'm starting to see a few threads that don't mention 2.2 directly but most of the android devices that do work appear to be using Gingerbread/2.3. If that's the problem, then maybe we can get someone to start looking in that direction to fix things.
Bluetooth keyboards aren't seen by android 2.2 either. (and of course I have an LG Vortex which will probably never get a 2.3 update)

Winston

So I wasn't the only one after all! :sweat_smile: Well there's an extreme lack of documentation over Seeeduino BT shield. Other than the wiki, no one else apparently has heard of anything as such.
So I went through hell to get it working, but I succeeded! Imma solve this once and for all! :smiley:
Check 2 things:

  1. The code: This code works for Arduino 1+, makes the Bluetooth shield inquirable as a slave (it can receive data from other devices):
/* Upload this sketch into Seeeduino and press reset*/
 
#include <SoftwareSerial.h>   //Software Serial Port
#define RxD 6
#define TxD 7
 
#define DEBUG_ENABLED  1
 
SoftwareSerial blueToothSerial(RxD,TxD);
 
void setup() 
{ 
  Serial.begin(9600);
  pinMode(RxD, INPUT);
  pinMode(TxD, OUTPUT);
  setupBlueToothConnection();
 
} 
 
void loop() 
{ 
  char recvChar;
  while(1){
    if(blueToothSerial.available()){//check if there's any data sent from the remote bluetooth shield
      recvChar = blueToothSerial.read();
      Serial.print(recvChar);
    }
    if(Serial.available()){//check if there's any data sent from the local serial terminal, you can add the other applications here
      recvChar  = Serial.read();
      blueToothSerial.print(recvChar);
    }
  }
} 
 
void setupBlueToothConnection()
{
  blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
  blueToothSerial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
  blueToothSerial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as "SeeedBTSlave"
  blueToothSerial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
  blueToothSerial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
  delay(2000); // This delay is required.
  blueToothSerial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable 
  Serial.println("The slave bluetooth is inquirable!");
  delay(2000); // This delay is required.
  blueToothSerial.flush();
}

After uploading the code, you should see 2 results:
A) The Bluetooth shield's LEDs flashing Green & Red.
B) The Serial monitor displays: "The slave bluetooth is inquirable!"

  1. Jumpers should be setup correctly, like this picture.
    Jumpers highlighted here.

Let me know about the results!

I actually already had the BT module working with my laptop. It's with my phone that I can't get working.
I'm working on a motorized peddle cart (for me, my feet were broken in a car accident) and I wanted to have the controller detect when my phone was near by to activate the power. If I'm not there; then there's no power.
The only thing different on my BT module is the pin setup. I'm using D7 for the serial LCD (Parallax - and yes, I had problems with that also).
D5 and D6 for the BT and I'm still working on the GPS module that I'm putting in.

Winston

Ok, my issue was the COM1 port. The Arduino board in the device manager was COM3 and the Arduino 1.0.1 program was also COM3 (obviously) but the SCOM program is looking for COM1. I just noticed that it was COM1 because of everyone's pictures of the program saying "Device is Inquireable!". Anyway, I changed everything to COM1 and now my "Device is Inquireable!".

Two issues happen now, my phone - Dell Streak Android 2.3 - doesn't find the BT Shield. I used the standard BT discovery on the phone, Bluetooth Class Zero, and Arduino Commander and none found the device :/............. please help haha

The second issue is that COM1 is used now and my serial monitor won't work because apparently it runs off COM1? When I try to open the Serial Monitor on Arduino 1.0.1, on the bottom the main message is "Serial port 'COM1' already in use. Try quiting any programs that may be using it." I guess that is what SSCOM3.2 does is monitor the Serial Communication.

The BT board is blinking and I did get the SCOM app to say:

WORK:MASTER

+BTSTATE:0

+BTSTATE:1

Why are you using an infinite loop inside loop()? The loop() function is already called in an infinite loop.

PaulS:
Why are you using an infinite loop inside loop()? The loop() function is already called in an infinite loop.

What I used is just the example code that comes with the Seeedstudio BT Shield.

I am having this exact same issue, cannot tether to an Android galaxy s2 using identical code. I am very interested in seeing the solution

Tried with my Dad's Epic 4g and still no luck....

Here is the image of my board...

Ok, I feel like a moron... I was checking to see which lights were on and noticed the message coming up:

The slave bluetooth is inquirable!

WORK:MASTER

+BTSTATE:0

+BTSTATE:1

I started thinking about why it would be telling me the state is on and off.... well come to find out I didn't have the BT shield seated completely on the Arduino board..... EPIC FAIL. :confused: So anyway it is all working now! Thanks for everyone's help! Especially V0R73X for all the PM help!

Also a note, make sure that both red and green lights are blinking. I only had green so I was thinking that the board was working correctly. It wasn't until I checked for a red light (I didn't know where it was because I hadn't seen the lights light up so I didn't know the color of each) and saw the msgs that I figured out what was going on.

can you post a picture of the correct installation and the sample code that you used?

I haven't changed the code, its the same code as at the top of this job. I can't get the picture to show up correctly, unsure of how to post them on this forum. My seeedstudio BT shield fits snugly when the pins are halfway down. The issue was that I left the pins exposed halfway because the light started blinking at that point and it was snug. When I saw the message on the serial monitor I pushed the BT shield all the way so that the pins aren't showing at all.

I'm starting to think it's not so much of an Arduino code problem but maybe the BT shield Bluetooth profile is not completely jiving with the android Bluetooth profile. While it may be (a) BT SPP profile, it might not be all the way implemented. (A little wordy but I hope yall know what I mean) :sleeping:
I have an old Nokia cell phone with Bluetooth and my old Palm TX with Bluetooth (which I'm almost sure doesn't have the correct profiles), plus my wife's old LG phone which has (Headset, Handsfree, Phonebook Acc and Object Push) profiles. Hopefully one of these will see the arduino and vice/versa.
My LG Vortex has (HSP 1.1, HFP 1.5, OPP, FTP, PBA, DUN, A2DP 1.2, AVRC version 2.1+EDR) {I'll have to look these up}
Plus my laptop has (I guess everything, if it'll download it)

I'm gonna keep whacking away at it until I get something going.

Winston

Sorry for borrowing this topic, does the Seeed bt work with UNO, am desperately looking for a BT shield for development...

I am using it with the Arduino UNO R3. If I am correct R3 is just the latest version, please correct me if I am wrong. So this shield does work with the Arduino UNO.

Seeed BT shield should work with UNO, but I have been unable to actually get it to connect to my android phone. The original poster has had success using the code above, however I have had no such luck.

Yes, the shield DOES work with the UNO R3. The R3 is different in the placement of the reset switch. The prior two designs had the reset towards the center of the board making it difficult to press when other shields are in place.

And yes, the BT shield does work connecting to my laptop. But I want it to connect to my android phone also; and that's where I'm having the problem. Today I'm going to try using the BT shield in Master mode to see if it will at least detect my phone. Basically that's all I want it to do for now - just DETECT my phone, no connections yet.

Winston

Winston, im interested in your results; I've had no luck detecting or connecting to Android

Hi everyone.I was frustrated because of seedstudio BT is not connecting to my android Phone(samsung vibrant running ICS 4.0.4).after doing lot of change in code i had finaly made a simple code to work with seedstudio BT also u can connect your android phone and send commands to arduino board.

make sure that your jumper connection is as shown in picture it is default arduino serial com port.
Tx of sheild is connected to RX of arduino(Pin 0)
Rx of sheild is connected to TX of arduino(Pin 1)
Baudrate is 38400bps so no need to change baudrate of sheild its default baudrate of sheild.

char val; // variable to receive data from the serial port
int ledpin = 8; // LED connected to pin 48 (on-board LED) 
#include <NewSoftSerial.h>   //Software Serial Port

 
#define DEBUG_ENABLED  1



void setup() { 
  pinMode(ledpin, OUTPUT);  // pin 48 (on-board LED) as OUTPUT
  Serial.begin(38400);       // start serial communication at 9600bps
  
  setupBlueToothConnection();
 } 


void loop() { 
  if( Serial.available() )       // if data is available to read
  {
    val = Serial.read();         // read it and store it in 'val'
  }
  if( val == 'H' )               // if 'H' was received
  {
    digitalWrite(ledpin, HIGH);  // turn ON the LED
  } else { 
    digitalWrite(ledpin, LOW);   // otherwise turn it OFF
  }
  delay(100);                    // wait 100ms for next reading

 } 
 
 
 void setupBlueToothConnection()
{
  Serial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
  Serial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
  Serial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as "SeeedBTSlave"
  Serial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
  Serial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
  delay(2000); // This delay is required.
  Serial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable 
  Serial.println("The slave bluetooth is inquirable!");
  delay(2000); // This delay is required.
  Serial.flush();
}

This is a simple led toggle program make sure that to upload this program to your arduino board you need a older version of arduino softwae 0022 .you can write any other program like to control servo here we can write PWM Generation program in this sketch.you can send commands from mobile using Bluetooth SPP software.
I had found that seedstudio BT is not going to inquiry mode automatically that means every time it restart MCU need to send the commands to set it to inquirable mode and also set to slave mode.To work with BT sheild need to write this lines in to code
{
Serial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
Serial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
Serial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as "SeeedBTSlave"
Serial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
Serial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
delay(2000); // This delay is required.
Serial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable
Serial.println("The slave bluetooth is inquirable!");
delay(2000); // This delay is required.
Serial.flush();
}
.

sam.txt (1.48 KB)