Why does this one line of code cause my rf12 radio to not function?

I am trying to get my Nanode Remote to send data via the RF12 radio to my Nanode Gateway. I was having problems getting it working with some onewire bus code I wrote so I tried to replicated the problem with a new bare minimum sketch.

Below is the sketch I am using. As soon as uncomment the Serial.print("Print Serial"); line in the printtemp function in the sketch below my nanode stops sending data to the gateway.

For example, if I run the sketch with the line commented out my gateway receives the value 65 just fine.
As soon as I uncomment the "Print Serial" line I stop receiving any values at the gateway.

Any ideas? Do I need some code to reactive the radio?

#include <JeeLib.h>
#include <Ports.h>
#include <PortsBMP085.h>
#include <PortsLCD.h>
#include <PortsSHT11.h>
#include <RF12.h>
#include <RF12sio.h>

#include <OneWire.h>
#include <DallasTemperature.h>
// Start of Nanode Remote code
 
// Based on the pollee code from <jc@wippler.nl>
// 2011-11-23 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php
//


/*
  RF12 Communications
*/
#define RF12_GROUPID 212    // all nodes must be a member of the same group
                                                   // to communicate with each other
#define RF12_NODEID  2         // Each node within a group must have a unique ID
 
// Definition of Data Structure used to send information from Remote to Gateway

typedef struct {
  byte node;
  long time;
  float temp;
} Payload;
 // Create an instance of this data structure
Payload mypayload;

 
//Arduino Setup code, run once after reset
void setup () {
    
     Serial.begin(9600);
  Serial.print("Remote Sensor\n");
    
  // Initialize RF12 Radio
  mypayload.node = rf12_initialize(RF12_NODEID, RF12_433MHZ, RF12_GROUPID);

}
 // main loop
void loop () {
  
  rfsend();
  printtemp();
  
  } // loop end


void rfsend ()
{
  
float temperature;
  
  // wait to be polled by Gateway
  if (rf12_recvDone() && rf12_crc == 0 && rf12_len == 0 && RF12_WANTS_ACK) {
 
    // Fill payload with current time in milliseconds
    mypayload.time = millis();
    
    temperature = 65;  // used for testing to prove radio is working
   // Fill payload with temperature info
    mypayload.temp = temperature;
     Serial.println(temperature);
 
    // start transmission
    rf12_sendStart(RF12_ACK_REPLY, &mypayload, sizeof mypayload);  
  
  }
} // rfsend end

void printtemp (void)
{
  //Serial.print("Print Serial"); //***************** activating this will stop the rf12 radio from functioning.****************
  
}

Serial.print is a blocking function: once the outbound buffer is full, subsequent prints will block until some space has opened up in the buffer.

You are printing unconditionally on every loop iteration so you can expect to be blocking most of your time.

If there's anything time critical in rfsend, there is a risk that it will be missed while you're waiting to send your text to the serial port.

A faster baud rate wouldn't be a bad idea, making the print less frequent (or dropping it entirely) might help.

Thanks for the quick answer.

Do you think this could be similar reason why I am having issues with my owewire code not working with the radio to?

http://forum.arduino.cc/index.php?topic=211190.msg1549486

Assuming that timing is your issue, then yes it could - shamelessly pasted from another thread:

Be aware that the DS18B20 takes up to 750ms to read the temperature. The arduino doesn't have to wait for it however, you can tell the sensor to read and go back later to get the result. If you use the Dallas Temperature library, there's a function setWaitForConversion that controls whether to wait or not.