I have questions below. This is about the using of nrf24l01, particularly the using of “broadcasting” and “polling” of the radio data, in the same code.
(1) When ACK is “ON” on the Master device, does it mean when Master receives a radio from Slaves, it will automatically send an ACK to Slaves? or it means when the Master device broadcasts a radio to Slaves, it will ask Slaves to reply back the ACK? I am confused if this is one-way or two-way? The answer will help me determine to set ACK ON or OFF on the Master and Slaves.
For my application, I want Master to broadcast a radio “once per second” to all Slaves to activate them to start collecting a time sensitive measurement at exactly the same time, and Master do not need Slaves to reply back the ACK. I assume i need to set “Retries” to be (0,0) because Master can send only one synchronization radio per second. With ACK set to OFF on both Master and Slaves, things shall work for this step, based on my experience.
(2) After above step, Master needs to poll all Slaves’ measured data back, without the lost or missing of measured data, and of course before Master’s next broadcasting, and this is where I have problems. I command Master to Poll Slaves’ measured data, one by one, because if all Slaves send the data to Master at the same time, collisions will occur. Unfortunately, for the tests I have done, Master always miss some Slaves’ data, and I suspect the issue is related to ACK and Retries? Please note that when we do the first step (1), the ACK is set to OFF and the Retries is set to (0,0), and when I do the step (2), I found switching ACK from OFF to ON will cause the communication to fail. If I can reset ACK to be ON, i will like to change the Retries, so slaves can send the measured data to Master.
If we are doing only (1) or only (2), there are lots of working examples out there, but I am trying to do both, actually (1) first then (2), and keep repeating (1) and (2). So far I have not succeed. Attached please see Arduino codes of Master and the 1st Slave. You will need 6 nrf24l01 to test, one for master and 5 for slaves. Please advise me if you can have solutions to ensure Master to receive Slaves’ measured data without missing. Thanks
master.ino (4.6 KB)
slave1.ino (2.34 KB)