The demo for data transmission between user modules through a mechanism of inter-node data transfer
Important
This demo only showcases the data interaction process between the root node and any child node, aiming to illustrate the randomness of data communication within the Mesh node.
Data transmission mechanism
Data communication between the root node and any child node
Of which:
- Root: Under the Mesh network within a local area network, the root node cannot directly connect to the router.
Therefore, it can be connected by having the root node connect to the network module to achieve the connection effect (as shown in the 4G module in the figure). Therefore, the data can be transmitted from the 4G module through UART and other serial ports to the root node, and then sent to the corresponding sub-node via the internal node-to-node data transmission method of BK MESH, with the format being as follows:
C8:47:8C:XX:XX:XX,DATA
- Of which:
C8:47:8C:XX:XX:XX is the MAC address of the sub-node to be sent.
DATA:data to be sent
The root node also follows this structure when returning; the specific data parsing is completed on the cloud or other devices connected to the root node.
When the root node receives data from any child node, it needs to parse the sender’s MAC address and then assemble it into the following format to send it to the connected devices:
C8:47:8C:XX:XX:XX,DATA
- Of which:
C8:47:8C:XX:XX:XX is the MAC address of the data sender.
DATA:data to be sent
Child Node:After receiving the data, the child node will remove the received MAC address and only send the DATA through the serial port to the customer device connected to the child node.
with the format being as follows:
DATA
When a child node receives data from the module it is connected to, the format is as follows:
DATA
After receiving the data, child nodes do not need to perform any processing and directly transmit it to the root node via the inter-node data transmission method within BK MESH.
Note
This function needs to be used after network setup! Data transmission for this function must be implemented through the AT port! This function will take effect under the condition of enabling CONFIG_BK_MESH_CUSTOM_DATA_TRANSFER !