ArduinoBT using the CALL function

Hi All,

I'm trying for a long time to get the CALL function working to make it possible to connect two ArduinoBT modules.
The Call function is working between PC and one ArduinoBT. For a strange reason I need to change ports when I call from the Arduino to the PC.

The problem is that I still don't get the connection between the ArduinoBT's working. I use this code to connect to an arduinoBT module.

void callF(){
  if(fO == 0){
    for(int g=0; g<7; g++){
      if(kBTn[g][1] == 1 && kBTn[g][2] == 2){
         inS.clear();
         fO = 2;
         outP(2, 500, 500, motor);
         outP(2, 500, 500, statusLED);
         Serial.print("+++");
         outP(4, 500, 500, statusLED);
         Serial.print("CALL ");
         Serial.print(kBTa[g]);
         Serial.print(" 1 RFCOMM"); 
         Serial.println("");   
         outP(1, 10000, 0, statusLED);  
         outP(2, 500, 500, statusLED);
         Serial.print("+++");
         outP(4, 500, 500, statusLED);
         getSt(); // get the complete serial buuffer into the sting inS 
         Serial.println(inS.getArray());   // prints the string inS   
      }
    }
  }
  inS.clear();
}

This code I use to connect from an ArduinoBT module to my PC.

void callM(){        
         outP(2, 500, 500, statusLED);
         Serial.print("+++");
         outP(4, 500, 500, statusLED);
         outP(1, 10000, 0, statusLED);
         Serial.println("CLOSE 0"); 
         outP(1, 10000, 0, statusLED);
         Serial.println("CALL 00:16:41:ca:80:d9 1 RFCOMM"); 
         //Serial.println("");   
         outP(1, 10000, 0, statusLED);  
         outP(2, 500, 500, statusLED);
         Serial.print("+++");
         outP(4, 500, 500, statusLED);
         getSt(); // get the complete serial buuffer into the sting inS 
         Serial.println(inS.getArray());   // prints the string inS   
         Serial.println("*");
}

void outP(int t, int on, int of, int p){
  for(int i=0; i <= t; i++){
    digitalWrite(p, HIGH);
    getSt();
    if(fO == 0){
      cFc();
      coOs();
    }
    delay(on);
    digitalWrite(p, LOW);
    delay(of);
  }
}

I hope that somebody can help me with this problem. When I get the call function working I will try write tutorial about this topic.

Thanks!

Hi,

im also wrestling with Arduino BT...
I want to enable the DTR line, so that arduinoBT can be reset wirelessly.

So far I can only strongly recommend to use a direct connection to the bluettoth module (a wired one!) and test your commands from your computer. (reasons are below)
Its quite easy:
To free the Bluetooth serial lines, the ArdunioBT Board must be in reset state. You can just put a jumper between GND and RESET on the ICSP connector to accomplish this (its the opposit end of pin1 of the ICSP con.).
Then you need another serial device. E.g. an arduino USB board or any usb-serial adapter (with TTL levels) would work.
If you want to use an Arduino USB board, you have to put it also in reset state, like the ArduinoBT above.
Then you simply connect the RX pins from one board with the TX pins form the other and vice versa (digital pins 0 and 1). And don't forget to connect GND between both boards also!

The configuration the bluetooth module has as delivered on ArduinoBTs prevents any configure commands as long as there is any active bluetooth connection. Also the command mode entrance with escape sequences is disabled from my understanding.
See the initialisation sketch http://www.arduino.cc/en/Main/ArduinoBTInitializationSketch.

I think this is a design error of ArduinoBT. One has to enable command mode activation first and the can play really with bluetooth module interaction etc.. They could have enabled at least a specific "enable command mode pin", but this is also disabled with "SET CONTROL ESCAPE - 00 1"

I wish there would be much more precise ArduinoBT documentation. What's about the solder jumpers?
At least SJ1 named "HS" sounds interesting... Is this for Arduino IDE controlled serial buffer sending? (Massimo? :slight_smile:

good luck,
oli
p.s. does anyone know a command to show all current configuration settings of the bluetooth module?

check this thread . There is some example code to read the settings.
But if you use the hardware serial port to the BT module you can use the "SET" command directly to read out the settings. You can change the control echo mode so you can see what you type. Don't forget to change the control echo mode back to 0 otherwise your board will be useless.

hi bigengineer!

that thread is a great help. thanks!
But could you please confirm, that your SET-request program works on a standard configured arduinobt board?
On my board I see "+++SET+++" when starting the SET request. So the escape sequence is ignored and I don't get feedback.
Could you also confirm, that on an original configured arduinobt board, the escape seqeuence is enabled? I'm really wondering here, because in the arduinobt init sktech it says "SET CONTROL ESCAPE - 00 1" which means no escape sequence is enabled accroding to the iWrap user manual.

Even when I'm direct (serial-usb) connected to the Bluegiga chip I don't get an output with "SET".
(And I also ran the Init Sketch to reset all original settings - just to be shure)
Maybe I screwed some setting up... (the ECHO command setting seems ok :wink: )

Could someone please post the default output of the "SET" comand on arduinoBT?
I think this would be very good for the arduinobt documentation page.

Hey all,

at this moment I'm working on a tutorial with as topic using the ArduinoBT module.
In this tutorial I will show how to use commands like call, list, inquiry, select and close.

Can somebody tell me where I can post this tutorial?

Gr... Arjen

hi bigengineer!

that thread is a great help. thanks!
But could you please confirm, that your SET-request program works on a standard configured arduinobt board?
On my board I see "+++SET+++" when starting the SET request. So the escape sequence is ignored and I don't get feedback.
Could you also confirm, that on an original configured arduinobt board, the escape seqeuence is enabled? I'm really wondering here, because in the arduinobt init sktech it says "SET CONTROL ESCAPE - 00 1" which means no escape sequence is enabled accroding to the iWrap user manual.

You are right, you have to change the SET CONTROL ESCAPE. You can use the init sketch for it. You can also put in the setup() loop, but then you always have to wait for the delays.

Even when I'm direct (serial-usb) connected to the Bluegiga chip I don't get an output with "SET".
(And I also ran the Init Sketch to reset all original settings - just to be shure)
Maybe I screwed some setting up... (the ECHO command setting seems ok :wink: )

Strange, I have never tried it that way. But I think it should work. Do you get any respons from the BT? After a reset for instance?

Could someone please post the default output of the "SET" comand on arduinoBT?
I think this would be very good for the arduinobt documentation page.

How is this helpful you think? It only outputs some of the parameters.

Hey all,

at this moment I'm working on a tutorial with as topic using the ArduinoBT module.
In this tutorial I will show how to use commands like call, list, inquiry, select and close.

Can somebody tell me where I can post this tutorial?

Gr... Arjen

In the playground of course. But you have to make a new account for it. But please do. There is so little info about the arduino BT.