thank you for your answer. I tried it with 38400 Baud, but nothing happened:-(
my switch is at DAT, when I set it on CMD I can't find the shield with my computer.
I also tried it with software serial:
#include <SoftwareSerial.h>
SoftwareSerial ss(6,7); //I set the jumper for rx to 6 and tx to 7
void setup()
{
ss.begin(9600);
}
void loop()
{
if(ss.available())
{
ss.write("Incomming");
}
}
I used blueman to connect the shield to /dev/rfcomm0
Then I used cat /dev/rfcomm0 to listen and echo hello > /dev/rfcomm0 to send.
Serial.print("Hello") and Serial.write("Hello") don't make a difference.
I don't know what the problem could be, far too many things could be wrong and without being able to see how your linux box or shield is set up it's hard to say. when you type "rfcomm" at the command line does it show your bluetooth device?
rfcomm0: xx:xx:xx:xx:xx:xx channel 1 closed
where "xx:xx:xx:xx:xx:xx" is the address of your particular bluetooth shield?
rfcomm0 {
# Automatically bind the device at startup
bind yes;
# Bluetooth address of the device
device xx:xx:xx:xx:xx:xx;
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment "Arduino";
}
again where "xx:xx:xx:xx:xx:xx" would be the address for your particular bluetooth shield.
my rfcomm.conf was commented out, so I edited it like yours, but it is still not working.
It looks like this:
rfcomm0 {
# Automatically bind the device at startup
bind yes;
# Bluetooth address of the device
device 00:12:11:12:06:48;
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment "arduino";
}
(without xx:xx... of course ) Make sure you didn't get something else. It would be nice to see a complete copy of your terminal output while you are doing these things too. It's difficult to diagnose a problem without knowing what exactly happened.
Do
$ sdptool browse local
You should find something like this in the output
Service Name: Serial Port
Service Description: COM Port
Service Provider: BlueZ
[...]
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
then do
sdptool records xx:xx:xx:xx:xx:xx
(with your BT shield address)
you should see something like
make sure all the channel numbers match each other and your rfcomm.config file. Also make sure your cat and echo commands output file name match the actual rfcomm. e.g make sure it isn't >/dev/rfcomm0 when your shield is on rfcomm1.
If that still doesn't work then I've ran out of ideas, maybe your bluetooth shield is faulty.