So I’ve been playing with this for 2.5 days and can’t figure it out.
All I want to get it work is communicating to Arduino Duemilanove from my Ubuntu computer via bluetooth. And I’ve seen that people simply connected the bluetooth modem (BlueSMiRF) to serial comm on Arduino.
First the connection:
TX (Arduino Duemilanove) ----- TX-0 (BlueSMiRF)
RX (Arduino Duemilanove) ----- RX-1 (BlueSMiRF)
5V (Arduino Duemilanove) ----- VCC (BlueSMiRF)
GND (Arduino Duemilanove) ----- GND (BlueSMiRF)
CTOS (BlueSMiRF) ----- RTOS (BlueSMiRF)
Here’s the code I uploaded, very generic one I found online:
char val; // variable to receive data from the serial port
int ledpin = 13; // LED connected to pin 48 (on-board LED)
void setup() {
pinMode(ledpin, OUTPUT); // pin 48 (on-board LED) as OUTPUT
// Serial.begin(115200); // start serial communication at 9600bps
Serial.begin(9600); // start serial communication at 9600bps
}
void loop() {
if( Serial.available() ) // if data is available to read
{
digitalWrite(ledpin, HIGH); // turn ON the LED
val = Serial.read(); // read it and store it in 'val'
}
if( val == 'H' ) // if 'H' was received
{
Serial.print("Print YES\n");
}
else {
Serial.print("\rPrint no\n");
}
delay(1000); // wait 100ms for next reading
}
I can see the comm working via USB Serial (/dev/ttyUSB0) on three programs – Arduino Serial Monitor, Minicom, and GTKTerm.
I unplug the USB cable, connect an external 7.2V battery, then enable SPP via Blueman app. Now the serial should be visible on (/dev/rfcomm0) at baud rate 9600 (default). I don’t see anything. I try 115200, still nothing.
I haven’t seen a full solution on this, so any suggestions?
First you need to swap your RX/TX pins, TX Bluesmirf ↔ RX Arduino and vice versa. By default it should be 115200, and it may take a few power cycles to get it to connect. Let me know if you have problem after that. I would recommend getting one of http://www.sparkfun.com/commerce/produc … ts_id=9717 or something similar, makes life easier when changing baud rates and other settings when the bluetooth is being dumb.
I am trying to get my bluesmirf to send serial data continuously from an analog input on my arduino. My problem is that it is lagging, looks like some kind of buffer issue, not sure though.
Supernoodle:
First you need to swap your RX/TX pins, TX Bluesmirf ↔ RX Arduino and vice versa. By default it should be 115200, and it may take a few power cycles to get it to connect. Let me know if you have problem after that. I would recommend getting one of http://www.sparkfun.com/commerce/produc … ts_id=9717 or something similar, makes life easier when changing baud rates and other settings when the bluetooth is being dumb
Yes, yes, and yes. I always configure those bluetooth modules over a serial link and not through a micro, just so I know that I'm sending it valid characters. Don't plug the output of a DB9 directly into the bluesmirf, you'll kill it. Other than that, make sure you have read through the cmds in the user manual for RN-41.
I’m also having problems with the bluesmirf:
The problem is that once i establish a serial connection i can’t get the unit to enter into command mode properly.
I’ve tried the various methods listed in several bits of the documentation such as switching the baud from 9600 (which I achieve the best results with) to 115200, switching the voltage from 5v to 3.3v and connection via USB rather than over the BT connection.
The best working hardware setup I’ve achieved is by using Linux(Ubuntu) with BlueSoleil I’m able to get a serial connection on /dev/ttyb5. I plug the Bluesmirf into an Arduino Duelminove 168 using the sparkfun protoshield. The cts and rts pins are bridged on the protoshield and I’ve tested all the contacts on the device with my multimeter.
and then I attempt to connect with screen using the setting:
screen /dev/ttyB5 9600,cs8,-parenb,-cstopb,-hupcl
this opens up a valid screen section, but the only thing that seems to have any effect on the terminal which gives me this uncontrollable output:
http://i799.photobucket.com/albums/yy27 … bugerr.png
in addition to this it also streams out a steady stream of diagonally spaced question marks.
commands I enter after this point seem to have little or no effect and the output trails off completely unresponsively for the remainder of time I let it run eventually the question marks turn to exclamation points and the whole process freezes.