[SOLVED] pipes supprting auto ack NRF24L01

Nope.

The NRF24L01+ chips work as described in the datasheet.

mestek123:
pipes 2-5 dusn work at all not just receiving ack

Pipes do not receive any acks, they may in a way send some, three of them with ackpayload.

Acks are always and only received via pipe 0 in the sending node.

Robin2:
Post the ****** programs so we can see them - and maybe try them.

...R

it is the same of the original program that i sent in the first post but without SHA256

Whandall:
Nope.

The NRF24L01+ chips work as described in the datasheet.

Pipes do not receive any acks, they may in a way send some, three of them with ackpayload.

Acks are always and only received via pipe 0 in the sending node.

hi Whandall

have u checked the full post ?

there is CaptainJack who was suffering from the same matter and also another guy in the same thread and he said he could solve that problem using a way in addresses of the pipes but he described it in a vague way

i can receive ack via pipes 0,1,5
but the other 3 pipes are not working

  radio.openReadingPipe(5,rAddress[5]);

You have to set pipe 1 to an address that shares the same prefix.

The way you use it, only the lowest byte of your address will will make it to the controller.
The upper 4 bytes will come from the pipe 1 address that happens to be in the chip.

It’s all in the datasheet.

kindly check this

mestek123:
there is CaptainJack who was suffering from the same matter and also another guy in the same thread and he said he could solve that problem using a way in addresses of the pipes but he described it in a vague way

I think he had a misunderstanding which part of the address in ASCII is the lowest byte.

"1Node" "2Node" "3Node" work,

"Node1" "Node2" "Node3" don't.

Whandall:
I think he had a misunderstanding which part of the address in ASCII is the lowest byte.

"1Node" "2Node" "3Node" work,

"Node1" "Node2" "Node3" don't.

i will try ur way and update u immediately

Your problem is different as you are using uint64_t for the addresses (that are wellformed).

Set the f***** pipe 1 address!

Pipes.png

mestek123:
it is the same of the original program that i sent in the first post but without SHA256

Well you keep it to yourself if you want to. I have had enough.

...R

i have tried this addressing
{ '1Node', '2www2', '3xxx3', '4yyy4', '5zzz5' };

it cant work on pipes 1-5 neither on normal transmitting and receiveing nor ack

it works for pipes 0 in but no ack

Read #27 again and change your code accordingly.

Post the latest version of the rx part and - if you made changes to the tx part - that too.

mestek123:
{ '1Node', '2www2', '3xxx3', '4yyy4', '5zzz5' };

The upper 4 bytes of addresses for pipes 1 to 5 have to be the same, as already mentioned. :confused:

If you want to use one or two pipes, use 0 and 1.

If you need more, use pipes 2 to 5 (with addresses that share the same 4 byte prefix with address 1).

Opening only pipe 2 to 5 listens on an unexpected address. (Prefix 0xC2C2C2C2)

tx code

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

/*
This sketch sends a string to a corresponding Arduino
with nrf24 attached.  It appends a specific value 
(2 in this case) to the end to signify the end of the
message.
*/
#define WHICH_NODE 1

const uint64_t wAddress[] = { '1Node', '2www2', '2www3', '2www4', '2www5' };


 const uint64_t PTXpipe = wAddress[WHICH_NODE];   // Pulls the address from the above array for this node's pipe
  
int ackMessg[1];
byte ackMessgLen = 1;

RF24 radio(8,10);

byte arr[32] ;
 uint8_t* hash;
 
void printHash(uint8_t* hash) {
  
  for (int i=0; i<32; i++) {
     //(String)hash = (String) ID + (String) hash;
    Serial.print("0123456789abcdef"[hash[i]>>4]);
    Serial.print("0123456789abcdef"[hash[i]&0xf]);

  }
  Serial.println();
}

void setup(void)
{
  Serial.begin(9600);
  radio.begin();
  radio.setDataRate( RF24_250KBPS );
  radio.setChannel(108); 
  //radio.setPALevel(RF24_PA_MAX);
  radio.enableAckPayload();
 // radio.setRetries(3,5); // delay, count
  radio.openWritingPipe(PTXpipe); 
//  radio.stopListening();
  
}
void loop()
{
  byte arr[32] ;
  char xx[21];
String str ="12345678901234567890";
str.toCharArray(xx, 21);
 

Sha256.initHmac((uint8_t*)xx,21);
//Serial.println(xx);
  Sha256.print("node 1");
 // delay(10);
 hash=Sha256.resultHmac();
  
 
for( int j=0;j<32;j++)
{arr[j]=hash[j];
 //Serial.print(arr[j],HEX);
  }
 // delay(10);
 byte arr1[33];
   memcpy( arr1, arr ,32);
    //delay(4);
//arr[32]='\0';
//Serial.println();
    
 //byte arr1[33]="12345678901234567890123456789012";

bool rslt;
 
rslt=radio.write(arr,sizeof(arr));

   
if ( radio.isAckPayloadAvailable() ) {
 radio.read(ackMessg,ackMessgLen);
 Serial.print("Acknowledge received: ");
 Serial.println(ackMessg[0]);
 }
    
//Serial.println(arr1);
//radio.powerDown(); 
 // delay(100);
//radio.powerUp();
 
 
}

rx

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

/*
This sketch receives strings from sending unit via nrf24 
and prints them out via serial.  The sketch waits until
it receives a specific value (2 in this case), then it 
prints the complete message and clears the message buffer.
*/
byte pipeNum = 0;

int ackData[1] = {5};
byte ackLen = 1;

RF24 radio(8,10);
 const uint64_t rAddress[] =  { '1Node', '2www2', '2www3', '2www4', '2www5' };

byte theMessage[32] = "";

void setup(void){
  Serial.begin(9600);
  radio.begin();
   radio.setChannel(108); 
  radio.setDataRate( RF24_250KBPS );
  radio.enableAckPayload();
  //radio.setPALevel(RF24_PA_MAX);
  radio.openReadingPipe(1,rAddress[1]);
 
  radio.startListening();
}

void loop(void)
{
       
  while (radio.available(&pipeNum))
  {
      radio.read( theMessage , 32 );
      
      Serial.print("received : ");
      for(int x=0;x<32;x++)
      Serial.print(theMessage[x],HEX);
      Serial.print(" from ");
      Serial.print(pipeNum);
      Serial.println();
      
      radio.writeAckPayload(1, ackData, ackLen);
      
      //radio.writeAckPayload(2, ackData, ackLen);
     /* if(strcmp(theMessage,"12345678901234567890123456789012")==0)
      {//Serial.println("h");
      }*/
}}

now it works on pipe 1 only without ack :confused:

If you want to use more than 2 pipes your addresses are crap.
The mixture of uint64_t and ultra long character constants are crap too.

const uint64_t rAddress[] =  { '1Node', '2www2', '2www3', '2www4', '2www5' };

Try something like

const char* rAddress[] =  { "1Node", "2Node", "3Node", "4Node", "5Node" };

I get tired repeating the same stuff over and over.

Whandall:
If you want to use more than 2 pipes your addresses are crap.
The mixture of uint64_t and ultra long character constants are crap too.

const uint64_t rAddress[] =  { '1Node', '2www2', '2www3', '2www4', '2www5' };

Try something like

const char* rAddress[] =  { "1Node", "2Node", "3Node", "4Node", "5Node" };

I get tired repeating the same stuff over and over.

SO SORRY whandall
i will try the suggested addressing and update u

thank u very much for ur great help and ur patience

For a 5 pipe rx-setup you could use

  for (byte i = 0; i<5; i++) {
    radio.openReadingPipe(i+1, rAddress[i]);
  }
const char* rAddress[] =  { "1Node", "2Node", "3Node", "4Node", "5Node" };

whhen i used this on my rx code i get that error

call of overloaded ‘openReadingPipe(int, const char*&)’ is ambiguous
:sob:
and when i used ur part

for (byte i = 0; i<5; i++) {
    radio.openReadingPipe(i+1, rAddress[i]);
  }

i got this error :

call of overloaded ‘openReadingPipe(int, const char*&)’ is ambiguous

Snippets are us?

Post the complete changed code!

const byte* rAddress[] =  { "1Node", "2Node", "3Node", "4Node", "5Node" };

should work.