BLE Mesh: Add group address to subscription list within same node (or element)

Dickson H.
Posts: 1
Joined: Sun Aug 04, 2019 10:40 am

BLE Mesh: Add group address to subscription list within same node (or element)

Postby Dickson H. » Sun Aug 04, 2019 11:26 am

Hi All,

I have 2 ESP32 development boards and they are implemented as a node (Node) and a provisioner/client (Provisioner) respectively.

Node: Based on: EXAMPLE ble_mesh_node https://github.com/espressif/esp-idf/tr ... _mesh_node
Provisioner: Similar to: EXAMPLE ble_mesh_provisioner_console https://github.com/espressif/esp-idf/tr ... rovisioner
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Issue 1:[Important]
Currently, Provisioner is able to
1. Add app key to Node
2. Bind app key to Node's generic onoff server
3. Set publish parameters on Node

And Provisioner cannot:
4. Add group address to Provisioner's generic onoff client

I have tried:
1. Modify subscription list of Provisioner 's generic onoff client which is part of the local comp data obtained by calling esp_ble_mesh_get_composition_data() [Results: No errors, but no effect]
2. Provisioner calls esp_ble_mesh_client_model_send_msg() which has element address to itself [Results:

Code: Select all

E (14629) BLE_MESH: model_send, Failed to check DST
E (14629) BLE_MESH: mod_sub, send failed (err -22)
E (14629) BLE MESH CONTROL: esp_ble_mesh_config_client_cb: Get node info failed
Question 1: How should the config client set configuration on other models within the same element (or node), especially for adding group address to the subscription list?
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Issue 2: [Not too important]
When Provisioner calls esp_ble_mesh_provisioner_add_unprov_dev(), it logs:

Code: Select all

E (8379) BT_GATT: GATT_SendServiceChangeIndication can't send service change indication manually, please configure the option through menuconfig
But if I changed the setting, it logs:

Code: Select all

W (20499) BT_GATT: gatt_ind_ack_timeout send ack now
Question 2: Does it affect the overall BLE Mesh network configuration at all?
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thank you in advance

Wangcheng
Posts: 73
Joined: Wed Mar 06, 2019 3:26 am

Re: BLE Mesh: Add group address to subscription list within same node (or element)

Postby Wangcheng » Mon Aug 05, 2019 6:15 am

Dickson H. wrote:
Sun Aug 04, 2019 11:26 am
Hi All,

I have 2 ESP32 development boards and they are implemented as a node (Node) and a provisioner/client (Provisioner) respectively.

Node: Based on: EXAMPLE ble_mesh_node https://github.com/espressif/esp-idf/tr ... _mesh_node
Provisioner: Similar to: EXAMPLE ble_mesh_provisioner_console https://github.com/espressif/esp-idf/tr ... rovisioner
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Issue 1:[Important]
Currently, Provisioner is able to
1. Add app key to Node
2. Bind app key to Node's generic onoff server
3. Set publish parameters on Node

And Provisioner cannot:
4. Add group address to Provisioner's generic onoff client

I have tried:
1. Modify subscription list of Provisioner 's generic onoff client which is part of the local comp data obtained by calling esp_ble_mesh_get_composition_data() [Results: No errors, but no effect]
2. Provisioner calls esp_ble_mesh_client_model_send_msg() which has element address to itself [Results:

Code: Select all

E (14629) BLE_MESH: model_send, Failed to check DST
E (14629) BLE_MESH: mod_sub, send failed (err -22)
E (14629) BLE MESH CONTROL: esp_ble_mesh_config_client_cb: Get node info failed
Question 1: How should the config client set configuration on other models within the same element (or node), especially for adding group address to the subscription list?
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Issue 2: [Not too important]
When Provisioner calls esp_ble_mesh_provisioner_add_unprov_dev(), it logs:

Code: Select all

E (8379) BT_GATT: GATT_SendServiceChangeIndication can't send service change indication manually, please configure the option through menuconfig
But if I changed the setting, it logs:

Code: Select all

W (20499) BT_GATT: gatt_ind_ack_timeout send ack now
Question 2: Does it affect the overall BLE Mesh network configuration at all?
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thank you in advance
Question 1: this is a example : provisioner configuration node's model to add subscrib address .

```c

static esp_ble_mesh_client_common_param_t msg_common = {
.ctx.net_idx = NETKEY_IDX,
.ctx.app_idx = APPKEY_IDX,
.ctx.send_rel = false,
.ctx.send_ttl = 2,
.msg_timeout = 0,

.ctx.addr = 0x0005,
.msg_role = ROLE_PROVISIONER,
};
static esp_ble_mesh_generic_client_set_state_t generic_set;

msg_common.opcode = ESP_BLE_MESH_MODEL_OP_MODEL_SUB_ADD;
msg_common.model = config_client.model;

cfg_set.model_sub_add.element_addr = PARAM(0);
cfg_set.model_sub_add.sub_addr = PARAM(1);
cfg_set.model_sub_add.model_id = PARAM(2);
cfg_set.model_sub_add.company_id = CID_NVAL;
if (param_num == 4) {
cfg_set.model_sub_add.company_id = PARAM(3);
}
err = esp_ble_mesh_config_client_set_state(&msg_common, &cfg_set);
if (err) {
ESP_LOGE(TAG, "Failed to send Config Model Subscription Add");
break;
}

```

Question 2: After the timeout, the device will be reconfigured again. So there will be no impact.

malikrahul2010
Posts: 2
Joined: Mon Jul 17, 2017 12:34 pm

Re: BLE Mesh: Add group address to subscription list within same node (or element)

Postby malikrahul2010 » Tue Jan 16, 2024 7:04 am

Hi All,

I am very new to BLE mesh. I am willing to know that how can a provisioner node create groups & can assign nodes to any of the group as & when needed?

Let us think for an example: I need to create 10 groups (From G0 to G9), each group can have max of 5 nodes and minimum can be 0. Where, I transmit any message at G0, all the nodes connected to G1 to G9 should respond And when I select any specific group (G1 to G9), the members connected to that group should respond.

Although, I can send data to any of the device with unicast address.

It would be great if anyone can help me in with a basic code snippet. I am using ESP-IDF framework version 5.1.1.

Your immediate help is deeply appreciated.

Thankyou,
Rahul Malik

Who is online

Users browsing this forum: No registered users and 122 guests