RF24 radio.printDetails Halting

Hello, I have been trying to get an arduino and a raspberry pi to talk to each using the NRF24L01 chips. However, I have been having trouble on the arduino side.

I'm using RF24 Library by TMRh20 and I decided to check the chip itself to see if I can get register data from it just by using this simple script.

#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>

RF24 radio(7,8);

void setup() {
  Serial.begin(9600);

}

void loop() {
  Serial.println("This is a test");
  radio.printDetails();
  delay(1000);
}

I added the "This is a test" just to make sure I was actually printing to the serial console. However, not only does the radio.printDetails() not print anything, but the "This is a test" only prints once, implying that the radio.printDetails() manages to stop the main loop. What am I doing wring?

What am I doing wring?

Spelling words correctly? 8)

The thing that comes to mind immediately is that you failed to post a link to the non-standard library that you are using.

You COULD edit the cpp file, and add more Serial.print() statements to the method, to determine where it is failing.

My guess is that the code is failing to actually get anything from the radio. Typically, that would indicate that the radio is not connected correctly. But, you failed to describe how the radio is connected. That description should be in the form of a schematic, not a bunch of words.

Just a thought...

Try reversing the two lines

Serial.println("This is a test");
radio.printDetails();

If your assumption is true and Radio.printDetails stops everything, then "This is a test" will not appear. If it does, something else is going wrong.

Other than that, Paul is of course right, all of us are guessing without further Details.

I have never tried radio.printDetails() but it seems to use some of its own special "print" code and maybe that is not working.

Try something simple like getChannel() or getDataRate(). You can probably get all the data that print produces by using separate calls.

...R

How about using the bool begin (void)function?

It could be done by adding a  radio.begin();to setup.

And I think there was a begin function for the printf stuff too...

#include <nRF24L01.h>
#include <printf.h>
#include <RF24.h>
#include <RF24_config.h>

RF24 radio(7,8);

void setup() {
  Serial.begin(9600);
  printf_begin();
  radio.begin();

}

void loop() {
  Serial.println("This is a test");
  radio.printDetails();
  delay(1000);
}
1 Like