I'm using three NRF24L01 transceivers, each connected to one Arduino Nano. One of the NRF24L01's is configured as a receiver, while the other two NRF24L01's are set as transmitters.
The transmitters collect data from the respective sensors attached to it, such as accelerometer and so forth. Both have the same amount of inputs and sensors.
The receiver is plugged in to the computer awaiting the transmission of data from the transmitters.
Everything is fine in the serial monitor when only one of the transmitters are transmitting, however, when both the transmitters are sending data to the receiver, a garbled mess of data could be seen (see the attached jpg file).
What I'm trying to visualize in the serial monitor is this: the sensor values of transmitter 1 and transmitter 2, all placed in the same row every second of transmission. That is the format, because I've written a short Python script that takes the serial data and prints it in a csv file, so the format needs to be preserved.
How do I go about it? I've read about the use of arrays and payloads but I'm relatively unfamiliar with those as it is my first time exploring networking peripherals in Arduino. I hope you could help me. Thank you.
It includes an example for a master and 2 slaves that can easily be extended to a larger number of slaves.
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
...R
PS please make your image visible in your Post. See this Simple Image Guide
It includes an example for a master and 2 slaves that can easily be extended to a larger number of slaves.
Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.
The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work
...R
PS please make your image visible in your Post. See this Simple Image Guide
Yes Sir, I understand that it is impossible for one NFR24L01 to receive two messages at the same time. What I want to do is find a leeway or some sort of buffer or a payload method, so that the transmitted data would only print in the serial monitor only once the message from both of the two transmitters has been received by the receiver, then those data values could be concatenated in the serial monitor.
theninoadrianband:
What I want to do is find a leeway or some sort of buffer or a payload method, so that the transmitted data would only print in the serial monitor only once the message from both of the two transmitters has been received by the receiver, then those data values could be concatenated in the serial monitor.
That is a very different requirement from what is in your title.
I suggest you include in each message a character that identifies the sender (maybe just 'A' and 'B' for the two senders)
When you receive a message check who it's from and store it in the appropriate place (without knowing the exact content of your message I can't be more specific). Also update another variable by adding 1 when messageA has been received and 2 for messageB. (I'm assuming that there won't be 3 inputs from messageA to confuse things)
When the value in that variable == 3 you will know that both have been received and then you can print them and set that variable back to 0