RF24 not working on 1.6.7, works fine on 1.0.6

I have two, nRF24L01 on breadboards, each connected to an Uno, and both behave in exactly the same way.

The problem is not communication between them, it is between the library and the nRF24L01. I'm quite sure the issue is compatibility between the latest IDE and the library because I tried an identical setup on a Windows 7 pc running 1.0.6, and the parameters were displayed the first time the GettingStarted sketch was run. Nothing is displayed on either of two computers running 1.6.7, when the same sketch is run.

This is the library I'm using: https://github.com/TMRh20/RF24.git

I'm not sure where to go from here. Thanks in advance for any help you can give.

It would be easier to understand a problem with the different IDEs if it failed to compile with one version.

Post the code you are actually using.
And please use the code button </> so your code looks like this and is easy to copy to a text editor

…R

Thanks. I’m testing with the GettingStarted sketch included with the library. Only the pin assignments are changed from 7,8, to 9,10.

/*
* Getting Started example sketch for nRF24L01+ radios
* This is a very basic example of how to send data from one node to another
* Updated: Dec 2014 by TMRh20
*/

#include <SPI.h>
#include "RF24.h"

/****************** User Config ***************************/
/***      Set this radio as radio number 0 or 1         ***/
bool radioNumber = 0;

/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 7 & 8 */
RF24 radio(7,8);
/**********************************************************/

byte addresses[][6] = {"1Node","2Node"};

// Used to control whether this node is sending or receiving
bool role = 0;

void setup() {
  Serial.begin(115200);
  Serial.println(F("RF24/examples/GettingStarted"));
  Serial.println(F("*** PRESS 'T' to begin transmitting to the other node"));
  
  radio.begin();

  // Set the PA Level low to prevent power supply related issues since this is a
 // getting_started sketch, and the likelihood of close proximity of the devices. RF24_PA_MAX is default.
  radio.setPALevel(RF24_PA_LOW);
  
  // Open a writing and reading pipe on each radio, with opposite addresses
  if(radioNumber){
    radio.openWritingPipe(addresses[1]);
    radio.openReadingPipe(1,addresses[0]);
  }else{
    radio.openWritingPipe(addresses[0]);
    radio.openReadingPipe(1,addresses[1]);
  }
  
  // Start the radio listening for data
  radio.startListening();
}

void loop() {
  
  
/****************** Ping Out Role ***************************/  
if (role == 1)  {
    
    radio.stopListening();                                    // First, stop listening so we can talk.
    
    
    Serial.println(F("Now sending"));

    unsigned long time = micros();                             // Take the time, and send it.  This will block until complete
     if (!radio.write( &time, sizeof(unsigned long) )){
       Serial.println(F("failed"));
     }
        
    radio.startListening();                                    // Now, continue listening
    
    unsigned long started_waiting_at = micros();               // Set up a timeout period, get the current microseconds
    boolean timeout = false;                                   // Set up a variable to indicate if a response was received or not
    
    while ( ! radio.available() ){                             // While nothing is received
      if (micros() - started_waiting_at > 200000 ){            // If waited longer than 200ms, indicate timeout and exit while loop
          timeout = true;
          break;
      }      
    }
        
    if ( timeout ){                                             // Describe the results
        Serial.println(F("Failed, response timed out."));
    }else{
        unsigned long got_time;                                 // Grab the response, compare, and send to debugging spew
        radio.read( &got_time, sizeof(unsigned long) );
        unsigned long time = micros();
        
        // Spew it
        Serial.print(F("Sent "));
        Serial.print(time);
        Serial.print(F(", Got response "));
        Serial.print(got_time);
        Serial.print(F(", Round-trip delay "));
        Serial.print(time-got_time);
        Serial.println(F(" microseconds"));
    }

    // Try again 1s later
    delay(1000);
  }



/****************** Pong Back Role ***************************/

  if ( role == 0 )
  {
    unsigned long got_time;
    
    if( radio.available()){
                                                                    // Variable for the received timestamp
      while (radio.available()) {                                   // While there is data ready
        radio.read( &got_time, sizeof(unsigned long) );             // Get the payload
      }
     
      radio.stopListening();                                        // First, stop listening so we can talk   
      radio.write( &got_time, sizeof(unsigned long) );              // Send the final one back.      
      radio.startListening();                                       // Now, resume listening so we catch the next packets.     
      Serial.print(F("Sent response "));
      Serial.println(got_time);  
   }
 }




/****************** Change Roles via Serial Commands ***************************/

  if ( Serial.available() )
  {
    char c = toupper(Serial.read());
    if ( c == 'T' && role == 0 ){      
      Serial.println(F("*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK"));
      role = 1;                  // Become the primary transmitter (ping out)
    
   }else
    if ( c == 'R' && role == 1 ){
      Serial.println(F("*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK"));      
       role = 0;                // Become the primary receiver (pong back)
       radio.startListening();
       
    }
  }


} // Loop

I wonder if I mis-understood your Original Post.

I was assuming that you get different behaviour if the program is uploaded using IDE 1.6.7 rather than IDE 1.0.6.

However now I am wondering if you mean that the program (I don't know which version was used to upload it) displays properly in the Serial Monitor when the breadboard is connected to a PC using IDE 1.0.6 but does not display properly when the breadboard is connected to a different PC using IDE 1.6.7 - without uploading any new program to the breadboard between changes of PC.

Please confirm exactly what the problem is.

If that interpretation is correct the issue has something to do with the PCs rather than the Arduino program.

You could try using the program with a different monitor program - for example puTTY.

...R

Sorry I was not clear. Using 1.0.6 and Windows 7, everything works. When the sketch is run and the serial monitor is started, information for the rf module is displayed in the serial monitor.

Using Windows 10 and 1.6.7 on a desktop and also on a laptop, there is no communication between the RF24 library/sketch and the nRF24L01 modules. I'm using two shields that I wired identically, one for each Uno, both work on 1.0.6, and I switched shields and rf modules, trying different combinations on both PCs running 1.6.7. The only change to the sketch is the pin numbers, CE is 9, and CSN is 10.

Thanks again.

I am still confused in the way I was when I wrote Reply #3

You are not making it clear which version of the IDE you used to upload the code.

You can “Us[e] Windows 10 and 1.6.7 on a desktop and also on a laptop” without necessarily uploading the code with that version of the IDE.

There is no reason that I am aware of why code uploaded with 1.0.6 should not display properly on the Serial Monitor in the 1.6.7 IDE (or vice versa).

I am not familiar with Windows (I use Linux) and it may be possible that Windows 10 needs something to allow it to communicate with the Arduino, whereas Windows 7 did not.

…R

Both the Windows 10 PC and laptop have 1.6.7 installed, and I've been using that and previous versions of 1.6x to develop an application and successfully upload sketches to the Uno, and also to a 1284P board using the Skinny Bob/Bobuino core. No issues with uploading or using that environment, so far.

The RF24, GettingStarted sketch uploads and runs with no issues on both environments. At some point a method, printDetails() is called, and a variety of parameters should be displayed when the serial monitor is opened. This works in 1.0.6, but not in 1.6.7. Sorry I was not clear about this.

I did install 1.6.7 on the older, Windows 7 PC, and the sketch did not display the RF parameters. Going back to 1.0.6, it again did display the parameters.

Try to narrow down the problem area.

What happens if you upload the sketch to the modules using the 1.0.6 IDE and then open the serial monitor, (without uploading) using the 1.6.7 IDE?

Sorry, I was wrong about this. The 1.0.6 version was using the original RF24 library here: https://github.com/maniacbug/RF24 When compiled on 1.0.6, it runs and communicates between both Arduinos, on 1.0.6 and 1.6.7.

The new, updated version here, does not work when compiled on either 1.0.6 or 1.6.7 and run on either serial monitor: https://github.com/TMRh20/RF24

So this is "solved"?

The original library is superceded by the TMRh20 version and hasn't been updated for several years, but until the issue is resolved, I'll use it. Also, I'd like to do something with the ATI tiny and only the TMRh20 version supports that processor.

MitchSF: Sorry, I was wrong about this. The 1.0.6 version was using the original RF24 library here: https://github.com/maniacbug/RF24 When compiled on 1.0.6, it runs and communicates between both Arduinos, on 1.0.6 and 1.6.7.

The new, updated version here, does not work when compiled on either 1.0.6 or 1.6.7 and run on either serial monitor: https://github.com/TMRh20/RF24

Finally, the important details emerge. :) My Reply #3 was relevant :) :)

...R

True, but the original issue remains. Hopefully someone else will compile the TMRh20 version with 1.6.7 to see if they can duplicate the problem.

I can confirm that tmrh20's fork not working on my 1.6.7/Win7x64, but original maniacbug's library works ok. At least I can see the normal output of radio.printDetails(). :)

Solutions are welcome.

Oops, tmrh20 explained this issue here: https://github.com/TMRh20/RF24/issues/189 So I tried pingpair_ack and radio.printDetails() works there ok!