AT Commands
AT Command
Note
The following AT commands supported by the BK-MESH SDK
Important
When using AT commands, you need to input through the AT port, which is not the same as the Log port! The Log print port is typically configured as UART0, while the AT port is configured as UART1!
AT+BKMESH_CONFIG : Configure BK MESH parameters
AT+BKMESH_START : Start a BK MESH node
AT+BKMESH_STOP : Stop teh BK MESH node
AT+BKMESH_STATE : Get the link status information of BK MESH node
AT+DATATESTRECYCLE :Perform loopback test for data transmission between nodes and the external network using AT commands.
AT+BKMESH_IDATA_SEND : Conducting data transmission tests between nodes using AT.
AT+BKMESH_CONFIG
Explanation
Configure the related parameters of BK WIFI MESH. Please configure the parameters first before
starting a node.
Command
AT+BKMESH_CONFIG=mesh_id,router_ssid,router_password,sap_ssid,sap_password,
is_designated_root,max_level,max_mesh_conn_num,max_non_mesh_conn_num
Parameters :
Param
Meaning
mesh_id
Mesh ID of BK WIFI MESH.
router_ssid
The SSID of the router.
router_password
The password of the router.
sap_ssid
The SSID of the bk mesh soft ap.
sap_password
The password of the bk mesh soft ap.
is_designated_root
Ture if the node is designated root node.
max_level
The maximum level allowed.
max_mesh_conn_num
The maximum number of downlink mesh nodes for a node.
max_non_mesh_conn_num
The maximum number of downlink non-mesh nodes for a node.
AT+BKMESH_START
Explanation
Start a bk wifi mesh node. Please configure the parameters of BK MESH by AT+BKMESH_CONFIG first
before starting a node.
Command
AT+BKMESH_START
AT+BKMESH_STOP
Explanation
Stop the bk wifi mesh node.
Command
AT+BKMESH_STOP
AT+BKMESH_STATE
Explanation
Get the link status information of the bk wifi mesh node. It will return error if the node is
not started.
The link status information of the node includes the current state, the type, the current level,
the number of the downlink nodes, the MAC address of the parent node.
An instance of link status information display:
BK wifi mesh status: state[4 0], type:3, level:2, link_mesh:0, link_non-mesh:0, parent:c8:47:8c:b1:92:e2
Command
AT+BKMESH_STATE
Parameters :
Param
meaning
state
The current state of the node, and just focus on the first parameter.
(0-NONE, 1-IDLE; 2-ELECTING; 3-CONNECTING; 4-CONNECTED)
type
The type of the node.
(0-null; 1-designated_root; 2-root; 3-middle; 4-leaf)
level
The current level on the mesh network.
(0-invalid)
link_mesh
The number of downlink mesh nodes of the node.
link_non-mesh
The number of downlink non-mesh nodes of the node.
parent
The MAC address of the parent node.
AT+DATATESTRECYCLE
Important
This feature will take effect only when CONFIG_BK_WIFI_MESH_DEMO_CUSTOMER is enabled!
This feature is only for demonstration purposes, so the data transfer is limited to 180 bytes!
Explanation
This function merely provides a simple demo to demonstrate data interaction between a node in a mesh network and TCP/UDP devices that are under the same Access Point (AP).
This device can be either a TCP or UDP server or client, as long as the module can establish a TCP/UDP connection with it.
When using this command, you need to connect to the opposite end with the intended connection identity.
For example: if you want to use TCP Client on this module, you should set up a TCP Server externally first and obtain the IP address and port number.
Command
AT+DATATESTRECYCLE=type,domain,port,data
Parameters :
Parameters
Explanation
type
The network type that this module is to establish: 0: TCP, 1: UDP
domain
Peer URL or IP address
port
Peer port number
data
The data to be sent, less than 180 bytes.
Effect
You can see the data sent and received by the board on the SSCom side, and it prints continuously.
AT+BKMESH_IDATA_SEND
Important
This feature is only for demonstration purposes, so the data transfer is limited to 180 bytes!
Explanation
This feature merely provides a simple demo to demonstrate data interaction between a node on a certain layer within a mesh network and other nodes that are also part of the same mesh network. When using this command, you need to know the MAC address of the peer node's access point (AP).
Command
AT+BKMESH_IDATA_SEND=mac,data
Parameters :
Parameters
Explanation
type
receive node AP MAC address
data
The data to be sent, less than 180 bytes.
Effect
You can see the data sent and received by the board on the SSCom side and it prints.