BlueSmirf Gold complications -- Please help!

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!!

bump

bump

bump – anyone???

I have spent days on this and can’t figure out what I am doing wrong. I can’t imagine that it is the module that is dead since I can connect and send AT commands in command mode, just not any data in data mode.

Please help…

Most USA members are on holiday. Getting a reply when we are all stupefied by eating vast quantities of feathered critters is unrealistic.

I have a silver that I have been able to use to talk to a PC with a Bluetooth dongle or to a BT enabled phone. The key is the connection between the two. Sounds like your red LED stop flashing and is replaced by the green link light. This is good. Now when you send serial data to the com port at the correct baud rate, it does not show up on the other end of the comm link? What are you using? a BT phone, dongle, or another smurf?

Yes, that is correct about the LED’s – which I thought was a phenomenal sign when I first started out, before I actually tried sending any data besides ‘$$$’ or AT commands once in command mode…

I have tried with a number of different devices ranging from an ASUS USB-BT21 mini Bluetooth v2.0+EDR dongle on a Windows 7 Ultimate x86 machine to the onboard bluetooth radio in my Macbook Pro and from the onboard bluetooth radio in my HTC EVO 4G Android phone. I used TeraTerm and PuTTy with the Windows 7 machine that was using the ASUS USB dongle. I used zTerm and screen with the Macbook Pro that was using its onboard bluetooth radio. I used Amarino from the EVO, and when I get home tonight I figured that I would also install a BT Terminal app from the market and see if that helps (though, I’m sure its not that seeing as how none of the other terminal emulators work on either of the other devices).

Nothing but a ‘$$$’ or AT commands seem to make it through…

Once you get the green link light, you should be able to simply send data to the device at the baud rate you programed into the Smirf. On the receive end (assuming a dongle), you should be able to link to the smirf and open a virtual console port. When doing so, it should tell you the com port. Now open Putty or similar at that com port. I am a little fuzzy about the baud rate, but it would not hurt to open it at the same baud rate. now what you type on one end should shoe up on the other. The example I worked from came from an instructable.com entry that included a video on how to set the device IDs, baud rated, etc.

That is what I would have thought – once I get a green connect LED that it should be good to go and that the devices are connected. I have both sides set to 115200, 8 data bits, no parity, 1 stop bit, no flow control. I have also tried 9600 and 57600 with the same result – can connect and enter command mode but it won’t pass data.

I have tried sketches as simple as

char ch = 'c';

void setup() {
  Serial.begin(115200);
}

void loop() {
  Serial.write(ch);
  delay(1000);
}

and no data gets passed. I have tried it on an Arduino Uno and Arduino Pro Mini 16Mhz ATMega328 and even replaced the wires that are connecting them all on the breadboard just in case there was a bad wire (despite it being highly unlikely). In the other sketches that I used that just read from the serial line (BlueSmirf) and then set the onboard LED 13 high on the Arduino, I even changed it to digital pin 8 and tried to drive an external LED plugged into the breadboard just in case the LED was just bad on the Arduino. I even tried a different external power supply to power it all in case it was a problem with the levels of that. No luck.

I can run the sketch via a wired USB serial connection and the data is passed to the PC just fine and can send data from the PC to the Arduino to set pin 8 fine to drive an external LED and also to set pin 13 high to turn on the onboard LED fine. When I try it with the same sketch and a terminal emulator over the Smirf, though, nothing comes through. Can’t drive any LED’s or even just output data to the terminal.

Since I have replaced the wires, the Arduino’s, the power supply, the LED’s, and connecting device (PC, Mac, and Android phone) and used multiple terminal emulation programs, the only common link is the physical BlueSmirf module and the configuration of it and the connection…

I think that I might try to find that example you speak of on Instructables. I looked at another example there, but there was no video.

Finally got it working. Not sure what it was because I swear that I have tried this setup before. Must have been something else that I changed along the way and then had never tried hardware flow control since I changed whatever it was or something.

Or, perhaps it was merely having this window/connection open. I realized that it was setup with COM11 as the outgoing connection and COM12 as the incoming and all I was ever doing was connecting to it via the outgoing COM11 from either Windows or the Mac. This time I just opened up a window connecting through COM11 to send the data and then I opened up a window to monitor the data coming back on COM12. Even though this sketch doesn’t actually send any data back to me, it seems that a window/connection has to be open on the incoming COM port for it to work maybe?

I’m not sure exactly what the problem was. If I figure that out I will post back here again with what the solution was in case it helps somebody else in the future.

Thanks for the quick replies fll-freak, it actually helped a lot in getting my head around this problem and made me think of a few other things to try!

I am having the same issue. I have the bluesmirf silver and for the life of me cannot get it to talk to arduino. I’m actually wanting to use an android phone in the long run but have failed at even the simplest methods. I have tried and succeeded. At the same things you did initially. So I tried using android and I can actually view the debug logs watching my custom app using amarino lib to view a successful socket connection. But once I go to view in the serial monitor I get nothing. I’ve tried 5 different devices 2 different Bluetooth modules and 3 operating systems all with the same results. No one seems to be complaining about same thing happening to me so I think I’m going crazy. Ill try a few more things. But if any one could shed further light it would be helpful.(excuse typos trying to get help on the run ill clean up when I get home)

So I’m having a similar issue. I get the green light, but no communication. For those using Linux, I’m doing cat /dev/rfcomm0 (I know it’s the right path as I get a notification that its outputting to that path). The rate I’m using is 9600. Anyone know what’s going on? Also is there some sort of setup particular to BlueSMiRF or just have the rx tx connections and do the usual serial setup on arduino?