Seeedstudio BT Shield not discoverable!

Hi!

Here comes the problem once again…

I’ve got an Arduino UNO R3 with Seeedstudio BT Shield, I’ve found several topics in here but none of these helped me to sort it out. The BT Shield isnt discoverable in my HTC Android phone. I tried to use different sketches, tried different jumper connections - no result. I even downloaded the older Arduino 0022 software to upload the sketch - that didnt help either.

One of the sketches i used was:

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

}

Another one and whole guide i followed was:

http://www.rjanick.com/2012/11/26/seeed-studio-bluetooth-shield/

But still no results. What i get is the green LED on the BT Shield blinking, but never the red one. I get the message ‘‘The slave bluetooth is inquirable!’’ in the serial monitor but still nothing happens, can’t connect because i can’t even see the device in Bluetooth SPP or Bluetooth SPP Test app.

Any suggestions?

anyone?

Come on guys, someone got to help me =(

I don't know anything about your bluetooth shield, NewSoftSerial, or the code.

The code does seem suss, if only because there seems to be a hell of a lot of it for such a simple job. Further, the duplication of the command

Serial.begin(38400);

and the comments about pin 48, also make me suspect it is junk cobbled up from something else, even though these lines are probably more indicative of, rather than a direct cause of, your problem.

Having said all that, you might try using another device. I despaired of ever getting my Arduino to talk to my Android tablet but when I got a phone it was fine. I eventually found that the tablet was OK with a different bluetooth module and that module was also OK with the phone. My tablet is pretty clunky and I'm more inclined to blame it than Arduino, but it does show that all is not perfect in the bluetooth world.

Thank you for your answer!

I already tried using another device, but the problem is that the RED led on the bluetooth shield doesn’t blink at all, never. And the shield is in only discoverable, in ‘‘pairing-mode’’ when the red led does blink. So there is either some code or hardware problem i guess.

mrscared: already tried using another device........there is either some code or hardware problem i guess.

OK. So that's that one out of the way.... Now while I have strong doubts about the code, I believe the problem could be more fundamental than that. I'm not familiar with the Seeed but one bluetooth isn't so different from another and, if you cannot get pairing, this isn't down to Arduino per se, but it could be because you used, or are using, the Arduino to stuff the bluetooth up. If the latter, it is because the code is not only suss, but also not intended for the purpose you think it is. It seems amish-mash but part of it could be for setting the bluetooth up rather than actually communicating.

You need to be sure of the differences between pairing, connecting and communicating. Pairing is between Android and bluetooth. Arduino is not involved and does nothing more than provide the power, i.e. if you have another source of power for bluetooth, Arduino could be disconnected. Once the pairing is made bluetooth is "on the books" at Android and henceforth you just connect. As for communication, Android and Arduino just talk to Bluetooth and and don't know what it is connected to the other side - if anything.

I hesitate to offer this link but it might shine some light on common principles.

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino