Hi! I'm new to arduino and cannot manage some questions.
A couple of days ago I'v recived HC-06 bluetooth for my arduino Uno board.
I'm an ubuntu user an have a usb bluetooth dongle for my pc.
So I cant make my Arduino board send data with bluetooth conatsntly.
After the HC-06 is connected to the board (RX TX pins or SoftwareSerial - no difference) I'm getting the next:
hcitool scan - gives me the device name and it's MAC adress.
rfcomm connect HC-06 works like charm.
But when I want to see the output from bluetooth (using cat /dev/rfcomm0 or putty serial or my own JSSC based java program)
I see that the data transmission stops after a few seconds.
Here is my arduino programm (as simple aspossible):
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.write("Test");
delay(1000);
}
The program is simple but I'v tried more complex (using Software serial, as I wrote, etc.)
So when I look at the port monitor provided byArduino IDE everything is ok. ("Test" goes on and on and on...);
But via Bluetooth I could get only 32 to 128 bytes of data, and after that no further data is transmitted. (While the connection is sitll on - the led on my HC-06 is not blinks). For example: TestTestTestTestTestTestTestTest
Have you any Ideas about the reason of such thing?
Also I'll be glad anybody to explain me the next:
When I try to listen to incoming data I cant do it at all. When the arduino program is written to get data from the serial (watch the code)
if (Serial.available() > 0) {
incomingByte = Serial.read();
if (incomingByte == "h") {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
}
}
So
echo "h" > rfcomm0 //linux console
gives no result and for example:
serialPort.writeBytes("h".getBytes()); //java code
gives no result two.
I'll be glad for any help!