Network Constants¶
All the constants related to managing a network with nRF24L01 radios.
Added in version 2.1.0.
Sending Behavior Types¶
-
circuitpython_nrf24l01.network.constants.AUTO_ROUTING =
56¶ Send a message with automatic network routing.
-
circuitpython_nrf24l01.network.constants.TX_NORMAL =
0¶ Send a routed message.
This is used for most outgoing message types.
-
circuitpython_nrf24l01.network.constants.TX_ROUTED =
1¶ Send a routed message.
This is internally used for
NETWORK_ACKmessage routing.
-
circuitpython_nrf24l01.network.constants.TX_PHYSICAL =
2¶ Send a message directly to network node.
These usually take 1 transmission, so they don’t get a network ACK because the radio’s
auto_ackwill serve the ACK.
-
circuitpython_nrf24l01.network.constants.TX_LOGICAL =
3¶ Similar to
TX_NORMAL.This allows the user to define the routed transmission’s first path (these can still get a
NETWORK_ACK).
-
circuitpython_nrf24l01.network.constants.TX_MULTICAST =
4¶ Broadcast a message to a network level of nodes.
Reserved Network Message Types¶
-
circuitpython_nrf24l01.network.constants.MESH_ADDR_RESPONSE =
128¶ Primarily for RF24Mesh
This
message_typeis used to in the final step ofrenew_address()route a messages containing a newly allocatednode_address. The header’sreservedattribute for thismessage_typewill store the requesting mesh node’snode_idrelated to the newly assignednode_address. Any non-requesting network node receiving thismessage_typewill forward it to the requesting node using normal network routing.
-
circuitpython_nrf24l01.network.constants.NETWORK_PING =
130¶ Used for network pings
This
message_typeis automatically discarded because the radio’sauto_ackfeature will serve up the response.
-
circuitpython_nrf24l01.network.constants.NETWORK_EXT_DATA =
131¶ Unsupported at this time as this operation requires a new implementation.
Used for bridging different network protocols between an RF24Network and LAN/WLAN networks.
-
circuitpython_nrf24l01.network.constants.NETWORK_ACK =
193¶ Used for network-wide acknowledgements.
The message type used when forwarding acknowledgements directed to the instigating message’s origin. This is not be confused with the radio’s
auto_ackattribute. In fact, all messages (except multicasted ones) take advantage of the radio’sauto_ackfeature when transmitting between directly related nodes (ie between a transmitting node’s parent or child node).Important
NETWORK_ACK messages are only sent by the last node in the route to a destination. For example: Node
0o0sends an instigating message to node0o11. The NETWORK_ACK message is sent from node0o1when it confirms node0o11received the instigating message.Hint
This feature is not flawless because it assumes a reliable connection between all necessary network nodes.
-
circuitpython_nrf24l01.network.constants.NETWORK_POLL =
194¶ Primarily for RF24Mesh
This
message_typeis used withNETWORK_MULTICAST_ADDRto find active/available nodes. Any node receiving aNETWORK_POLLsent to aNETWORK_MULTICAST_ADDRwill respond directly to the sender with a blank message, indicating the address of the available node via the header’sfrom_nodeattribute.
-
circuitpython_nrf24l01.network.constants.MESH_ADDR_REQUEST =
195¶ Primarily for RF24Mesh
This
message_typeis used for requesting Logical Address data from the mesh network’s master node. Any non-master node receiving thismessage_typewill manually forward it to the master node using normal network routing.
-
circuitpython_nrf24l01.network.constants.MESH_ADDR_LOOKUP =
196¶ The
message_typeto request a mesh node’s network address from its unique ID.
-
circuitpython_nrf24l01.network.constants.MESH_ADDR_RELEASE =
197¶ The
message_typewhen manually expiring a leased address.
-
circuitpython_nrf24l01.network.constants.MESH_ID_LOOKUP =
198¶ The
message_typeto request a mesh node’s unique ID number from its node address.
Generic Network constants¶
-
circuitpython_nrf24l01.network.constants.MAX_USR_DEF_MSG_TYPE =
127¶ A convenient sentinel value.
Any message type above 127 (but cannot exceed 255) are reserved for internal network usage.
-
circuitpython_nrf24l01.network.constants.NETWORK_DEFAULT_ADDR =
2340¶ Primarily used by RF24Mesh.
Any mesh node that disconnects or is trying to connect to a mesh network will use this value until it is assigned a Logical Address from the master node.
-
circuitpython_nrf24l01.network.constants.NETWORK_MULTICAST_ADDR =
64¶ A reserved address for multicast messages.
-
circuitpython_nrf24l01.network.constants.MAX_FRAG_SIZE =
24¶ Maximum message size for a single frame’s message.
This does not including header’s byte length (which is always 8 bytes).
Warning
Do not increase this value in the source code. Adjust
max_message_lengthinstead.
Message Fragment Types¶
Message fragments will use these values in the
message_type attribute.
The sequential fragment id number will be stored in the
reserved attribute,
but the actual message type is transmitted in the
reserved attribute
of the last fragment.
-
circuitpython_nrf24l01.network.constants.MSG_FRAG_FIRST =
148¶ Used to indicate the first frame of a fragmented message.
-
circuitpython_nrf24l01.network.constants.MSG_FRAG_MORE =
149¶ Used to indicate a middle frame of a fragmented message.
-
circuitpython_nrf24l01.network.constants.MSG_FRAG_LAST =
150¶ Used to indicate the last frame of a fragmented message.
RF24Mesh specific constants¶
-
circuitpython_nrf24l01.network.constants.MESH_LOOKUP_TIMEOUT =
135¶ Used for
lookup_address()&lookup_node_id()The time (in milliseconds) that a non-master mesh node will wait for a response when requesting a node’s relative Logical Address or unique ID number from the master node.
-
circuitpython_nrf24l01.network.constants.MESH_MAX_POLL =
4¶ The max number of contacts made during
renew_address().A mesh node polls the first 4 network levels (0-3) looking for a response. This value is used to used when aggregating a list of responding nodes (per level).
-
circuitpython_nrf24l01.network.constants.MESH_MAX_CHILDREN =
4¶ The max number of children for 1 mesh node.
This information is only used by mesh network master nodes when allocating a possible Logical Address for the requesting node.
-
circuitpython_nrf24l01.network.constants.MESH_WRITE_TIMEOUT =
115¶ The time (in milliseconds) used to send messages.
When
RF24Mesh.send()is called, This value is only used when getting thenode_addressassigned to anode_idfrom the mesh network’s master node.