Closed adamzxtan closed 3 years ago
Well surprisingly, I'm getting similar results. Not sure what or when this became an issue, but a small change will work around it for now:
delay(2);
The delay could be made higher if not working. I'm not sure why it needs to be there exactly, but seems to do the trick. Please let me know if this works, I'm going to take a closer look as soon as I get a chance.
I've changed the air data rate from 250kbps to 1mbps and now it works again. I'm not entirely sure why, but seems like I've ran into one of the common issue? https://github.com/nRF24/RF24/blob/master/COMMON_ISSUES.md I'm using nrf24 module, with PA+LNA. It's powered with an independent LDO (AMS1117) with 10uf ceramic caps (SMD) on input and output side.
Anyway I'll try out the suggestion, but just to clarify do I add the delay(2)
before or after?
/**Write it*/
ok=write_to_pipe(conversion.send_node, conversion.send_pipe, conversion.multicast);
delay(2);
or
/**Write it*/
delay(2);
ok=write_to_pipe(conversion.send_node, conversion.send_pipe, conversion.multicast);
This isn't a problem with the build-in radio ACKs, its a RF24Network specific issue with software based ACKs.
I used a PA+LNA module also for the routing node in my test, not sure if it makes a difference yet.
The delay should go before the write. I've been using the following code to only delay when its a software acked payload.
if( directTo == TX_ROUTED && conversion.send_node == to_node && isAckType){ //<-- Add
delay(2); //<-- These
} //<-- Lines
ok=write_to_pipe(conversion.send_node, conversion.send_pipe, conversion.multicast);
FYI some further results on Arduino Mega 2560 & PA+LNA
module, Arduino Due & No Antenna module
, 1Mbps:
1. With Mega as 044 and Due as 04 routing node, the delay is not required
2. With Due as 044 and Mega as 04 routing node, the delay is required
3. Configuration of MIN, LOW power etc does not make a difference
The Due MCU is much faster and should be responding quicker to requests, but the Mega as routing node has the problems. I have to attribute this to the PA+LNA high powered modules behaving differently. It also explains why this has not been a bigger issue.
The delay should go before the write. I've been using the following code to only delay when its a software acked payload.
if( directTo == TX_ROUTED && conversion.send_node == to_node && isAckType){ //<-- Add delay(2); //<-- These } //<-- Lines ok=write_to_pipe(conversion.send_node, conversion.send_pipe, conversion.multicast);
This has been working well for me so far. I'm bringing out my setup to wide area test later tomorrow to see if it solves my issue at all. Also will be testing with 8 slaves sensor.
Hi @TMRh20 everything has been working fine so far. Other than some intermittent connection lost issue, or random missing ack packet, things are ok. So I'm closing this issue now. Thanks for the help.
So in my sensor network, I have setup 6 nodes of slaves with the address of 01, 02, 03, 04, 05, 014. However, no matter what I do the master node will not be able to return success upon sending to 014 node. I changed the address to 015 still the same result. Here's the debugging message from serial monitor:
Master node:
Slave node 014:
Obviously the 014 node is receiving message from the master node. But the master node doesn't seems like receive the network ack. Any idea on why this happens?