nrf24l01/DHT11 Code issues

I am not sure if this is the proper forum of if the project forum would be better, but I am assuming my issue lies in the code, hence why I am posting here.

To start I am new to all of this. I have however managed to get some aspects of my project working by piecing together some of my own code and code from examples I found. I am now trying to get the data read from the DHT11 sent via the nrf to another arduino.

My setup is an atmega328p-pu on a breadboard with internal clock running at 3.3v. This is the one getting the data from the DHT11 and sending it to an arduino uno.

When I hook everything up and run it, nothing happens, Looking at the serial monitor where my receiving arduino should be printing the data it is blank. So I was playing around and when I disconnect the DHT11 which is connected to digital pin 2 I start getting -3.00 or -2.00 as my data printed on the screen. If I hook the DHT11 back up, everything stops and I get nothing.

I will post my code below, as I am assuming there is a code error, hopefully someone can assist me, thank you in advance. Hopefully I have been clear with what I am asking.

Here is the code for the sending unit.

#include <avr/interrupt.h>
#include <avr/power.h>
#include <avr/sleep.h>
#include <avr/io.h>
#include <avr/wdt.h>
#include <idDHT11.h>
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"

RF24 radio(9,10);
float data[3];
const uint64_t pipe = 0xE8E8F0F0E1LL;
int idDHT11pin = 2; //Digital pin for comunications
int idDHT11intNumber = 0; //interrupt number (must be the one that use the previus defined pin (see table above)
//declaration
void dht11_wrapper(); // must be declared before the lib initialization
// Lib instantiate
idDHT11 DHT11(idDHT11pin,idDHT11intNumber,dht11_wrapper);

void setup()
{
  Serial.begin(9600); //opens serial portbad
  watchdogOn(); // Turn on the watch dog timer.
  pinMode(13,OUTPUT);      // set pin 13 as an output so we can use LED to monitor
  digitalWrite(13,HIGH);   // turn pin 13 LED on
  radio.begin();
  radio.openWritingPipe(pipe);
}

// This wrapper is in charge of calling 
// mus be defined like this for the lib work
void dht11_wrapper() {
  DHT11.isrCallback();
}

void sleepNow()
{
  // Choose our preferred sleep mode:
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);
  // Set sleep enable (SE) bit:
  sleep_enable();
  /* Disable all of the unused peripherals. This will reduce power
   * consumption further and, more importantly, some of these
   * peripherals may generate interrupts that will wake our Arduino from
   * sleep!
   */
  power_adc_disable();
  power_spi_disable();
  power_timer0_disable();
  power_timer2_disable();
  power_twi_disable(); 
  // Put the device to sleep:
  digitalWrite(13,LOW);
  sleep_mode();
  // Upon waking up, sketch continues from this point.
  sleep_disable();
  digitalWrite(13,HIGH);
  /* Re-enable the peripherals. */
  power_all_enable();
}
void watchdogOn() {

  // Clear the reset flag, the WDRF bit (bit 3) of MCUSR.
  MCUSR = MCUSR & B11110111;

  // Set the WDCE bit (bit 4) and the WDE bit (bit 3) 
  // of WDTCSR. The WDCE bit must be set in order to 
  // change WDE or the watchdog prescalers. Setting the 
  // WDCE bit will allow updtaes to the prescalers and 
  // WDE for 4 clock cycles then it will be reset by 
  // hardware.
  WDTCSR = WDTCSR | B00011000; 

  // Set the watchdog timeout prescaler value to 1024 K 
  // which will yeild a time-out interval of about 8.0 s.
  WDTCSR = B00100001;

  // Enable the watchdog timer interupt.
  WDTCSR = WDTCSR | B01000000;
  MCUSR = MCUSR & B11110111;

}

ISR(WDT_vect)
{
  //wdt_disable();  // disable watchdog
}

void loop()
{
  DHT11.acquire();
  while (DHT11.acquiring())
    ;
  int result = DHT11.getStatus();
  switch (result)
  {
  case IDDHTLIB_OK: 
    //Serial.println("OK"); 
    break;
  case IDDHTLIB_ERROR_CHECKSUM: 
    Serial.println("Error\n\r\tChecksum error"); 
    break;
  case IDDHTLIB_ERROR_ISR_TIMEOUT: 
    Serial.println("Error\n\r\tISR Time out error"); 
    break;
  case IDDHTLIB_ERROR_RESPONSE_TIMEOUT: 
    Serial.println("Error\n\r\tResponse time out error"); 
    break;
  case IDDHTLIB_ERROR_DATA_TIMEOUT: 
    Serial.println("Error\n\r\tData time out error"); 
    break;
  case IDDHTLIB_ERROR_ACQUIRING: 
    Serial.println("Error\n\r\tAcquiring"); 
    break;
  case IDDHTLIB_ERROR_DELTA: 
    Serial.println("Error\n\r\tDelta time to small"); 
    break;
  case IDDHTLIB_ERROR_NOTSTARTED: 
    Serial.println("Error\n\r\tNot started"); 
    break;
  default: 
    Serial.println("Unknown error"); 
    break;
  }

  int SoilMvalue = analogRead(A0); //read soil sensor value
  //Serial.println(SoilMvalue);
  SoilMvalue = map(SoilMvalue, 685, 0, 0, 100);

  Serial.print("Soil moisture: ");
  Serial.print(SoilMvalue); //print sensor value
  Serial.println("%");

  Serial.print("Humidity: ");
  Serial.print(DHT11.getHumidity(), 2);
  Serial.println("%");

  Serial.print("Temperature: ");
  Serial.print(DHT11.getCelsius(), 2);
  Serial.write(176);
  Serial.println("C");


  Serial.print("Dew Point: ");
  Serial.print(DHT11.getDewPointSlow());
  Serial.write(176);
  Serial.println("C");
  Serial.println("");
  
  data[0] = DHT11.getHumidity();
  data[1] = DHT11.getCelsius();
  data[2] = DHT11.getDewPointSlow();
  
  radio.write(data, sizeof(data));
  
  delay(1000);
  sleepNow();
}

Here is the code for the receiving unit.

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

RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
float data[3];

void setup()
{
  Serial.begin(9600); //opens serial portbad
  radio.begin();
  radio.openReadingPipe(1,pipe);
  radio.startListening();
}

void loop(void)
{
  if ( radio.available() )
  {
    // Dump the payloads until we've gotten everything
    bool done = false;
    while (!done)
    {
      // Fetch the payload, and see if this was the last one.
      done = radio.read(data, sizeof(data) );
      //Serial.println(data[0]);
      //Serial.println(data[1]);
      //Serial.println(data[1]);

    Serial.print("Humidity: ");
    Serial.print(data[0]);
    Serial.println("%");

    Serial.print("Temperature: ");
    Serial.print(data[1]);
    Serial.write(176);
    Serial.println("C");

    Serial.print("Dew Point: ");
    Serial.print(data[2]);
    Serial.write(176);
    Serial.println("C");
    Serial.println("");
    
    }
  }
  else
  {
    radio.printDetails();
    //Serial.println("No radio available");
    delay(1000);
  }
}

Ok, I managed to solve that problem, it has something to do with the library for the DHT11 or something with the code for getting the data from the DHT11. Anyway if I keep the error reporting cases in the code it works. So since it seems like that needs to be there I want it to send errors if they happen. I tried to do this by setting a value of 01 for any error and sending that to the receiving unit. If the receiving unit gets 01 then it states that there is an error. My problem now is that If I use an if else statement in the receiving code it always prints that there is an error. If I remove the if statement I get the humidity, temp etc, only occasionally getting -1 for all values, which I am assuming is an error.

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

const uint64_t pipe = 0xE8E8F0F0E1LL; 

RF24 radio(9, 10); 

float data[3];  

void setup()   
{
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(1,pipe);
  radio.startListening();

}

void loop(){

  if ( radio.available() )
  {

    bool done = false;
    while (!done) {

      done = radio.read(data, sizeof(data) );
      
      if (data[0] = 01) {
        Serial.print("DHT11 Read Error!");
        } else {
      Serial.print("Humidity: ");
      Serial.print(data[0]);
      Serial.println("%");

      Serial.print("Temperature: ");
      Serial.print(data[1]);
      Serial.write(176);
      Serial.println("C");


      Serial.print("Dew Point: ");
      Serial.print(data[2]);
      Serial.write(176);
      Serial.println("C");
      Serial.println("");
      }

    }
  }

}
if (data[0] = 01)

= != == :)

= is assignment == is a test for equality