nRF24L01 connection made, but data received is all zeros

I am using the RF24.h library to program one Arduino Uno to talk to another. One Uno is the remote controller and transmits only, while the other Uno just listens. I'm testing the radio connection before proceeding further with my remote controlled hovercraft project. My receiver is saying 'Connection Made' on the serial monitor, but the data being received is all zeros. I have looked at the data transmitted to make sure that I'm not sending zeros.

Pin assignments for both nRF24L01s to both Unos:
V+ -> 3.3V
GND -> GND
CSN -> pin 10
CE -> pin 9
MOSI -> pin 11
SCK -> pin 13
IRQ -> pin 2 (may use later if I put in interrupts)
MISO -> pin 12

Transmitter (remote controller) code

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

// Define the digital inputs
//#define jB1 1  // Joystick button 1
//#define jB2 0  // Joystick button 2
#define Crane3left 7   // Toggle switch 1
#define Crane3right 8   // Toggle switch 1
#define Crane1left 3   // Button 1
#define Crane1right 4   // Button 2
#define Crane2left 5   // Button 3
#define Crane2right 6   // Button 4
float elapsedTime, currentTime, previousTime;
int c = 0;
RF24 radio(9, 10);   // nRF24L01 (CE, CSN)
const byte address[6] = "00001"; // Address
// Max size of this struct is 32 bytes - NRF24L01 buffer limit
struct Data_Package {
  byte j1PotX;
  byte j1PotY;
//  byte j1Button;
  byte liftPot;
  byte drivePot;
//  byte j2Button;
//  byte pot1;
//  byte pot2;
//  byte tSwitch1;
//  byte tSwitch2;
  byte C1L;
  byte C1R;
  byte C2L;
  byte C2R;
  byte C3L;
  byte C3R;
};
Data_Package data; //Create a variable with the above structure
void setup() {
  Serial.begin(9600);
  
  // Define the radio communication
  radio.begin();
  radio.openWritingPipe(address);
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_LOW);
  
  // Activate the Arduino internal pull-up resistors
 // pinMode(jB1, INPUT_PULLUP);
  
 // pinMode(t1, INPUT_PULLUP);

  pinMode(Crane1left, INPUT_PULLUP);
  pinMode(Crane1right, INPUT_PULLUP);
  pinMode(Crane2left, INPUT_PULLUP);
  pinMode(Crane2right, INPUT_PULLUP);
  pinMode(Crane3left, INPUT_PULLUP);
  pinMode(Crane3right, INPUT_PULLUP);
  
  // Set initial default values
  data.j1PotX = 127; // Values from 0 to 255. When Joystick is in resting position, the value is in the middle, or 127. We actually map the pot value from 0 to 1023 to 0 to 255 because that's one BYTE value
  data.j1PotY = 127;
  data.liftPot = 127;
  data.drivePot = 127;
//  data.j1Button = 1;
//  data.j2Button = 1;
//  data.pot1 = 1;
//  data.pot2 = 1;
//  data.tSwitch1 = 1;
//  data.tSwitch2 = 1;
  data.C1L = 1;
  data.C1R = 1;
  data.C2L = 1;
  data.C2R = 1;
  data.C3L = 1;
  data.C3R = 1;
}
void loop() {
  // Read all analog inputs and map them to one Byte value
//  data.j1PotX = 127; // Values from 0 to 255. When Joystick is in resting position, the value is in the middle, or 127. We actually map the pot value from 0 to 1023 to 0 to 255 because that's one BYTE value
//  data.j1PotY = 127;
//  data.liftPot = 127;
//  data.drivePot = 127;

  

  data.j1PotX = map(analogRead(A1), 0, 1023, 0, 255); // Convert the analog read value from 0 to 1023 into a BYTE value from 0 to 255
  data.j1PotY = map(analogRead(A0), 0, 1023, 0, 255);
  data.liftPot = map(analogRead(A2), 0, 1023, 0, 255);
  data.drivePot = map(analogRead(A3), 0, 1023, 0, 255);

  //data.pot1 = map(analogRead(A7), 0, 1023, 0, 255);
  //data.pot2 = map(analogRead(A6), 0, 1023, 0, 255);
  // Read all digital inputs
//  data.j1Button = digitalRead(jB1);
//  data.j2Button = digitalRead(jB2);
//  data.tSwitch2 = digitalRead(t2);
  data.C1L = digitalRead(Crane1left);
  data.C1R = digitalRead(Crane1right);
  data.C2L = digitalRead(Crane2left);
  data.C2R = digitalRead(Crane2right);
  data.C3L = digitalRead(Crane3left);
  data.C3R = digitalRead(Crane3right);
  Serial.print("\n J1 X axis:");
  Serial.print(data.j1PotX);
  Serial.print("\n J1 Y axis: ");
  Serial.print(data.j1PotY);
  Serial.print("\n Lift Pot: ");
  Serial.print(data.liftPot);
  Serial.print("\n Drive Pot: ");  
  Serial.print(data.drivePot);
  Serial.print("\n Crane 1 left: ");
  Serial.println(data.C1L); 
  Serial.print("\n Crane 1 right: ");
  Serial.println(data.C1R);
  Serial.print("\n Crane 2 left: ");
  Serial.println(data.C2L); 
  Serial.print("\n Crane 2 right: ");
  Serial.println(data.C2R);
  Serial.print("\n Crane 3 left: ");
  Serial.println(data.C3L); 
  Serial.print("\n Crane 3 right: ");
  Serial.println(data.C3R);
  
  radio.write(&data, sizeof(Data_Package));
}

Receiver (vehicle) code

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

/*
    DIY Arduino based RC Transmitter Project
              == Receiver Code ==

  by Dejan Nedelkovski, www.HowToMechatronics.com
  Library: TMRh20/RF24, https://github.com/tmrh20/RF24/
*/
RF24 radio(9, 10);   // nRF24L01 (CE, CSN)
const byte address[6] = "00001";

unsigned long lastReceiveTime = 0;
unsigned long currentTime = 0;

// Max size of this struct is 32 bytes - NRF24L01 buffer limit
struct Data_Package {
  byte j1PotX;
  byte j1PotY;
//  byte j1Button;
  byte liftPot;
  byte drivePot;
//  byte j2Button;
//  byte pot1;
//  byte pot2;
//  byte tSwitch1;
//  byte tSwitch2;
  byte C1L;
  byte C1R;
  byte C2L;
  byte C2R;
  byte C3L;
  byte C3R;
};

Data_Package data; //Create a variable with the above structure

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_LOW);
  radio.startListening(); //  Set the module as receiver
  resetData();
}
void loop() {
  // Check whether there is data to be received
  if (radio.available()) {
//    Serial.print("\n Connection made!!");
    radio.read(&data, sizeof(Data_Package)); // Read the whole data and store it into the 'data' structure
    lastReceiveTime = millis(); // At this moment we have received the data
  }
  // Check whether we keep receving data, or we have a connection between the two modules
  currentTime = millis();
  if ( currentTime - lastReceiveTime > 1000 ) { // If current time is more then 1 second since we have recived the last data, that means we have lost connection
    resetData(); // If connection is lost, reset the data. It prevents unwanted behavior, for example if a drone has a throttle up and we lose connection, it can keep flying unless we reset the values
  }
  // Print the data in the Serial Monitor
  Serial.print("\n J1 X axis: ");
  Serial.print(data.j1PotX);
  Serial.print("\n J1 Y axis: ");
  Serial.print(data.j1PotY);
  Serial.print("\n Lift Pot: ");
  Serial.print(data.liftPot);
  Serial.print("\n Drive Pot: ");  
  Serial.print(data.drivePot);
  Serial.print("\n Crane 1 left: ");
  Serial.println(data.C1L); 
  Serial.print("\n Crane 1 right: ");
  Serial.println(data.C1R);
  Serial.print("\n Crane 2 left: ");
  Serial.println(data.C2L); 
  Serial.print("\n Crane 2 right: ");
  Serial.println(data.C2R);
  Serial.print("\n Crane 3 left: ");
  Serial.println(data.C3L); 
  Serial.print("\n Crane 3 right: ");
  Serial.println(data.C3R);
}

void resetData() {
  Serial.print("Connection not made!");
  // Reset the values when there is no radio connection - Set initial default values
  data.j1PotX = 69;
  data.j1PotY = 69;
  data.liftPot = 99;
  data.drivePot = 99;
  data.C1L = 1;
  data.C1R = 1;
  data.C2L = 1;
  data.C2R = 1;
  data.C3L = 1;
  data.C3R = 1;
}

Serial Monitor output from transmitter (remote control):

J1 X axis:127
J1 Y axis: 125
Lift Pot: 254
Drive Pot: 102
Crane 1 left: 1

Crane 1 right: 1

Crane 2 left: 1

Crane 2 right: 1

Crane 3 left: 1

Crane 3 right: 1

Serial Monitor output from receiver(vehicle):

J1 X axis: 0
J1 Y axis: 0
Lift Pot: 0
Drive Pot: 0
Crane 1 left: 0

Crane 1 right: 0

Crane 2 left: 0

Crane 2 right: 0

Crane 3 left: 0

Crane 3 right: 0

Have a look at this Simple nRF24L01+ Tutorial.

Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.

The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work

...R

Robin2:
Have a look at this Simple nRF24L01+ Tutorial.

Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.

The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work

...R

Thanks for the reply! I have copied your SimpleTx.ino SimpleRx.ino and CheckConnection.ino.

Receiver Arduino/nRF24L01 pair CheckConnection output:

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

STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0x3130303030 0x4141417852
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x20 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x00
EN_RXADDR = 0x02
RF_CH = 0x4c
RF_SETUP = 0x00
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

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

Transmitter Arduino/nRF24L01 pair checkconnection output:

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

STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x4141417852
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x00 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
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

STATUS = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1 = 0xe7e7e7e7e7 0x4141417852
RX_ADDR_P2-5 = 0xc3 0xc4 0xc5 0xc6
TX_ADDR = 0xe7e7e7e7e7
RX_PW_P0-6 = 0x00 0x20 0x00 0x00 0x00 0x00
EN_AA = 0x3f
EN_RXADDR = 0x03
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

I initially uploaded the SimpleTx and SimpleRx sketches, and I was getting 'Data received' without the message # about once per second. Once I uploaded the connection checking sketch onto both, and then uploaded SimpleTx and SimpleRx again, I'm getting no connection and no acknowledgement. I am wondering if it is trying to read the wrong library? I downloaded the library suggested in your post from the website, unzipped and added it to arduino/program files/libraries but I had previously been using the RF24.h library. How do I delete it completely?

Yes, you probably do need to delete the RF24 library completely and then install the TMRh20 version.

I don't use the Arduino IDE to manage my libraries. I would delete a library by going to my libraries folder and deleting the folder in it that is called RF24

...R

It appears that one of the radio modules was not working. Good thing I bought a spare! Once I switched it out, your simpletx and simplerx code worked, the two arduinos were talking and getting numbered messages. My original code appears to be working too. Thanks for your help!