First time using nRF24L01 (having issues) - [solved]

So after years of these things sitting around.. I finally decided to play with them (and test for possible use in a current project)

I am following @Robin2 's guide.

Specific code used here: (verbatim, no changes)

I am doing the 2-way comm test first.. before I look into the 'AckPayload' approach

I copied the code verbatim (didnt change a thing)..

and I believe my wiring is all correct as well:

Arduino | nRF24L01

MISO D12 - MISO 7
SCK D13 - SCK 5
CE D9 - CE 3
GND - GND 1
MOSI D11 - MOSI 6
CSN D10 - CSN 4
+3.3v - VCC 2

MasterSwapRoles Starting
Data Sent Message 0 Tx failed
Data Sent Message 0 Tx failed
.......

What am I missing here? (and how can I debug better?)

Perhaps my wiring? (images linked to below)

Thanks...

Post code and wiring according to the topic "How to use this Forum".

Robin2 has program to test the connection between the Arduino and radio (wiring) on the second page of the tutorial.

// 18 Mar 2018 - simple program to verify connection between Arduino
//      and nRF24L01+
//  This program does NOT attempt any communication with another nRF24

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

#include <printf.h>

#define CE_PIN   9
#define CSN_PIN 10

const byte thisSlaveAddress[5] = {'R','x','A','A','A'};

RF24 radio(CE_PIN, CSN_PIN);

char dataReceived[10]; // this must match dataToSend in the TX
bool newData = false;


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

    Serial.println("CheckConnection Starting");
    Serial.println();
    Serial.println("FIRST WITH THE DEFAULT ADDRESSES after power on");
    Serial.println("  Note that RF24 does NOT reset when Arduino resets - only when power is removed");
    Serial.println("  If the numbers are mostly 0x00 or 0xff it means that the Arduino is not");
    Serial.println("     communicating with the nRF24");
    Serial.println();
    radio.begin();
    radio.printDetails();
    Serial.println();
    Serial.println();
    Serial.println("AND NOW WITH ADDRESS AAAxR  0x41 41 41 78 52   ON P1");
    Serial.println(" and 250KBPS data rate");
    Serial.println();
    radio.openReadingPipe(1, thisSlaveAddress);
    radio.setDataRate( RF24_250KBPS );
    radio.printDetails();
    Serial.println();
    Serial.println();
}


void loop() {

}

I already posted the code:

verbatim!

And you want a picture of the wiring? (followed the same as the wiring diagrams posted by Robin2.. and posted the pin to pin connections already as well.(

but if you think an image is going to somehow help.. I'll post that too

groundFungus:
Robin2 has program to test the connection between the Arduino and radio (wiring) on the second page of the tutorial.

@groundFungus
thanks..
I dont see page #2?
Are you referring to this post?

I see your update.. :slight_smile:

I'll give it a shot!
thanks!

The Robin2 code does most definetly work.

So do appreciate the problem your asking the forum to solve, is to work out what exactly you are doing that is different.

Results:

CheckConnection Starting

FIRST WITH THE DEFAULT ADDRESSES after power on
  Note that RF24 does NOT reset when Arduino resets - only when power is removed
  If the numbers are mostly 0x00 or 0xff it means that the Arduino is not
     communicating with the nRF24

SPI Speedz     = 10 Mhz
STATUS         = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0x4141417852 0x4141417852
RX_ADDR_P2-5     = 0xc3 0xc4 0xc5 0xc6
TX_ADDR         = 0x4141417852
RX_PW_P0-6     = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA         = 0x3f
EN_RXADDR     = 0x02
RF_CH         = 0x4c
RF_SETUP     = 0x01
CONFIG         = 0x0e
DYNPD/FEATURE     = 0x00 0x00
Data Rate     = 1MBPS
Model         = nRF24L01+
CRC Length     = 16 bits
PA Power     = PA_MIN


AND NOW WITH ADDRESS AAAxR  0x41 41 41 78 52   ON P1
 and 250KBPS data rate

SPI Speedz     = 10 Mhz
STATUS         = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1     = 0x4141417852 0x4141417852
RX_ADDR_P2-5     = 0xc3 0xc4 0xc5 0xc6
TX_ADDR         = 0x4141417852
RX_PW_P0-6     = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA         = 0x3f
EN_RXADDR     = 0x02
RF_CH         = 0x4c
RF_SETUP     = 0x21
CONFIG         = 0x0e
DYNPD/FEATURE     = 0x00 0x00
Data Rate     = 250KBPS
Model         = nRF24L01+
CRC Length     = 16 bits
PA Power     = PA_MIN

xl97:
I already posted the code:
https://forum.arduino.cc/index.php?topic=421081.msg2899629#msg2899629

verbatim!

And you want a picture of the wiring? (followed the same as the wiring diagrams posted by Robin2.. and posted the pin to pin connections already as well.(

but if you think an image is going to somehow help.. I'll post that too

How would anybody know about code posted elseware?
The Shakespeare type of wiring has the weakness that they don't tell all the rest, missing connections, power supplies etc.

I don't spend time on detective work to collect information. That's Your job.

srnet:
The Robin2 code does most definetly work.

So do appreciate the problem your asking the forum to solve, is to work out what exactly you are doing that is different.

I agree its something I'm doing.. (hence the comment what am I missing here?)
I double check the wiring.. but maybe my eyes are just glazing over it again and again?
Here is the UNO wiring..



Railroader:
How would anybody know about code posted elseware?
The Shakespeare type of wiring has the weakness that they don't tell all the rest, missing connections, power supplies etc.

I don't spend time on detective work to collect information. That's Your job.

Did you bother to even click the link? It was a DIRECT link to the CODE used in the specific post. No guessing.. No detective work. Just click the link.. look at the code that was used *(verbatim, no changes)
How would you know? (because I provided a LINK to the code for you????)

A lot of problems with those radios is that they can need more current than the Uno 3.3V regulator can provide.

From the tutorial:

Powering the nRF24L01+ module
The nRF24 modules require a 3.3v power supply. Be careful NOT to connect the VCC pin to a 5v power supply. I have found that they work satisfactorily when connected to the 3.3v pin on my Unos.

It is recommended to plce a 10µF capacitor across VCC and GND as near to the module as possible and I have found this essential when I made some units with an Atmega328 chip on a breadboard. The capacitor stabilizes the power supply for the module. However I have not found it necessary to use a capacitor with my Uno (or Mega). But if you believe you have followed all the other instructions correctly and are having problems it would certainly be a good idea to install a capacitor.

Why click on links when Forum has a function showing the code directly?
Convienient for You, inconvienent for me and no helping replies from me....
Your choice.

@groundFungus

THanks.. I can add a cap..

does the 'test' results mean anything to you?

"If the numbers are mostly 0x00 or 0xff it means that the Arduino is not communicating with the nRF24"

I see this jumping out at me in the results:

RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
DYNPD/FEATURE = 0x00 0x00

First line.. has me thinking my my wire connected to PIN 11? (nRF24L01 pin 6?) is having an issue?

I added the cap.... should I run the TEST again? or try the comm between two arduinos again?

Railroader:
Why click on links when Forum has a function showing the code directly?
Convienient for You, inconvienent for me and no helping replies from me....
Your choice.

It was done on purpose to leave all the rest of the info in the tutorial as context. (thats alot to copy over when it already exists)..
If clicking a link is too much effort.. so be it. Appreciate your.....comments?

Either way its all appreciated. Guess I'll gave to do better next time and post everything here.

Thanks!

@groundFungus

karma points for suggesting to re-look at the power issues.

I had added a cap.. didnt work..

After revisiting it.. and using my benchtop PSU.. I noticed the cap was a little 'loose' in the female wire ends..

so I used a different and a dedicated PSU +3.3v to test with..

Test data is coming through on each increment/cycle..

thanks again!

I use a dedicated LM1117 3.3 for each of my radios. Have not had any trouble since I started doing so.

@xl97, let’s start over and see if a systematic approach can solve this problem.

First thing … What Arduno boards are you using?

Second thing … Are you using the low-power nRF24 modules (with PCB antenna) or the high-power modules (with external antenna) ?

Third thing - post the results of the connection test program for BOTH of your Arduinos.

…R

@Robin2

*to be clear.. BOTH Arduinos are working (Nano and Uno), using your 2-way comm example(s).. :slight_smile: (thanks for those)

1.) Uno and Nano (clone)

2.) Low powered (PCB antenna)

3.) Here are the results from both boards:

UNO results:

CheckConnection Starting

FIRST WITH THE DEFAULT ADDRESSES after power on
Note that RF24 does NOT reset when Arduino resets - only when power is removed
If the numbers are mostly 0x00 or 0xff it means that the Arduino is not
communicating with the nRF24

SPI Speedz = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x4141417852 0x4141417852
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x4141417852
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x07
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate

SPI Speedz = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x4141417852 0x4141417852
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x4141417852
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x27
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX


Nano Results:

CheckConnection Starting

FIRST WITH THE DEFAULT ADDRESSES after power on
Note that RF24 does NOT reset when Arduino resets - only when power is removed
If the numbers are mostly 0x00 or 0xff it means that the Arduino is not
communicating with the nRF24

SPI Speedz = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x6161615854 0x4141417852
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x6161615854
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x07
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 1MBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

AND NOW WITH ADDRESS AAAxR 0x41 41 41 78 52 ON P1
and 250KBPS data rate

SPI Speedz = 10 Mhz
STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x6161615854 0x4141417852
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0x6161615854
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x27
CONFIG = 0x0e
DYNPD/FEATURE = 0x00 0x00
Data Rate = 250KBPS
Model = nRF24L01+
CRC Length = 16 bits
PA Power = PA_MAX

xl97:
*to be clear.. BOTH Arduinos are working (Nano and Uno), using your 2-way comm example(s).. :slight_smile: (thanks for those)

So what exactly is the problem?

...R

The problem was insufficient 3.3V power. See reply #14.