Gikfun Bluetooth XBee not getting "OK" ack


I've purchased the Gikfun EK1185 (Bluetooth XBee Shield) and am attempting to set up a Bluetooth connection. However, when I attempt to adapt online XBee code to send Bluetooth commands over serial, I can't even get an OK response to the very first command:

/* RX and TX pins */
#define RxD 2
#define TxD 3

/* XBee shield */
SoftwareSerial btSerial(RxD, TxD);

/* Wait for an "OK" response */
void waitOK()
  /* Keep reading until we get "OK" */
  char a, b;
    if (btSerial.available())
      a =;

      if (a == 'O')
        while (btSerial.available())
          b =;

        if (b == 'K') break;

  /* Receive all other response chars */
  while ( (a = != -1);

/* Send a BT command */
void sendBtCommand(char command[])


/* Initialize the Bluetooth */
void initBt()
  /* Set up the serial connection to the shield at 9600 baud */
  pinMode(RxD, INPUT);
  pinMode(TxD, OUTPUT);

  Serial.print("Set up btSerial\n");

  /* Perform the init commands */

  Serial.print("Done initBt()\n");

/********************* Arduino code *********************/

/* One-time setup */
void setup()
  /* Set up the debugging serial */
  /* Initialize the LED */

  /* Initialize the Bluetooth connection */

/* Main loop - blink */
void loop()

It prints "Set up btSerial" over the console, but it never gets to "Done initBt()" and it never starts flashing the LED. Upon removing the sendBtCommand() call that sends STWMOD, all the messages are printed and the LED starts flashing. So evidently, the issue is that an "OK" never arrives in response to my command.

Unfortunately, Gikfun provides no documentation on what pins to use for RX/TX. I tried 0/1, 2/3 (current setting), and 11/12, all with no success. I've also tried different bauds of 38400 (what was in the online XBee code) and 9600 (current setting), since they offer no info on that either.

Does anyone have an idea of why the "OK" response wouldn't arrive, or suggestions on how to debug this?

As an update, I've noticed that when I use pins 0/1 for RX/TX, any data that I send to the RX is echoed back by TX. This does not happen for other pins I try.