My old codes were working in the past. Unfortunately, I forget many things and I do not have time to revise the codes right now, so let me ask for help.
(1) you need to have 1 Raspberry Pi 3B, and a few Arduino Uno or similar devices. Each device has one nrf24l01 on it. The nrf24l01 is to send and receive data. I do not sponsor hardware, so please make sure you have the hardware.
(2) You need to be familiar with Python for Raspberry, and standard Arduino coding. You also need to be familiar with nrf24l01 library. We have to use the same library. I do not want to explore new nrf24l01 library.
(3) The raspberry pi will broadcast a "syn" signal to all Arduino devices. The syn signal can be a string, a numerical data, or whatever. Basically, the syn signal is to ask Arduino devices to do something.
(4) Each Arduino device, after receive the syn signal from Raspberry pi, will do something. You need to make sure all Arduino devices can receive the syn signal from Raspberry pi and generate its own random number.
(5) after Raspberry sent out the syn signal, Raspberry Pi will start polling the numerical data back from all Arduino devices. If all Arduino devices send the data back to Raspberry pi at the same time, the radio interference will occur. Thus I would like Raspberry pi to poll Arduino devices’ data back one by one. The idea situation is to ask Raspberry pi to send another signal with a special coding, for example, 01 is for first Arduino, 02 is for second Arduino, and so on. In this way, each Arduino device, after detecting the matched coding, will send back its data back to Raspberry pi.
I am familiar that Arduino devices may stagger its data in time domain to avoid the interference, but I rather using the polling, because Raspberry pi is the master, and I want the master to control all things.
You need to make sure Raspberry Pi can poll all Arduino devices’ data back quickly. If the codes are correct, I believe, Raspberry Pi shall be able to poll all data back within a few ms. We also need to confirm the sending and the receiving data are matched.
(6) If possible, please make the code working for as many Auino devices as possible, such as, 7, or 10 devices.
(7) The steps of (3), (4), and (5) are looping, so Raspberry Pi and Arduino devices keep communicating with each other. Raspberry pi keep collecting the data from Arduino devices.
Thanks for bidding.
I have a network similar to what you describe, I would like to help you, Development of electronic projects, internet of things (IOT), prototyping, microcontroller programming (pics, arduinos, etc.), raspberry projects Daha Fazla