nRF24 / RF24Mesh

OSI Layer 7 Mesh Networking for RF24Network & nrf24L01+ & nrf52x devices
http://nrf24.github.io/RF24Mesh
GNU General Public License v2.0
421 stars 154 forks source link

Can a master Tx to a slave in an nRF24 mesh? #230

Closed Kim-SangYoul closed 6 months ago

Kim-SangYoul commented 6 months ago

Hi. I want to implement 1:n communication using nRF24 Mesh, but the current example code only allows n slaves to transmit to 1 master. I would like to add to this a TX transmission from the master back to a specific slave. Is this possible? If possible, a reference code would be appreciated. Thank you.

2bndy5 commented 6 months ago

like in this example? RF24Mesh_Example_Master_To_Nodes.ino

Kim-SangYoul commented 6 months ago

Thank you for your quick response. RF24Mesh_Example_Master_To_Nodes.ino example name looks like it is sending from master to nodes, but how can I send from master to TX?

2bndy5 commented 6 months ago

how can I send from master to TX?

I'm not sure you are wording this question the way you want.

The nRF24L is a transceiver, so every node (including master) is a TX and a RX. With the network layers, the nodes (including master) idle in RX so they can respond (TX) in a timely manner.

More basic topology info is available in the python binding's docs.

Kim-SangYoul commented 6 months ago

Thank you. I am a hardware engineer so my understanding is limited. How can I implement the ? part in the attached picture if it is possible. Please explain in a little more detail. Thank you. nRF24 mesh TX RX

2bndy5 commented 6 months ago

No need to send to master and then have master send to another node. You can just send directly to the destination.

Using RF24Network address

// from node 05314
char msgType = 'T';
mesh.write(0421, &buf, msgType, sizeof(buf));

Using RF24Mesh ID

// from 05314
// assuming 0421 is assign to node with ID 50
char msgType = 'T';
mesh.write(&buf, msgType, sizeof(buf), 50);

All nodes will automatically do the forwarding for you. This is explained in the doc I linked:

For a message to travel from node 0o124 to node 0o3, it must be passed through any applicable network levels. So, the message flows 0o124 -> 0o24 -> 0o4 -> 0o0 -> 0o3.

Maybe the wording is confusing there.

Kim-SangYoul commented 6 months ago

Thank you. I didn't know the basics. A simple motion has been confirmed.