Hello,
I am using the RF24 radio modules and the RF24Network library to communicate between an Arduino uno and a series of Arduino nanos. I was trying to implement the network.failures() function to print out the number of successfully sent payloads but all I get is zero. What am I doing wrong?
Here is the snippet of relevant code from my base module (the uno)
void loop(void) {
network.update(); // Check the network regularly
while (network.available()) { // Is there anything ready for us?
RF24NetworkHeader header; // If so, grab it and print it out
payload_t payload;
network.read(header, &payload, sizeof(payload));
// print the payload for each node
printPayload(payload);
uint32_t fails, success;
network.failures(&fails, &success); // Return the number of failures and successes for all transmitted payloads, routed or sent directly
Serial.print(F(", Success="));
Serial.print(success);
Serial.print(F(", Failures="));
Serial.println(fails);
}
}
this is some of my output
Node ID: 1, Received packet: counter=1664, origin timestamp=3330000, moisture=59.37, Percentage=0.00, Success=0, Failures=0
Node ID: 1, Received packet: counter=1665, origin timestamp=3332000, moisture=59.37, Percentage=0.00, Success=0, Failures=0
Node ID: 1, Received packet: counter=1666, origin timestamp=3334000, moisture=59.36, Percentage=0.00, Success=0, Failures=0
Node ID: 1, Received packet: counter=1667, origin timestamp=3336000, moisture=59.38, Percentage=0.00, Success=0, Failures=0