BLE MESH
The article, )
4. Bluetooth Mesh Nodes
There are four types of network nodes:
A Relay Node receives and retransmits Bluetooth mesh messages using the advertising bearer. The disadvantage of relay nodes is that they must always keep the alert state, which will greatly increase power consumption. It has little effect on applications powered by main power such as smart lighting, but it is a big problem for battery-powered nodes such as switches incorporated into the network.
l Low Power Nodes (LPN)
Low power nodes use the standard power-saving features of Bluetooth Low Energy (that is keeping sleep state for a long time), so they can run for a long time through battery or energy harvesting. LPNs work in tandem with Friend node, one which is not power-constrained (e.g.it has a permanent AC power source). The Friend stores messages addressed to the LPN and delivers them to the LPN whenever the LPN polls the Friend node for “waiting messages”. When the LPN enters the receiving mode (according to a predetermined schedule), it receives the stored message and follows the instructions, then returns to the energy-saving sleep mode.
l Friend Nodes
A Friend Node can store and later forward messages addressed to an associated Low Power Node. When a Low power node wakes up and polls a Friend node, Friend will transmit these messages to the relevant Low power node. Friend nodes will occupy more memory than other types of nodes because it needs to store messages for one or more Low power nodes. The required memory size depends on the amount of data /commands that need to be stored in Friend nodes and sent to Low power nodes during polling operations.
l Proxy Nodes
The Proxy Node is the key to enabling non-mesh Bluetooth Low Energy devices (such as a mobile phone) to be part of a Bluetooth mesh network. Proxy nodes expose a GATT interface which Bluetooth LE devices may use to interact with a mesh network. A Proxy Node can receive messages over one bearer (advertising or GATT) and retransmit them over the other (advertising or GATT). The fundamental purpose of the Proxy Node is to perform bearer conversion. It can convert from the advertising bearer to the GATT bearer and vice versa. Therefore, a device which does not support the advertising bearer may instead send and receive various types of Bluetooth mesh messages over a GATT connection. For example, the function is useful when the user wants to use a traditional smart phone to control a smart lighting network. The interaction is realized through GATT data transmission of the node and the device.
The figure provides an example of a simple Bluetooth mesh network. In this example, most nodes, such as the light bulbs, are mains powered and can continuously scan the advertising channels for incoming messages. Some of these nodes may also support the relay, proxy and friend features. Furthermore, in the topology of this example, the low-power temperature sensor uses the low-power feature and is
assisted by one of the mains-powered nodes that has the friend feature implemented. Similarly, a smartphone that has no support for the advertising bearer communicates with the mesh network via a node that supports the proxy feature.
In addition, the new node must be configured before joining the mesh network so as to ensure that the new device is a trusted device and can access all nodes in the network. After entering, the MESH network assigns addresses, device types and device keys for the new node. Then the device key is used to establish a secure channel to configure new nodes. In theory, the Bluetooth MESH network can support up to 32,000 nodes.
5. Bluetooth MESH Architecture
The Bluetooth mesh network uses "flooding" technology to send messages in the network (It is similar to the way the virus spreads). Each data packet is forwarded to other nodes in the network until the message reaches the target node. Message broadcast can be for a single node, a group of nodes and all nodes. For example, we can define all the lights in a single room as a group address. The Bluetooth mesh specification defines four fixed group addresses: "All-Proxies ", "All-Friends", "All-Relays " and "All-nodes". (LPN does not have the function of forwarding messages, because it has to maintain low power consumption.)
The flooding mesh architecture and the choice of group address enhance the support of Bluetooth mesh network for smart home applications. For example, if the Gateway device in the MESH network receives the "ON" command, which can be quickly broadcast to the entire network through the MESH network. Each node device in the network receives the command and takes action accordingly, the lights in the target group can be turned on immediately.
Compared with the star network, the minimum waiting time of the average receiving data for the MESH network nodes is much lower than that of the star network. Because the central device is required to send a separate command to each connected bulb in the star network. And the CPU needs to send commands to all sub-devices in time intervals.
There are some differences between Bluetooth MESH and traditional Bluetooth. All mesh data will only be transmitted on three advertising channels 37, 38, and 39. It has its advantages and disadvantages. The advantage is high efficiency and simple transmission way. And the disadvantage is that it reduces network bandwidth and increases the risk of congestion.
There are two methods for the MESH network to handle congestion: the first is the TTL (Time To Live), which defines how many times a specific packet can be forwarded (typically three steps). The second is the network cache. The device will only broadcast once after capturing a forwarded data packet. The device will not forward it further when it receives the same information packet broadcast by other devices next time.
Developers can also use optional group delivery routes and retain the relay function. After the setting, the node can receive data packet, but cannot transmit it. Therefore, the flexibility of the node will become poor.
6. BLE MESH Model
The concept of MESH model is similar to the concept of Bluetooth profile. The model specifies a public information structure, which can contain one or more services (the concept of model is used to define terminal devices).
The model contains the specific behaviors and services of nodes, and defines a set of status and messages that act on the status. The standard model can work in the typical applications, such as device configuration, sensor readings and lighting control. And developers can also create custom models.
The models in the nodes are arranged by elements. Each element acts as a virtual entity in the mesh with a unique address, and each incoming message is processed by the model in the element.
Different models interact with each other through "publish and subscribe". The publishing node sends a message, and the node configured to subscribe will process it after receiving the message.
In following figure, we can see that the node “Switch 1” is publishing to group address Kitchen. Nodes Light 1, Light 2, and Light 3 each subscribe to the Kitchen address and therefore receive and process messages published to this address. In other words, Light 1, Light 2, and Light 3 can be switched on or off using Switch 1.
Switch 2 publishes to the group address Dining Room. Light 3 alone subscribed to this address and so is the only light controlled by Switch 2. Note that this example also illustrates the fact that nodes may subscribe to messages addressed to more than one distinct address. This is both powerful and flexible.
Similarly, notice how both nodes Switch 5 and Switch 6 publish to the same Garden address.
7. Bluetooth Mesh Configuration Network
The following figure is an example of a complete configuration network subscription. The process is the standard process for Bluetooth MESH configuration network registration equipment. In the beginning, the bulb sends a signal to the MESH network to inform that it is looking for a network to join. The configuration node authenticates the light bulb beacon and invites it to join the network. If the authentication is successful, the device will be provided with the necessary keys and addresses to join the network and prepare for configuration. Then the light bulb is provided with the "home automation" APP key. It will set the publishing status of the "OnOff server" (control light bulb), and finally add the subscription to the "light group".
8. Bluetooth MESH Applications
Based on the preliminary statistics of SIG certified products, it is found that the applications of BLE MESH are mainly concentrated in smart homes and lighting control applications, with lighting control accounting for 60%, smart homes accounting for 30%, and the last 10% belonging to the original manufacturer chip certification and niche market application. BLE MESH is undoubtedly the biggest competitor of ZigBee.