What I am trying to do:
I am trying to have a number of wireless sensor nodes(N1, N2, N3,…) to communicate with a central Base Station(BS) node. The BS node communicates with each of the sensor nodes sequentially. After receiving a message from the BS node, each sensor node sends back the IMU data to the BS node.
[Note: For the BS node, I have interfaced the nRF with the STM32 Nucleo F4 board and for the sensor nodes, I have used a bunch of ATmega32U4]
What I have done till now:
I am able to establish the communication between the BS node and a single sensor node(say N1).
I did this by swapping the role of the nodes each time. For transmitting, I poll the data and for receivers, I use interrupts.
What is the actual problem?
When I add a second node to the network to communicate, I am able to read the node data from each of the nodes(N1 and N2) exactly once. Then the communication stops altogether.
My questions:
For the BS node to communicate with the different sensor nodes, should I:
Use a single data pipe(e.g. Data_Pipe_0) and change the address each time?
Use different RF channels for different nodes
Use different data pipes for each node(I am limited to 6 nodes)
I have attached the concerned source code in this post.
This is the UART output I am getting at the BS node:
Hi Robin2,
As I mentioned, I am not using the arduino-based library so I’ll attach the source files directly.
This is the UART output from the base station in text:
BP1
Node count: 0
BP in N1
BP in N1
BP in N1
BP in N1
BP in N1
BP2
BP3
1112131415161718
BP1
Node count: 1
BP in N2
BP in N2
BP in N2
BP in N2
BP in N2
BP2
BP3
2122232425262728
BP1
Node count: 0
BP in N1
BP in N1
BP in N1
BP in N1
BP in N1
BP2
BP3
Hi Robin2,
Yes, I understand that. But based on your experience could you answer these questions?
My questions:
For the BS node to communicate with the different sensor nodes, should I:
Use a single data pipe(e.g. Data_Pipe_0) and change the address each time?
Use different RF channels for different nodes
Use different data pipes for each node(I am limited to 6 nodes)
I would use the same pipe and the same channel for everything.
With a single pipe you can communicate with 100 (or 1000) slaves if you wish.
The only reason I would change channel would be to avoid 3rd party interference - but I would still only use one channel unless there were very extreme circumstances.