NRF24L01+ Fails to send, but is receiving fine! (Using RF24Network lib)

Hi there.

I'm stuck on a problem. Here is the scenario:
1 Mega 2560 acting as the main node of the network (node 00)
4 Pro Mini 5v with 328 uC, acting as nodes 01, 02, 03 and 04. (Currently i'm testing it with only node 01, as i didnt assembled the other nodes yet)

Project Goal: Control an Cargo Elevator with 4 stops .
=> 1 wireless device on each floor with one 7-seg display and 4 buttons switch.

Problem: The Pro Mini is failing 99% of the times it tries to send a packet to the Main node, in the other hand, the main node achieved a success rate of 98% when sending packets to the Pro Mini. Guess a hardware problem may be ruled out here.

Note: This is work in progress, on early stages of development, its lacking of polishment and optimizations on code.

Mega 2560 (Main Node) Code:

/*
   Elevator Control
 by: Luiz A. Tessarolli
 Aug. 2013
 */
//Imports
#include <SPI.h>                 // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>

#include <RF24Network.h>
#include <RF24Network_config.h>
#include <Sync.h>
#include "printf.h"

//Variables Declarations
#define NODE_COUNT 2
int Floor=-1;     //Holds the floor the elevator cart is in
byte Door[4] = {
  0};   //Gets/Sets the floor elevator door status, 1 = open, 0 = closed
byte Call[4] = {
  0}; //Holds elevator calls

byte ComDesce = 30;  //Pino Comando Descer
byte ComSobe = 31;   //Pino Comando Subir
byte Status;    //Gets/Sets the current elevator status
const byte STOPPED = 0;  //Elevator is not moving, everything if ok, ready to move
const byte UP = 1;       //Elevator is going up
const byte DOWN = 2;     //Elevator is going down
const byte DOOROPEN = 3; //Elevator door is open
const byte WAITING = 4;  //Elevator is waiting for current action to finish
const byte INITIALIZATION = 5; //Elevator is on initialization state, on this state it will go down until it hits a level sensor (Floor <> -1)
const byte UNK = 99;     //Elevator is in an Unknown (Error) State

const byte interval = 500;
unsigned long last;
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(10,10,0,177);
EthernetServer server(80);

// nRF24L01(+) radio attached to SPI and pins 49 & 53
RF24 radio(49,53);

// Network uses that radio
RF24Network network(radio);
// Address of the main node
const uint16_t this_node = 00;

// Address of the others nodes
const uint16_t node[4]={
  01,02,03,04};

// Structure of our packets
struct pkt_rx //Gets the sensors and buttons state from nodes
{
  uint16_t node;   //Node Address
  byte Door;        //Door Open Sensor
  byte Floor;       //Floor Level Sensor
  byte Btn[4];      //Button Press
};

struct pkt_tx  //Sends Data to Nodes
{
  uint16_t node;     //Node Destination
  byte Chamou[4];     //Holds elevators Calls
  byte DoorOpen[4];   //For blinking led buttons
  byte Floor;         //Current Floor Number for 7seg display
  byte UnlockDoor;    //Signal to unlock the door
};

//Initialization
void setup(){
  pinMode(ComDesce, OUTPUT);
  pinMode(ComSobe, OUTPUT);
  Floor = -1;  //Inicializa com Floor = -1
  Stop(); //Certifica que elevador esta parado.
  Status = INITIALIZATION;

  Serial.begin(57600);
  Ethernet.begin(mac, ip);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
  printf_begin();
  SPI.begin();
  radio.begin();
  network.begin(/*channel*/ 57, /*node address*/ this_node);
  radio.printDetails();
  /*
  while (Floor == -1){
   wireless();
   checkDoors();
   Floor = getCurrentFloor();
   Desce(-1);
   debug();
   delay(1);
   }
   */
}

//Main Loop
void loop(){
  wireless();
  ethernet();
  navigate();
  debug();
  delay(1);
}

//User Functions
void wireless(){
  // Pump the network regularly
  network.update();
  // Is there anything ready for us?
  while ( network.available() )
  {
    // If so, grab it and print it out
    RF24NetworkHeader header;
    pkt_rx msg;
    network.read(header,&msg,sizeof(msg));
    /*
    uint16_t node;   //Node Address
    byte Door;        //Door Open Sensor
    byte Floor;       //Floor Level Sensor
    byte Btn[4];      //Button Press
    */
    Door[msg.node-1]=msg.Door;
    if (msg.Floor==1) //Sets Floor Level Variable
      Floor = msg.node-1;
    for (int i=0;i<4;i++){
      if (msg.Btn[i]==1) Call[i]==1;
    }  
    Serial.println("Received packet: ");
    Serial.print("Node: ");
    Serial.println(msg.node);
    Serial.print("Door: ");
    Serial.println(msg.Door);
    Serial.print("Floor: ");
    Serial.println(msg.Floor);
    Serial.print("Buttons: {");
    Serial.print(msg.Btn[0]); 
    Serial.print(",");
    Serial.print(msg.Btn[1]); 
    Serial.print(",");
    Serial.print(msg.Btn[2]); 
    Serial.print(",");
    Serial.print(msg.Btn[3]); 
    Serial.println("}");
    Serial.println();
    //digitalWrite(13, HIGH);

  }

  if (millis() - last > interval){
    //send packet to mobiles
    last = millis();
    /* uint16_t node;     //Node Destination
     int Chamou[4];     //Holds elevators Calls
     int DoorOpen[4];   //For blinking led buttons
     int Floor;         //Current Floor Number for 7seg display
     int UnlockDoor;    //Signal to unlock the door
     */
    for (int i=1; i<=NODE_COUNT; i++){
      byte DoorUnlock=0;
      if (Status == STOPPED && Floor==i-1) DoorUnlock=1;
      Serial.print("Sending node 0"); Serial.print(i);Serial.print("...");
      pkt_tx msg = { 
        node[i-1], {Call[0],Call[1],Call[2],Call[3]}, {Door[0],Door[1],Door[2],Door[3]}, Floor, DoorUnlock };
      RF24NetworkHeader header(/*to node*/ node[i-1]);
      bool ok = network.write(header,&msg,sizeof(msg));
      if (ok)
        Serial.println("ok.");
      else
        Serial.println("failed.");
    }
  }
}

void debug(){
  if (millis() % 2000 == 0){
    Serial.print("Floor: ");
    Serial.print(Floor, DEC);
    Serial.print(" Status: ");
    Serial.println(Status, DEC); 
  }
}

//Executa comando para elevador Subir
void Sobe(int destFloor){
  //Status = WAITING;
  if (destFloor >= Floor){ //Se o andar de destino for maior ou igual ao andar atual, nao faz nada
    Stop(); //para o elevador
    return;
  }
  if (Status == DOOROPEN){ //Se a porta estiver aberta Para o elevador
    Stop();
    return;
  }
  digitalWrite(ComSobe, HIGH);
  Status = DOWN;
  if (Floor = destFloor)
    Stop();
}

//Executa comando para elevador Descer
void Desce(int destFloor){
  //Status = WAITING;
  if (Floor <= destFloor && destFloor > -1){ //Se for -1 é para localizar o elevador. Nao da para descer nestas condicoes
    Stop();
    return;
  }
  if (Status == DOOROPEN){ //Se a porta estiver aberta Para o elevador
    Stop();
    return;
  }
  if (Status != DOOROPEN){
    digitalWrite(ComDesce, HIGH);
    Status = DOWN;
  }

  if (destFloor == -1){ //Procura andar mais proximo
    if (Floor > -1) //encontrou
      Stop();
  }
  else{ //Operação normal
    if (Floor == destFloor) //chegou no andar desejado
      Stop();
  }
}



void navigate(){
  Status = STOPPED;
  boolean door=false;
  for (int i=0;i<4;i++){
    if (Door[i]) door=true;
  }
  if (door) Status=DOOROPEN;
  for (int i=1;i<=NODE_COUNT;i++){
    if (Call[i]==1){
      if (i>Floor)
        Sobe(i);
      else if (i<Floor)
        Desce(i);
    }
  }  
}


//Stop the Elevator
void Stop(){
  if (Status!=DOOROPEN)
    Status = STOPPED;
  digitalWrite(ComDesce, LOW);
  digitalWrite(ComSobe, LOW);
}

String buffer;
int i;

void ethernet(){
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    buffer="";
    Serial.println("new client");
    while (client.connected()) {

      if (client.available()) {
        char c = client.read();
        //Serial.print(c);
        if (c=='*'){
          //buffer[i] = '\0';
          Serial.println(buffer);
          if (buffer=="st"){
            client.print(millis());
          }
          else{
            client.print(0);
          }
          client.stop();
        }
        else{   
          buffer += c;
          //Serial.print(buffer);
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
    Serial.println("\nclient disonnected");
  }
}

Pro Mini Code (Wireless Pads):

/*
   Elevator Control
 by: Luiz A. Tessarolli
 Aug. 2013
 */

#include <SPI.h>

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

#include <RF24Network.h>
#include <RF24Network_config.h>
#include <Sync.h>
#include "printf.h"




//Variables Declarations
byte Floor;     //Holds the floor the elevator cart is in
byte DoorSensor = A7; //Holds the Port Numbers for the door sensors
byte FloorSensor = A6; //Holds the Port Numbers for the level sensors
byte DoorUnlock = A4;
byte Chamou[4] = {0};  //Holds elevator calls
byte DoorOpen[4] = {0};
byte BtnPin = A5;            //Holds Analog Input Pin for Buttons Presses using R2R Ladder
byte Btn[4] = {0}; //Holds Call Buttons state
byte BtnLed[4] = {
  A3, A2, A1, A1};  //Holds the Port Numbers for the Call Buttons LEDs
byte Display[7] = {
  2,3,4,5,6,7,8};




// nRF24L01(+) radio attached to SPI and pins 8 & 9
RF24 radio(9,10);

// Network uses that radio
RF24Network network(radio);
// Address of our node
const uint16_t this_node = 01;

// Address of the main node
const uint16_t main_node = 00;


// How often to send pkt_tx to main node
const unsigned long interval = 250; //ms

// When did we last send?
unsigned long last_sent;

// How many have we sent already
unsigned long packets_sent;

// Structure of our packets
struct pkt_tx //Sends the sensors and buttons state to main node
{
  uint16_t node;   //This Node Address
  byte Door;        //Door Open Sensor
  byte Floor;       //Floor Level Sensor
  byte Btn[4];      //Button Press
};

struct pkt_rx  //Gets Data From Main Node
{
  uint16_t node;     //Node Destination
  byte Chamou[4];     //Holds elevators Calls
  byte DoorOpen[4];   //For blinking led buttons
  byte Floor;         //Current Floor Number for 7seg display
  byte UnlockDoor;    //Signal to unlock the door
};
//Initialization
void setup(){
  for (byte i=0; i<4; i++) {
    //pinMode(Btn[i], INPUT);
    pinMode(BtnLed[i], OUTPUT);
  }
  pinMode(DoorSensor, INPUT_PULLUP);
  pinMode(FloorSensor, INPUT_PULLUP);
  pinMode(DoorUnlock, OUTPUT);  
  pinMode(Display[0], OUTPUT);
  pinMode(Display[1], OUTPUT);
  pinMode(Display[2], OUTPUT);
  pinMode(Display[3], OUTPUT);
  pinMode(Display[4], OUTPUT);
  pinMode(Display[5], OUTPUT);
  pinMode(Display[6], OUTPUT);
  pinMode(BtnPin, INPUT);
  Serial.begin(57600);
  printf_begin();
  SPI.begin();
  radio.begin();
  network.begin(/*channel*/ 57, /*node address*/ this_node);
  radio.printDetails();
}

//Main Loop
void loop(){
  buttons();
  sensors();
  wireless();
  delay(1);
}

//User Functions
void sensors(){
  for (byte i=0;i<4;i++){
    if (DoorOpen[i]) 
      pisca(i);
    else
      digitalWrite(BtnLed[i],Chamou[i]);
  }
}
unsigned long last[4]={0};
void pisca(byte btn){
  unsigned long current = millis();
  if (current - last[btn] >= 300){
    last[btn]=current;
    digitalWrite(BtnLed[btn], !digitalRead(BtnLed[btn]));
  }
}
void wireless(){

  // Pump the network regularly
  network.update();

  // Is there anything ready for us?
  while ( network.available() )
  {
    // If so, grab it and print it out
    RF24NetworkHeader header;
    pkt_rx msg;
    network.read(header,&msg,sizeof(msg));
    /*
    uint16_t node;     //Node Destination
    byte Chamou[4];     //Holds elevators Calls
    byte DoorOpen[4];   //For blinking led buttons
    byte Floor;         //Current Floor Number for 7seg display
    byte UnlockDoor;    //Signal to unlock the door
    */
    Serial.print("Received! ");
    if (msg.node==this_node){
      //process the received packet
      Numero(msg.Floor);
      digitalWrite(DoorUnlock, msg.UnlockDoor);
      for (int i=0;i<4;i++){
        Chamou[i]=msg.Chamou[i];
        DoorOpen[i]=msg.DoorOpen[i];
      }
    }
    //Serial.println(msg);
  }

  // If it's time to send a message, send it!
  unsigned long now = millis();
  if ( now - last_sent >= interval  )
  {
    last_sent = now;

    Serial.print("Sending...");
    pkt_tx msg = { 
      this_node, AnalogToBinary(analogRead(DoorSensor)), AnalogToBinary(analogRead(FloorSensor)), {
        Btn[0],Btn[1],Btn[2],Btn[3]            }
    };
  
    RF24NetworkHeader header(/*to node*/ main_node);
    bool ok = network.write(header,&msg,sizeof(msg));
    if (ok)
      Serial.println("ok.");
    else
      Serial.println("failed.");
  }
}
int AnalogToBinary(int Value){
  if (Value > 500)
    return 1;
  else
    return 0;
}



//Updates The Btn Array with corresponding values
void buttons(){
  unsigned long value=0;
  int k = 50;
  while(k--)
    value += analogRead(BtnPin);
  //Serial.println(value, HEX);
  value = ( value / 49);
  //Serial.println(value);//Serial.print("/1006="); Serial.println((float)value/1006);
  Btn[0]=0;
  Btn[1]=0;
  Btn[2]=0;
  Btn[3]=0;
  //Serial.print(value);Serial.print("/515="); Serial.println((float)value/515);
  if (value>=510 && value<=530)
    Btn[0]=1;
  //Serial.print(value);Serial.print("/422="); Serial.println((float)value/422);
  if (value>=440 && value<=470)
    Btn[1]=1;
  //Serial.print(value);Serial.print("/355="); Serial.println((float)value/355);
  if (value>=380 && value<=400)
    Btn[2]=1;
  //Serial.print(value);Serial.print("/312="); Serial.println((float)value/312);
  if (value>=330 && value<=350)
    Btn[3]=1;
/*
  digitalWrite(BtnLed[0], Btn[0]);  
  digitalWrite(BtnLed[1], Btn[1]);  
  digitalWrite(BtnLed[2], Btn[2]);  
  digitalWrite(BtnLed[3], Btn[3]);  
*/
}











void Numero(int N){
  switch(N){
  case 0:
    digitalWrite(Display[0], HIGH);
    digitalWrite(Display[1], HIGH);
    digitalWrite(Display[2], HIGH);
    digitalWrite(Display[3], LOW);
    digitalWrite(Display[4], HIGH);
    digitalWrite(Display[5], HIGH);
    digitalWrite(Display[6], HIGH);
    break;
  case 1:
    digitalWrite(Display[0], HIGH);
    digitalWrite(Display[1], LOW);
    digitalWrite(Display[2], LOW);
    digitalWrite(Display[3], LOW);
    digitalWrite(Display[4], HIGH);
    digitalWrite(Display[5], LOW);
    digitalWrite(Display[6], LOW); 
    break; 
  case 2:
    digitalWrite(Display[0], HIGH);
    digitalWrite(Display[1], HIGH);
    digitalWrite(Display[2], LOW);
    digitalWrite(Display[3], HIGH);
    digitalWrite(Display[4], LOW);
    digitalWrite(Display[5], HIGH);
    digitalWrite(Display[6], HIGH);
    break;
  case 3:
    digitalWrite(Display[0], HIGH);
    digitalWrite(Display[1], HIGH);
    digitalWrite(Display[2], LOW);
    digitalWrite(Display[3], HIGH);
    digitalWrite(Display[4], HIGH);
    digitalWrite(Display[5], HIGH);
    digitalWrite(Display[6], LOW);
    break;
  case 4:
    digitalWrite(Display[0], HIGH);
    digitalWrite(Display[1], LOW);
    digitalWrite(Display[2], HIGH);
    digitalWrite(Display[3], HIGH);
    digitalWrite(Display[4], HIGH);
    digitalWrite(Display[5], LOW);
    digitalWrite(Display[6], LOW);
    break;
  case 5:
    digitalWrite(Display[0], LOW);
    digitalWrite(Display[1], HIGH);
    digitalWrite(Display[2], HIGH);
    digitalWrite(Display[3], HIGH);
    digitalWrite(Display[4], HIGH);
    digitalWrite(Display[5], HIGH);
    digitalWrite(Display[6], LOW);  
    break;  
  case 6:
    digitalWrite(Display[0], LOW);
    digitalWrite(Display[1], LOW);
    digitalWrite(Display[2], HIGH);
    digitalWrite(Display[3], HIGH);
    digitalWrite(Display[4], HIGH);
    digitalWrite(Display[5], HIGH);
    digitalWrite(Display[6], HIGH);
    break;  
  case 7:
    digitalWrite(Display[0], HIGH);
    digitalWrite(Display[1], HIGH);
    digitalWrite(Display[2], LOW);
    digitalWrite(Display[3], LOW);
    digitalWrite(Display[4], HIGH);
    digitalWrite(Display[5], LOW);
    digitalWrite(Display[6], LOW); 
    break;   
  case 8:
    digitalWrite(Display[0], HIGH);
    digitalWrite(Display[1], HIGH);
    digitalWrite(Display[2], HIGH);
    digitalWrite(Display[3], HIGH);
    digitalWrite(Display[4], HIGH);
    digitalWrite(Display[5], HIGH);
    digitalWrite(Display[6], HIGH);  
    break;
  case 9:
    digitalWrite(Display[0], HIGH);
    digitalWrite(Display[1], HIGH);
    digitalWrite(Display[2], HIGH);
    digitalWrite(Display[3], HIGH);
    digitalWrite(Display[4], HIGH);
    digitalWrite(Display[5], LOW);
    digitalWrite(Display[6], LOW); 
    break; 
  } 

}

Is it actually failing to send (i.e. the message is not received) or just that write() is returning an unsuccessful status?

Can you produce some test send and receive sketches that just do the radio stuff? It will make it easier for everyone (including you) to see what is going on.

Hey Peter , thanks for the answer.

Yes, its failing to send, as the main node is not receiving the packets.

The odd thing is that this problematic node receives normally the data. I have tried different channels, different send interval, all with no success.

I will try out your sugestion tomorrow, but if i am not mistaken, i did tried this before with similar results, it did have a small improvement on send success rate, but it was still failing alot.

Tomorrow when i get my hands on it I can send some debug information.

Thanks for your time man!

You say it's a 5V Pro Mini, and I assume the Mega is running at 5V too. Bearing in mind the nRF24L01+ is a 3.3V device, how are you powering them?

I am using the 3.3 output from the mega with a 0.1uF capacitor for the main node and two diodes in series on the 5v line also with a capacitor for the pro mini, the voltage averages to 3.45v on the pro mini.
I was planning to build a voltage regulator with a lm317 but they are out of stock here.

Hello again!

I Have uploaded this code to the pro mini

/*
 Copyright (C) 2012 James Coliz, Jr. <maniacbug@ymail.com>

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.
 */

/**
 * Simplest possible example of using RF24Network 
 *
 * TRANSMITTER NODE
 * Every 2 seconds, send a payload to the receiver node.
 */

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

// nRF24L01(+) radio attached using Getting Started board 
RF24 radio(9,10);

// Network uses that radio
RF24Network network(radio);

// Address of our node
const uint16_t this_node = 1;

// Address of the other node
const uint16_t other_node = 0;

// How often to send 'hello world to the other unit
const unsigned long interval = 50; //ms

// When did we last send?
unsigned long last_sent;

// How many have we sent already
unsigned long packets_sent;
unsigned long success;

// Structure of our payload
struct payload_t
{
  unsigned long ms;
  unsigned long counter;
};

void setup(void)
{
  Serial.begin(57600);
  Serial.println("RF24Network/examples/helloworld_tx/");
 
  SPI.begin();
  radio.begin();
  network.begin(/*channel*/ 90, /*node address*/ this_node);
}

void loop(void)
{
  // Pump the network regularly
  network.update();

  // If it's time to send a message, send it!
  unsigned long now = millis();
  if ( now - last_sent >= interval  )
  {
    last_sent = now;

    //Serial.print("Sending...");
    payload_t payload = { millis(), packets_sent++ };
    RF24NetworkHeader header(/*to node*/ other_node);
    bool ok = network.write(header,&payload,sizeof(payload));
    if (ok){
      //Serial.println("ok.");
      success++;
    }//else
     // Serial.println("failed.");
  
  
  if (packets_sent % 100 == 0){
    Serial.print("Success rate: "); Serial.print(success); Serial.println("%");
    success=0;
  }
  }
}
// vim:ai:cin:sts=2 sw=2 ft=cpp

its the RF24Network example for tx.

On the mega is running un-modified rx example.

here is the output for the tx node (pro mini):

RF24Network/examples/helloworld_tx/
Success rate: 41%
Success rate: 30%
Success rate: 36%
Success rate: 34%
Success rate: 31%
Success rate: 40%
Success rate: 29%
Success rate: 26%
Success rate: 21%
Success rate: 14%
Success rate: 38%
Success rate: 36%
Success rate: 28%
Success rate: 6%
Success rate: 7%
Success rate: 14%
Success rate: 1%
Success rate: 6%
Success rate: 0%
Success rate: 0%
Success rate: 3%
Success rate: 22%
Success rate: 16%
Success rate: 42%
Success rate: 31%
Success rate: 42%
Success rate: 45%
Success rate: 40%
Success rate: 32%
Success rate: 28%

This is after 3k packets sent. Each Success rate is computed every 100 packets interval.
It is much better then on my code, as it sometimes achieved more than 40% success rate, but still this is very very low, as they are less than 1 meter in distance. When distance is increased, its even worse!

Any Ideas?

Updates:

I have replaced the pro mini with another mega, so, now i'm using two megas 2560.

here is the output of the same test sketch:

RF24Network/examples/helloworld_tx/
Success rate: 51%
Success rate: 44%
Success rate: 45%
Success rate: 42%
Success rate: 40%
Success rate: 45%
Success rate: 38%
Success rate: 25%
Success rate: 15%
Success rate: 17%
Success rate: 43%
Success rate: 37%
Success rate: 30%
Success rate: 34%
Success rate: 29%
Success rate: 22%
Success rate: 12%
Success rate: 12%
Success rate: 24%
Success rate: 20%
Success rate: 24%
Success rate: 41%
Success rate: 34%
Success rate: 46%
Success rate: 33%
Success rate: 32%
Success rate: 39%
Success rate: 32%
Success rate: 15%
Success rate: 9%
Success rate: 16%
Success rate: 12%
Success rate: 15%
Success rate: 13%
Success rate: 7%
Success rate: 13%
Success rate: 14%
Success rate: 16%
Success rate: 21%

This is with different NRF24l01+ radios. Each board have its own radio.
Geez, whats wrong????????

Edit:
I Just tried using a radio without a 0.1uF capacitor soldered to vcc and gnd, and this is the output

RF24Network/examples/helloworld_tx/
Success rate: 0%
Success rate: 0%
Success rate: 0%
Success rate: 0%
Success rate: 0%

So this confirms what they say about the mega boards, its 3.3 line is messy..lol..

Could these results be like this because of bad power source?

I'm not familiar with the RF24Network library (I use the RF24 library directly) but it uses RF24 which enables the sketch to configure transmit power levels, retry intervals and counts, transmit speeds. I suggest you find out whether the RF24Network library uses these options, or makes them available for the sketch to use, and if they aren't already being set to the best settings them get them set. Also, try using a different channel. Finally, make sure your message doesn't contain long sequences of 'all ones' or 'all zeros' since the radio encoding scheme works best when the bit stream contains frequent changes.

In fact, as a starting point I suggest you just run the RF24 sender and receiver sketches directly and see how well these work - the standard examples configure the radio to the most resilient settings.

Hi again.

I have tested with pingpair example and getting started example.
both with similar results to prior.

/*
 Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.
 */

/**
 * Example for Getting Started with nRF24L01+ radios. 
 *
 * This is an example of how to use the RF24 class.  Write this sketch to two 
 * different nodes.  Put one of the nodes into 'transmit' mode by connecting 
 * with the serial monitor and sending a 'T'.  The ping node sends the current 
 * time to the pong node, which responds by sending the value back.  The ping 
 * node can then see how long the whole cycle took.
 */

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

//
// Hardware configuration
//

// Set up nRF24L01 radio on SPI bus plus pins 9 & 10 

RF24 radio(49,53);

//
// Topology
//

// Radio pipe addresses for the 2 nodes to communicate.
const uint64_t pipes[2] = { 0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL };

//
// Role management
//
// Set up role.  This sketch uses the same software for all the nodes
// in this system.  Doing so greatly simplifies testing.  
//

// The various roles supported by this sketch
typedef enum { role_ping_out = 1, role_pong_back } role_e;

// The debug-friendly names of those roles
const char* role_friendly_name[] = { "invalid", "Ping out", "Pong back"};

// The role of the current running sketch
role_e role = role_pong_back;

void setup(void)
{
  //
  // Print preamble
  //

  Serial.begin(57600);
  printf_begin();
  printf("\n\rRF24/examples/GettingStarted/\n\r");
  printf("ROLE: %s\n\r",role_friendly_name[role]);
  printf("*** PRESS 'T' to begin transmitting to the other node\n\r");

  //
  // Setup and configure rf radio
  //

  radio.begin();

  // optionally, increase the delay between retries & # of retries
  radio.setRetries(15,15);

  // optionally, reduce the payload size.  seems to
  // improve reliability
  //radio.setPayloadSize(8);

  //
  // Open pipes to other nodes for communication
  //

  // This simple sketch opens two pipes for these two nodes to communicate
  // back and forth.
  // Open 'our' pipe for writing
  // Open the 'other' pipe for reading, in position #1 (we can have up to 5 pipes open for reading)

  //if ( role == role_ping_out )
  {
    //radio.openWritingPipe(pipes[0]);
    radio.openReadingPipe(1,pipes[1]);
  }
  //else
  {
    //radio.openWritingPipe(pipes[1]);
    //radio.openReadingPipe(1,pipes[0]);
  }

  //
  // Start listening
  //

  radio.startListening();

  //
  // Dump the configuration of the rf unit for debugging
  //

  radio.printDetails();
}

void loop(void)
{
  //
  // Ping out role.  Repeatedly send the current time
  //

  if (role == role_ping_out)
  {
    // First, stop listening so we can talk.
    radio.stopListening();

    // Take the time, and send it.  This will block until complete
    unsigned long time = millis();
    printf("Now sending %lu...",time);
    bool ok = radio.write( &time, sizeof(unsigned long) );
    
    if (ok)
      printf("ok...");
    else
      printf("failed.\n\r");

    // Now, continue listening
    radio.startListening();

    // Wait here until we get a response, or timeout (250ms)
    unsigned long started_waiting_at = millis();
    bool timeout = false;
    while ( ! radio.available() && ! timeout )
      if (millis() - started_waiting_at > 200 )
        timeout = true;

    // Describe the results
    if ( timeout )
    {
      printf("Failed, response timed out.\n\r");
    }
    else
    {
      // Grab the response, compare, and send to debugging spew
      unsigned long got_time;
      radio.read( &got_time, sizeof(unsigned long) );

      // Spew it
      printf("Got response %lu, round-trip delay: %lu\n\r",got_time,millis()-got_time);
    }

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

  //
  // Pong back role.  Receive each packet, dump it out, and send it back
  //

  if ( role == role_pong_back )
  {
    // if there is data ready
    if ( radio.available() )
    {
      // Dump the payloads until we've gotten everything
      unsigned long got_time;
      bool done = false;
      while (!done)
      {
        // Fetch the payload, and see if this was the last one.
        done = radio.read( &got_time, sizeof(unsigned long) );

        // Spew it
        printf("Got payload %lu...",got_time);

	// Delay just a little bit to let the other unit
	// make the transition to receiver
	delay(20);
      }

      // First, stop listening so we can talk
      radio.stopListening();

      // Send the final one back.
      radio.write( &got_time, sizeof(unsigned long) );
      printf("Sent response.\n\r");

      // Now, resume listening so we catch the next packets.
      radio.startListening();
    }
  }

  //
  // Change roles
  //

  if ( Serial.available() )
  {
    char c = toupper(Serial.read());
    if ( c == 'T' && role == role_pong_back )
    {
      printf("*** CHANGING TO TRANSMIT ROLE -- PRESS 'R' TO SWITCH BACK\n\r");

      // Become the primary transmitter (ping out)
      role = role_ping_out;
      radio.openWritingPipe(pipes[0]);
      radio.openReadingPipe(1,pipes[1]);
    }
    else if ( c == 'R' && role == role_ping_out )
    {
      printf("*** CHANGING TO RECEIVE ROLE -- PRESS 'T' TO SWITCH BACK\n\r");
      
      // Become the primary receiver (pong back)
      role = role_pong_back;
      radio.openWritingPipe(pipes[1]);
      radio.openReadingPipe(1,pipes[0]);
    }
  }
}
// vim:cin:ai:sts=2 sw=2 ft=cpp

same results.... =(((

nexusbr:
same results.... =(((

Obviously that can't be literally true since the previous sketch printed the success rate and the ping pair one doesn't.

What actually happens - what proportion of the sender writes are received at the receiver, and what proportion of the send writes report success, and what proportion of the successful writes result in a response being received and what proportion of those responses are indicated as successful by the return status of the receiver's write call?

There are lots of messages being sent and received in a simple 'ping' operation, and you need to work out which ones are failing. The successful sequence should look something like this:

A calls radio.write().
A sends message to B and waits for response.
message received at B
B sends ack message
A receives ack message
radio.write returns success status

B processes received message from A
B calls radio.write to send response
B sends message and waits for response.
message received at A
A sends ack message
B receives ack message
radio.write returns success status

Yes, ofcourse, sorry i did not provided you all the information from this test. Its because the day today was a bit of a rush, I did not have the time to make those changes on the code to display those informations.
I will do that on monday, as its on my work place.

Dude, thanks a lot for your time! I really appreciate it, and its very helpfull.!!!!!
Hope you all the best.
I will update here after those updates!

Thanks again.