Rock BLOCK Iridium SBD module and BlueSMiRF causing issues together.

I am running into issues creating a passthru sketch for Bluetooth->ISBD.

I can get the BlueSMiRF pass thru to work (From Bluetooth device through ardy to Serial Monitor, and back), and I can get the ISBD module to work (From Serial Monitor through ardy to ISBD module, and back), but when I try and merge the code, the ISBD module gets stuck trying to find the modem. The funny thing is, even if I don’t actually do anything with the bluetooth, just declare and create the port, the ISBD modem still gets hung up. If I take the same code and comment out all of my bluetooth stuff, the ISBD modem works again…

Bluetooth Pass Through Stand Alone Code (this works):

#include <SoftwareSerial.h>  

int bluetoothTx = 8;  // TX-O pin of bluetooth mate, Arduino D8
int bluetoothRx = 7;  // RX-I pin of bluetooth mate, Arduino D7

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);

void setup()
{
  Serial.begin(9600);  // Begin the serial monitor at 9600bps

  bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
  bluetooth.print("$");  // Print three times individually
  bluetooth.print("$");
  bluetooth.print("$");  // Enter command mode
  delay(100);  // Short delay, wait for the Mate to send back CMD
  bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
  // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
  bluetooth.begin(9600);  // Start bluetooth serial at 9600
}

void loop()
{
  if(bluetooth.available())  // If the bluetooth sent any characters
  {
    // Send any characters the bluetooth prints to the serial monitor
    Serial.print((char)bluetooth.read());  
  }
  if(Serial.available())  // If stuff was typed in the serial monitor
  {
    // Send any characters the Serial monitor prints to the bluetooth
    bluetooth.print((char)Serial.read());
  }
  // and loop forever and ever!
}

ISBD Pass Through (Bluetooth Stuff commented out, this works, but you need the IridiumSBD.h and the IridiumSBD.cpp files. I can post them if needed):

#include <SoftwareSerial.h>
#include <IridiumSBD.h>
 
#define DIAGNOSTICS true // Change this to see diagnostics
//int bluetoothTx = 8;  // TX-O pin of bluetooth mate, Arduino D2
//int bluetoothRx = 7;  // RX-I pin of bluetooth mate, Arduino D3
int ibsdTx = 9;
int ibsdRx = 10;

//SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
SoftwareSerial IridiumSerial(ibsdRx,ibsdTx);

IridiumSBD modem(IridiumSerial);

void setup()
{
  int signalQuality = -1;

  // Start the serial ports
  Serial.begin(19200);
  //while (!Serial);
  //Setup Bluetooth
    //bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
    //bluetooth.print("$");  // Print three times individually
    //bluetooth.print("$");
    //bluetooth.print("$");  // Enter command mode
    delay(100);  // Short delay, wait for the Mate to send back CMD
    //bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
    // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
    //bluetooth.begin(9600);  // Start bluetooth serial at 19200
  
  // Setup the Iridium modem
  IridiumSerial.begin(19200);
  modem.setPowerProfile(1);
  if (modem.begin() != ISBD_SUCCESS)
  {
    Serial.println("Couldn't begin modem operations.");
    exit(0);
  }

  // Check the signal quality (optional)
  int err = modem.getSignalQuality(signalQuality);
  if (err != 0)
  {
    Serial.print("SignalQuality failed: error ");
    Serial.println(err);
    exit(1);
  }

  Serial.print("Signal quality is ");
  Serial.println(signalQuality);

  Serial.println("Enter commands terminated by Carriage Return ('\\r'):");
}

void loop()
{
  if (Serial.available())
    IridiumSerial.write(Serial.read());
  if (IridiumSerial.available())
    Serial.write(IridiumSerial.read());
}

#if DIAGNOSTICS
void ISBDConsoleCallback(IridiumSBD *device, char c)
{
  Serial.write(c);
}

void ISBDDiagsCallback(IridiumSBD *device, char c)
{
  Serial.write(c);
}
#endif

The full code that breaks it:

#include <SoftwareSerial.h>
#include <IridiumSBD.h>
 

#define DIAGNOSTICS true // Change this to see diagnostics
int bluetoothTx = 8;  // TX-O pin of bluetooth mate, Arduino D2
int bluetoothRx = 7;  // RX-I pin of bluetooth mate, Arduino D3
int ibsdTx = 9;
int ibsdRx = 10;

SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
SoftwareSerial IridiumSerial(ibsdRx,ibsdTx);

IridiumSBD modem(IridiumSerial);

void setup()
{
  int signalQuality = -1;

  // Start the serial ports
  Serial.begin(19200);
  //while (!Serial);
  //Setup Bluetooth
    bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
    bluetooth.print("$");  // Print three times individually
    bluetooth.print("$");
    bluetooth.print("$");  // Enter command mode
    delay(100);  // Short delay, wait for the Mate to send back CMD
    bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
    // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
    bluetooth.begin(9600);  // Start bluetooth serial at 19200
  
  // Setup the Iridium modem
  IridiumSerial.begin(19200);
  modem.setPowerProfile(1);
  if (modem.begin() != ISBD_SUCCESS)
  {
    bluetooth.println("Couldn't begin modem operations.");
    exit(0);
  }

  // Check the signal quality (optional)
  int err = modem.getSignalQuality(signalQuality);
  if (err != 0)
  {
    bluetooth.print("SignalQuality failed: error ");
    bluetooth.println(err);
    exit(1);
  }

  bluetooth.print("Signal quality is ");
  bluetooth.println(signalQuality);

  bluetooth.println("Enter commands terminated by Carriage Return ('\\r'):");
}

void loop()
{
  if (bluetooth.available())
    IridiumSerial.write((char)bluetooth.read());
  if (IridiumSerial.available())
    bluetooth.write((char)IridiumSerial.read());
}

#if DIAGNOSTICS
void ISBDConsoleCallback(IridiumSBD *device, char c)
{
  bluetooth.write(c);
}

void ISBDDiagsCallback(IridiumSBD *device, char c)
{
  bluetooth.write(c);
}
#endif

My first thought was the rockBLOCK wasn’t getting enough power, so I supplied it from a different source and still ran into the issue. Do you think it could be an issue with having two software serial ports, and a hardware serial port open at the same time? Would bluetooth over SPI potentially resolve this?