I purchased a SparkFun BlueSmirf Gold bluetooth module but cannot seem to get it working completely. I will start off with just a brief explanation and then continue on to explicit detail. Read as much information as you think that you need to provide me with an answer, a suggestion, anything is appreciated!
Short version:
I have a BlueSmirf Gold bluetooth module and can connect to it on a Mac and PC using TeraTerm, Putty, zTerm, or Screen and can enter command mode and successfully pass AT commands that are saved properly. I cannot seem to send any sort of data, however, and I cannot figure out why for the life of me!
Long, detailed version:
I have it hooked up as follows:
vcc —> vcc
gnd → gnd
rx ----> tx
tx ----> rx
Right now it is hooked up to an Arduino Pro Mini 16 MHz ATMega328 controller. I have this powered via a 5v line to the raw pin. The Arduino powers on and so does the BlueSmirf. The BlueSmirf starts out with only a slowly blinking red LED.
From a PC I can connect via TeraTerm or Putty and from a Mac I can connect via zTerm or a Screen command. Once I connect, the blinking red status LED turns off and the green connect LED turns on, indicating a successful connection. From here I can enter command mode via the ‘$$$’ command. I can then issue any AT commands for it that I want and it takes them successfully and stores them. Right now all of the ports and the BlueSmirf are setup to 115200 baud, but I have tried it at 115200, 57600, and 9600 and received the same result. Here are the BlueSmirf configuration values and such, though I have tried many different configuration, this is how it is setup now:
CMD
ECHO ON
***Settings***
BTA=00066607B15B
BTName=FireFly-B15B
Baudrt(SW4)=115K
Parity=None
Mode =Slav
Authen=0
Encryp=0
PinCod=1234
Bonded=0
Rem=NONE SET
***ADVANCED Settings***
SrvName= SPP
SrvClass=0004
DevClass=0210
InqWindw=0100
PagWindw=0100
CfgTimer=60
StatuStr=NULL
***OTHER Settings***
Profile= SPP
CfgChar= $
SniffEna=0
LowPower=0
TX Power=0
IOPorts= 0
IOValues=0
DebugMod=0
RoleSwch=0
Ver 4.77 05/12/09
(c) Roving Networks
That is, I can connect and enter command mode to set it up, but I cannot pass any data as far as I can tell. I have used the following Arduino sketch (or one of several very close variants that I have seen online that, based on commends, should all be “known good” code):
int ledPin = 13;
char cmd;
void setup() {
Serial.begin(115200); // Open a connection to the Bluetooth Mate
pinMode(ledPin, OUTPUT); // Activate the LED
}
void loop() {
// Look for data coming in from the Bluetooth Mate
if (Serial.available() > 0) {
cmd = Serial.read(); // Read the character
Serial.print("Input: " + cmd); // Echo the character back
// '1' turns on the LED, '0' turns it off
if (cmd == '1') {
digitalWrite(ledPin, HIGH);
Serial.println("LED on");
} else if (cmd == '0') {
digitalWrite(ledPin, LOW);
Serial.println("LED off");
}
}
delay(20);
}
As you can see, it is supposed to read a character from the serial line (BlueSmirf) and then check whether it is a 1 or 0 and turn LED 13 off or on and print LED off or LED on, respectively, and “Input: [cmd]”. When I connect, I see nothing. I have also tried a simple sketch that merely loops and does a Serial.write(“write”); followed by a delay(5000) followed by a Serial.println(“println”); followed by another delay where it looks back to the write command. I have also tried to write single characters and even single bits. Nothing seems to make it through.
All of the COM ports are setup to match the baud rate of the BlueSmirf, currently 115200 but have tried several others all the way down to 9600 as mentioned before, with 8 data bits, no parity, 1 stop bit, and no flow control. The device is successfully paired with both my PC and Macbook Pro. Can get into command mode on both of them, but can send data on neither of them. I have also tried connecting RTS and CTS together and have connected them to the Arduino Pro Mini. I have also tried the BlueSmirf alone just to see if there would be any sort of rx/tx LED lights or anything. I have also hooked it up to an Arduino Uno and switched the ledPin to 8 instead of the onboard led 13 and hooked pin 8 up to an LED on a breadboard, but it wouldn’t light up.
I tried to do a loopback test but don’t really know how to do that and when I tried to search for it on Google I basically just came up with a bunch of people suggesting a looptest as a diagnostic step, but never explaining it at all. I connected the rx and tx together on the BlueSmirf and connected to it and it seemed to work as it did before – trying to send any data did nothing at all as far as I could tell and entering command mode and passing commands to it worked like normal. I also tried this with RTS and CTS hooked together, as well. Same result. I have connected to it while still in the 60 second command mode timer window and after that has already expired, no difference at all as far as I can tell, beside not being able to enter command mode with a ‘$$$’ command.
I have tried several “known good” examples, including the bluetooth tutorial here at SparkFun with the arduino and processing code, all to no avail. Same results. Nothing sent or received as far as I can tel.
If I missed any information, please let me know and I will be happy to provide it to you. I am so sick of banging my head against a wall on this one over the last few days and just want to move onto the rest of the development! Thank you sooo much!!