Pairing mac with bluetooth shield

Hi all,

I’m using Arduino ethernet board and I have two different bluetooth shields: itead ble shield (http://imall.iteadstudio.com/development-platform/arduino/shields/im130704001.html), and seeed’s Bluetooth shied (http://www.seeedstudio.com/wiki/Bluetooth_Shield).
I cannot figure out how to pair with my macbook/android phone.

With seeed’s blue tooth I upload this code on board (from the official example). On the shield, the led blinks, but neither macbook nor androind can see the board.

#include <SoftwareSerial.h>   //Software Serial Port
#define RxD 9
#define TxD 8
#define DEBUG_ENABLED  1
#define PIN_TEMP    A5

SoftwareSerial blueToothSerial(RxD,TxD);

int getTemp()
{
  return 44; // fake
}

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(recvChar == 't' || recvChar == 'T')
            {
                blueToothSerial.print("temperature: ");
                blueToothSerial.println(getTemp());
            }
        }
        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();
}

So I tried with BLE shield, uploading a blank sketch. Again, shiled’s led blinks but nothing can see it.

Can anyone help me to figure out how it runs?
Thanks in advance

Davide

Maybe you have to search this forum on the BT topics - discussed many times…
You are trying the AT mode - this mode must be enabled by putting a specific BT module pin to a specific logic level (see your BT module datasheet) and by resetting the module.

Try to connect without messing with the AT mode as the first step. Just print “Hello world” from arduino via BT to your Mac.

G…le: “mac arduino bluetooth”

For example:

#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 8); // RX, TX
void setup()  
{
  mySerial.begin(9600);
  mySerial.println("Hello World!");
  }
void loop() {}

Hi Pito,
Thanks for reply

I'm humble software developer, I cannot read datasheets... what's AT mode?
Now I only followed the example "Demonstration 2: Connect to Smart Phone" on this page Bluetooth Shield‏‎ - Seeed Wiki.
This example it's absolutely simple, but the problem is that my android device does not see my arduino (the led on the BT module continue to blink)
I cannot understand why nothing can see it... maybe the problem is the ethernet motherboard?

Thanks

griffosx:
my android device does not see my arduino

Here is some background on android.

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

Don't expect it to be much use with a mac, but getting the Android to go may help eliminate problems with the mac.

I don't know what an ethernet motherboard is but, if the light is blinking, it is not likely to be causing a problem.