nRF24L01+ many to one comminication problem

Hello guys,

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:

I am thanking you for your time and help.

Regards,
Frederic

BS.zip (3.74 KB)

N1.zip (4.43 KB)

N2.zip (4.43 KB)

What is in all the ZIP files? People don't like downloading strange ZIP files?

If it is program code then just post the code in your next Reply or, if it is too long (I hope not) then add the ,ino file as an attachment.

...R

PS ... please don't post pictures of text. Just copy and paste the text, it is much easier to read.

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

Nucleo_nRF_Multi_BS.c (11.5 KB)

N1.c (12.4 KB)

N2.c (12.4 KB)

nrf.h (1.86 KB)

My familiarity starts and ends with the commonly used TMRh20 RF24 library

Sorry, but I have no plans to learn any other approach.

...R
Simple nRF24L01+ Tutorial

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)

Thanks!

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.

…R