RF24Mesh
RF24Mesh copied to clipboard
Using Mesh and Broadcast (or Multicast)?
Hi, I am about to use this great library in a mesh context. I would have 2 questions:
- how are the "nrf24" tree levels used when using mesh library, since nodes are only defined with a unique number ranging from 1 to 255?
- can we leverage broadcast communication from the master to the nodes? How to send such a broadcast message? Can you provide a simple example?
-
The master node assigns the connecting node a network (logical) address. The network address informs the other nodes how the newly connected mesh node fits within the network topology. See our documented Mesh connecting process for more detail.
-
Using
network.multicast()
seems to be what you're asking about, unless I misunderstood the question. That doc link also references other multicast-related functionality (in the "see also" section).Can you provide a simple example?
Please read the docs as this functionality is pretty straight forward once you understand the network topology.
Both of your questions seem related to the network topology. The pyrf24/topology page has some good basic information, but it uses the python representation of octal numbers (0o0
) instead of the C++ representation of octal numbers (00
).
unique number ranging from 1 to 255
Please keep in mind that a network can only have 256 mesh nodes (including master node). Using a mix of statically assigned nodes (RF24Network) with mesh nodes is allowed. See mesh.setAddress()
about giving static RF24Network nodes a unique RF24Mesh ID.
Just to add to what Brendan posted, multicast doesn’t really work with RF24Mesh since you don’t want to enable multicast forwarding or enable all nodes to use the same multicast level. This is because the mesh uses multicast to find other devices when connecting.