Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NRF52x info to docs #230

Merged
merged 5 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/addressing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ The nrf24 radio modules typically use a 40-bit address format, requiring 5-bytes
array of addresses to be utilized. In addition, the radios are limited to direct communication with 6 other nodes while using the
Enhanced-Shock-Burst (ESB) functionality of the radios.

The NRF52x modules use a similar format for addressing, but can communicate directly with 8 other nodes while using the
Enhanced-Shock-Burst (ESB) functionality of the radios.

RF24Network uses a simple method of data compression to store the addresses using only 2 bytes, in a format designed to represent the
network topology in an intuitive way.
See the [Topology and Overview](tuning.md) page for more info regarding topology.
Expand All @@ -35,6 +38,9 @@ support 4 nodes (01n to 04n etc), 1 multicast address and 1 parent pipe. Users c
`#define RF24NetworkMulticast` as well. This allows the master to support 5 children, with nodes supporting 5 children also.
See the [Topology and Overview](md_docs_tuning.html) page for more info regarding topology.

With the newer NRF52x devices, the master node will support 7 nodes (01 through 07) and 1 multicast address, while the nodes
themselves support 6 nodes (01n to 06n etc), 1 multicast address and 1 parent pipe.

### Decimal, Octal and Binary

| Decimal | Octal | Binary |
Expand Down
2 changes: 2 additions & 0 deletions docs/advanced_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ RF24Network offers many features, some of which can be configured by editing the
| `#define DISABLE_USER_PAYLOADS` | This option will disable user-caching of payloads entirely. Use with RF24Ethernet to reduce memory usage. (TCP/IP is an external data type, and not cached) |
| `#define ENABLE_SLEEP_MODE` | Uncomment this option to enable sleep mode for AVR devices. (ATTiny,Uno, etc) |
| `#define ENABLE_NETWORK_STATS` | Enable counting of all successful or failed transmissions, routed or sent directly |
| `#define NUM_PIPES` | Define the number of pipes for addressing. The max value is generally hardware dependant. NRF24 supports 6 pipes, NRF52x supports 8 pipes |
| `#define MAX_FRAME_SIZE` | Found in RF24Network.h, this allows users to set the maximum frame size used internally. NRF24 supports 32-bytes, NRF52x supports 123-bytes, or 111 if encryption is enabled |
3 changes: 2 additions & 1 deletion docs/main_page.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Please see the recent changes listed in [the github releases page](https://githu
## Topology for Mesh Networks using nRF24L01(+)

This network layer takes advantage of the fundamental capability of the nRF24L01(+) radio to
listen actively to up to 6 other radios at once. The network is arranged in a
listen actively to up to 6 other radios at once (8 with NRF52x). The network is arranged in a
[Tree Topology](http://en.wikipedia.org/wiki/Network_Topology#Tree), where
one node is the base, and all other nodes are children either of that node, or of another.
Unlike a true mesh network, multiple nodes are not connected together, so there is only one
Expand All @@ -116,6 +116,7 @@ digit in the address represents a position in the tree further from the base.
- The largest node address is 05555, so up to 781 nodes are allowed on a single channel.
An example topology is shown below, with 5 nodes in direct communication with the master node,
and multiple leaf nodes spread out at a distance, using intermediate nodes to reach other nodes.
- With the newer NRF52x devices, up to 3200 nodes are allowed on a single channel

@image html example_tree.svg

Expand Down
33 changes: 22 additions & 11 deletions docs/tuning.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ Retrying failed payloads over and over on a radio network can hinder communicati
reduce throughput and errors on routing nodes.

Radios in this network are linked by **addresses** assigned to **pipes**. Each radio can listen
to 6 addresses on 6 pipes, therefore each radio has a parent pipe and 4-5 child pipes, which are used
to form a tree structure. Nodes communicate directly with their parent and children nodes. Any other
to 6 addresses on 6 pipes, (8 pipes on NRF52x) therefore each radio has a parent pipe and 4-5 child pipes, which are
used to form a tree structure. Nodes communicate directly with their parent and children nodes. Any other
traffic to or from a node must be routed through the network.

## Topology of RF24Network

Anybody who is familiar at all with IP networking should be able to easily understand RF24Network topology. The
master node can be seen as the gateway, with up to 4 directly connected nodes. Each of those nodes creates a
subnet below it, with up to 4 additional child nodes. The numbering scheme can also be related to IP addresses,
for purposes of understanding the topology via subnetting. Nodes can have 5 children if multicast is disabled.
master node can be seen as the gateway, with (by default) up to 5 directly connected nodes. Each of those nodes
creates a subnet below it, with up to 4 additional child nodes. The numbering scheme can also be related to IP
addresses, for purposes of understanding the topology via subnetting. Nodes can have 5 children if multicast is
disabled.

### Expressing RF24Network addresses in IP format

Expand All @@ -47,12 +48,12 @@ In RF24Network, the master is just `00`

## Multicast

Multicast is enabled by default, which limits the master node to 5 child pipes and other nodes to 4. Nodes are
arranged in multicast 'levels' with the master node being level 0, nodes 01-05 are level 1, nodes n1-n5 are level 2,
and so on. The multicast level of each node can be configured as desired by the user, or multicast can be
disabled by editing RF24Network_config.h. For example, if all nodes are in range of the master node, all nodes can
be configured to use multicast level 1, allowing the master node to contact all of them by sending a single payload.
Multicasting is also used by the RF24Mesh layer for dynamic addressing requests.
Multicast is enabled by default, which limits the master node to 5 child pipes and other nodes to 4 when using RF24
modules. Nodes are arranged in multicast 'levels' with the master node being level 0, nodes 01-05 are level 1, nodes
n1-n5 are level 2, and so on. The multicast level of each node can be configured as desired by the user, or
multicast can be disabled by editing RF24Network_config.h. For example, if all nodes are in range of the master node,
all nodes can be configured to use multicast level 1, allowing the master node to contact all of them by sending a
single payload. Multicasting is also used by the RF24Mesh layer for dynamic addressing requests.

## Routing

Expand Down Expand Up @@ -120,6 +121,16 @@ network.txTimeout variable. Timeout periods of extended duration (500+) will gen
are failing due to data collisions, it will only extend the duration of the errors. Extended duration timeouts
should generally only be configured on leaf nodes that do not receive data.

## Usage with NRF52x devices

1. Users can utilize large payloads by calling `radio.begin();` then `radio.enableDynamicPayloads(123);`
prior to calling `network.begin();`. Users would also need to edit RF24Network.h and set
MAX_FRAME_SIZE to a maximum of 111 if encryption is enabled, 123 without encryption.
2. Users can allow more nodes by modifying RF24Network_config.h and setting NUM_PIPES to 8 (Allows
master to have 7 child nodes, other nodes can have 6 children by default)
3. The MAX_PAYLOAD_SIZE is also defined in RF24Network_config.h. Raise to a multiple of 123 to allow
multiple large payloads to be cached in memory.

TMRh20 marked this conversation as resolved.
Show resolved Hide resolved
## Scenarios

### Example 1
Expand Down