I have one nRF24L01 on the Raspberry Pi, and let me define this nRF24L01 as “Master”. The Master will send a signal every 1 or 2 seconds to many “Slaves” device. Initially the Master is at talking mode, after sending the signal out, the device will change to listening mode and wait for ~0.2s to receive the signals from all Slaves. The Master uses one talking pipe to talk to all Slaves, and use 5 listening pipes to listen from different Slaves. Basically Master needs to collect simple data from all Slaves every 1 or 2 seconds. Master is monitoring the real time data from Slave devices.
I have many Arduino Nano devices, and each Nano device has one nRF24L01. Let me define these nRF24L01 as “Slave” devices. Initially these nRF24L01 are at listening mode, after receiving the signal from Master, each Nano will collect a simple data, and each Slave will change to talking mode to send the data back to Master. After the sending out of the signal, each Slave will change to listening mode again to wait for the next signal from Master. Slave’s listening pipe is using the same address as the Master’s talking pipe, and Slave’s talking pipes are using the same addresses as the Master’s listening pipes. I assume, with this setup, Master can talk and listen to many Slaves at the same time.
If all Slaves send the signals to Master at the same time, I am afraid the Master may miss the data, so I command the Slaves to send the data with different time delays, for example, first Slave, upon the receiving of signal from Master, it collect a simple data and send the data back to Master "right away", the second Slave, upon the receiving of the signal from Master, it wait 5-10 ms then send the data back, the 3rd Slave wait 10ms then send the data back, … and so on.
Unfortunately, the Master always miss some data from Slaves, not miss all, just miss one here, miss one there, and sometimes get worse and miss many data, so the communication is not stable. I like to make things more stable -- prefer to get all data with one shot, and I want to solve this unstable communication issue. I need some advice. To clarify, I already have the code and you do not need to write the code for me.
I need to clarify a few things:
(1) Basically I like the Master to broadcast a signal every 1-2 second to all Slaves devices. After sending the signal out, Master will wait for only 0.2 second (200ms) to wait for the responses from all Slaves. Master will check if all data from Slaves are received. If not all Slaves’ data are received and the time is over 0.2s, Master will broadcast next signal again. I expect, during each broadcasting, Master shall receive all data, but this is not happening.
(2) Each Slave device, upon the receiving of signal from Master, will do a simple job to collect a simple data, and send the data back to Master. The needed timings of simple jobs may be slightly different, but only a few ms differences, and I assume this shall not be the factor causing the un-stable communication problem.
(3) As I said, I am worried about that if all Slaves send the signal back to Master at the same time and Master may NOT be able to handle so many data at the same time, so I command the Slaves to send the signal back to Master with different time delays. I thought the different time delays will solve the issue but it does not.
(4) I expect, with above setting, the Master shall be able to collect all data from ALL Slaves during each of its broadcasting, but unfortunately, this is not the real situation. One or two or more data from Slaves are missing.
(5) I suspect the root causes are (a) the interference? (b) the setting up of parameters of nrf24l01, such as, ACK, reentries, payload, channel, data rate? Timing? …