The proxy protocol is designed to enable nodes to send and receive the Bluetooth Mesh network packets over a connection-oriented bearer. For example, a node could support GATT but not be able to advertise the Mesh Message AD Type. This node will establish a GATT connection with another node that supports the GATT bearer and the advertising bearer, using the Proxy protocol to forward messages between these bearers.
The proxy protocol defines two roles: the Proxy Server and the Proxy Client.
The Proxy Server is a node that supports a mesh bearer using the Proxy protocol and at least one other mesh bearer. For example, the Proxy Server can forward mesh messages between the advertising bearer and the GATT bearer.
The Proxy Client supports a mesh bearer using the Proxy protocol. For example, the Proxy Client can use the GATT bearer to send mesh messages to a node that supports the advertising bearer.
The proxy server uses a filter to decide if to forward the message to the proxy client or not. There are 2 types of filters could be used - white list or black list.
A white list filter has an associated white list, which is a list of destination addresses that are of interest for the Proxy Client. The white list filter blocks all destination addresses except those that have been added to the white list.
A black list filter has an associated black list, which is a list of destination addresses that the Proxy Client does not want to receive. The black list filter accepts all destination addresses except those that have been added to the black list.
The white list filter with an empty list is the default filter type. The Proxy Client can change the filter type as well as configure the addresses in the proxy filter.
The example is based on the light example which is available in the Bluetooth Mesh SDK. The light example is a proxy server which can be connected to forward Bluetooth Mesh network packets to the proxy client. With modification, the proxy client light will disable the PB-ADV bearer and rely on a proxy server to communicate with the network. For demonstration, 3 nodes are needed in the example - one light, one switch and the proxy client light. Because the PB-ADV bearer is turned off, the proxy client light node cannot receive any commands from the switch directly unless it connects to a proxy server node which is the original light node in this setup.
Figure 1 shows how the 3 nodes network works.
Figure 1. Network Topology
After the proxy client node being provisioned, it needs to find a proxy server to communicate with the network. For the proxy server nodes, once they are provisioned with PB-GATT bearer or explicitly enabled the proxy feature, they will start advertising with Mesh Proxy Service immediately. So there must be a way for the proxy client to identify if the advertising node is in the same network or not, is the target node or not? The advertisement sent by proxy server nodes has 2 types of payload for the client nodes to parse and decide if to connect - Network ID and node identity, both of which are encrypted. Currently, the SDK doesn't provide a way to decrypt the payload for application layer, so we probably need some other ways to identify the target server node. In the example, it provides 2 workarounds:
NOTE, this is only the limitation for the time being, this should be deprecated when the SDK exposes the APIs for parsing the encrypted payload.
You need to provision both nodes and configure them properly before you can verify the functionality. Basically, you need 2 addresses to let the node publish to and subscribe from, follow the setup in below picture.
Figure 2. Typical Setup
The work flow of the proxy client node shows in figure 3.
Figure 3. Work Flow
Figure 4. LCD Status
In the above example, I have couple of doubts, requesting some one to help me if possible.
6. Find a Bluetooth scanner to scan for the proxy server advertisement and record the 8 bytes encrypted network ID in the payload.
"How to find this network ID because the one that is mentioned in the attachment app.c is :
[dummy_network_id = "\x54\x3b\xeb\x54\x36\x5a\xa1\x0d"; ]
and the one I am finding in the BT Mesh app is a 16 digit number. please suggest which one is network ID as I didn't find any n/w ID in app.
[ "\xC6\x44\x43\x43\xD8\x8A\x7A\x26\x69\xD8\x9C\x3E\xA8\x62\xB8\x15" ]
7.Get the BD_ADDR of the light node which is the proxy server, e.g. using Simplicity Commander or a Bluetooth scanner etc.
: Is this the MAC address of the device ?
Please check the attached image and your reply will be highly appreciated.
Figure 1 showing using PB-gatt and PB-adv for communication
isnt PB-gatt and PB-adv for provisioning only ? we should be using gatt-bearer and adv-bearer instead?
any help would be really appreciated
Hi YU zhu,
The Proxy Service is used with the PB-GATT too: https://www.silabs.com/community/wireless/bluetooth/knowledge-base.entry.html/2018/11/07/advertising_setsuse-VOOO