Understanding the basic principles of Bluetooth mesh models can be important to any developer. Bluetooth mesh models allow us to define the basic functionality of the network nodes.
Since there are extensive documents from Bluetooth SIG and chip manufacturers that can be consulted for detailed information about different models, in this article, we’ll attempt to introduce you to the basic concepts in a more approachable manner.
Interoperable Communications—A Bluetooth Mesh Solution
Standardization of communication protocols is mandatory to create an interoperable solution where devices from different vendors can communicate seamlessly. For example, the physical layer of BLE (Bluetooth Low Energy) uses 40 RF channels with 2 MHz center-to-center spacing as depicted in Figure 1 below.
Figure 1. BLE’s RF channels. Image used courtesy of Farej and Saeed
Manufacturers of BLE chips need to design their hardware based on the above RF channels (and in accordance with other specifications of the standard) to be able to communicate with products from other vendors.
Interestingly, Bluetooth mesh attempts to achieve interoperability across every layer of the communications stack from the radio hardware to the application-level features. But what does interoperability at the application level mean? Bluetooth mesh attempts to provide a standard way of describing the user-level behavior and functionality of a node. This is achieved through Bluetooth mesh models.
What is a Bluetooth Mesh Model?
Bluetooth mesh models provide us with a standard way to describe what a device can do and how we can communicate with it. To better understand their purpose, let’s consider different types of lights that might be found on a Bluetooth mesh network.
In general, lights can have different capabilities. Some of them are simple devices and support only the basic on/off feature. Other more sophisticated lights, on the other hand, can have one or more adjustable parameters like lightness level, color, and color temperature. Depending on the features supported by a given light, there are different parameters that should be set by the user. Bluetooth mesh models are specifications for software components that provide us with standard messages to communicate with these different light types and set their parameters as needed.
For example, the Light Lightness Server and Client models (example in Figure 2) from the Bluetooth mesh specification describe the standard software components that can be used when working with dimmable light sources.
Figure 2. An example of a Light Lightness model. Image used courtesy of Nordic Semiconductor
Through these models, the standard describes what a mesh device can do and how we should communicate with it. While we considered different types of lights to explain what a model is, it should be noted that Bluetooth mesh has models for a wide range of device types such as sensors, batteries, and switches, as well as models for timing and scheduling.
Bluetooth Mesh Model Example—Lighting Control System
Let’s consider a simple example to see how models are used. The most basic Bluetooth mesh lighting control system consists of a light source that can be switched on/off by a switch. In order to describe the functionality of these simple light sources and switch nodes, we can use two basic models from the Bluetooth mesh standard: the Generic OnOff Server model and the Generic OnOff Client model. These two models together make it possible for one device to switch other devices on or off.
In this case, the Generic OnOff Server model should be implemented in the light source, whereas the Generic OnOff Client model should be used in the switch. This client-server relationship is a core concept in Bluetooth mesh models where every client model has a corresponding server model and vice versa.
A server model reveals the current state of a device. Devices with client models can change the state of the nodes that use the corresponding server models. In our simple lighting control example, the light source uses the Generic OnOff Server model. Therefore, a switch with the corresponding client model (Generic OnOff Client model) can read the current state of the light source (either on or off) and switch it on/off as needed.
The Generic OnOff Server model has only one state: the Generic OnOff state. This parameter reveals whether the light is on or off. A value of 0x00 means that the light is off, whereas a value of 0x01 means that it is on. The switch that implements the Generic OnOff Client model can send messages such as Generic OnOff Get, Generic OnOff Set, and Generic OnOff Set Unacknowledged messages, to change or request the current state of the light.
Note that server models are also used in sensor nodes. In this case, the state of the server node (the sensor measurement) can be read by a corresponding client node but it cannot be changed by the client node. In addition to switches, Bluetooth mesh dimmers also use client models.
Revisiting Bluetooth Mesh Node Composition
In a previous article, we learned that the independently addressable parts of a Bluetooth mesh node are called elements. Bluetooth mesh models are associated with elements within a node. One or more models are included in each element to specify the element’s functionality. Figure 3 shows two example nodes with their associated elements and models.
Figure 3. Example nodes (a) for a dimmable bulb and (b) for a dimmable bulb with an occupancy sensor. Image used courtesy of Cypress.
Figure 3(a) shows a dimmable bulb with only one element. The functionality of a dimmable light can be described by the Light Lightness Server and Light Lightness Client models. The Light Lightness Server model should be implemented in the luminaire and the Light Lightness Client model should be implemented in the dimming device.
Meanwhile, Figure 3(b) shows a dimmable light bulb with an integrated occupancy sensor. In this case, the node consists of two elements and each element uses its own model (Light Lightness Server model and Sensor Server model).
Bluetooth Mesh Model Groups
Bluetooth mesh defines 52 standard mesh models that can be categorized into four different groups:
- Time and scenes
Below we’ll cover some of the basics of each model type.
Generic models are those that might be useful with different kinds of mesh devices. For example, the Generic OnOff Server and Client models can be used to turn different types of devices, including lighting devices, on or off. The generic models are listed in Figure 4.
Figure 4. A list of the generic models. Image courtesy of Bluetooth.
Two other important models from this group are the Generic Level Server and Client models. These models can be used with devices that have an adjustable parameter and need level control (e.g., with a thermostat that adjusts the room temperature). As the term generic reveals, these are general models that can be used with different types of adjustable devices. Although it is possible to use these models with dimmable lights, Bluetooth mesh has specialized models for this job. This is due to the fact that the light level perceived by the human eye is different from the actual measured light level. To address this issue and meet other surprisingly complicated requirements of lighting applications, Bluetooth mesh has included several different lighting models.
Bluetooth mesh has lighting models that support sophisticated, modern lighting systems. Lighting models of Bluetooth mesh enable control of different characteristics of a lighting product, such as:
- Lightness range
- Chromaticity coordinates, and more.
These lighting models are shown in Figure 5.
Figure 5. A list of the lighting models. Image courtesy of Bluetooth.
For example, the Light Lightness Server and Client models allow us to provide a smooth, dimming experience that is friendly to the human eye. The lighting models aim to extend Bluetooth mesh capabilities beyond that of a simple wireless connectivity solution and make it a potential solution for the future lighting industry.
Sensor, Scene, and Time Models
Sensor models allow a sensor to communicate with other nodes on the network. Scenes are models that enable memorizing states of a collection of different types of devices (e.g., light level or color of different lights). These stored states can be restored on-demand or based on a preset schedule. For example, you can use the scene feature to put the lights of a room into the perfect state for a presentation.
With time models, an accurate system time can be propagated to nodes across the network. This can enable triggering state changes on a scheduled basis.
Models Can Be Optional Beyond Foundational Models
In addition to the models discussed above, there are a few other models classified as foundation models. These models are concerned with enabling the configuration and management of the Bluetooth mesh network and the devices it contains.
While the foundation models are mandatory, the remaining models are optional. For example, TI’s Bluetooth mesh solutions do not currently support any of the lighting, time, and scenes models. If the Bluetooth chip supplier’s SDK (software development kit) doesn’t support a given model, the firmware developers will have to develop the required models themselves, which can significantly increase the time-to-market for your product.
To see a complete list of my articles, please visit this page.