Page 1 of 1

Provisioning with ADV using ble_mesh api

Posted: Thu Jul 04, 2019 2:16 pm
by jokockx
Hello, I'm currently working on a provisioner node using the esp-idf. For this I would like to use ADV provisioning messages instead of GATT, but using the example in esp-idf/examples/bluetooth/esp_ble_mesh/ble_mesh_provisioner/ I'n unable to do so. I got quite lost in the api. I found that the choice for the GATT bearer originated in the function btc_mesh_prov_cb_handler, but I'm unable to find where its input argument btc_msg_t *msg origninates from.

It would be nice if someone could help me on my way with the api or could explain me which parameters in the initialization of the mesh stack would accomplish using the ADV bearer. Thanks in advance,

Re: Provisioning with ADV using ble_mesh api

Posted: Fri Jul 05, 2019 7:38 am
by Wangcheng
jokockx wrote:
Thu Jul 04, 2019 2:16 pm
Hello, I'm currently working on a provisioner node using the esp-idf. For this I would like to use ADV provisioning messages instead of GATT, but using the example in esp-idf/examples/bluetooth/esp_ble_mesh/ble_mesh_provisioner/ I'n unable to do so. I got quite lost in the api. I found that the choice for the GATT bearer originated in the function btc_mesh_prov_cb_handler, but I'm unable to find where its input argument btc_msg_t *msg origninates from.

It would be nice if someone could help me on my way with the api or could explain me which parameters in the initialization of the mesh stack would accomplish using the ADV bearer. Thanks in advance,
Hi ,
In the demo(ble_mesh_provisione):
this line of code indicates that both PD-ADV and PB-GATT bearer are enabled at the same time, that is, the two types of channels can be used simultaneously.
`esp_ble_mesh_provisioner_prov_enable(ESP_BLE_MESH_PROV_ADV | ESP_BLE_MESH_PROV_GATT);`

Re: Provisioning with ADV using ble_mesh api

Posted: Fri Jul 05, 2019 9:54 am
by jokockx
Problem not resolved yet.

Re: Provisioning with ADV using ble_mesh api

Posted: Fri Jul 05, 2019 11:35 am
by jokockx
Wangcheng wrote:
Fri Jul 05, 2019 7:38 am
jokockx wrote:
Thu Jul 04, 2019 2:16 pm
Hello, I'm currently working on a provisioner node using the esp-idf. For this I would like to use ADV provisioning messages instead of GATT, but using the example in esp-idf/examples/bluetooth/esp_ble_mesh/ble_mesh_provisioner/ I'n unable to do so. I got quite lost in the api. I found that the choice for the GATT bearer originated in the function btc_mesh_prov_cb_handler, but I'm unable to find where its input argument btc_msg_t *msg origninates from.

It would be nice if someone could help me on my way with the api or could explain me which parameters in the initialization of the mesh stack would accomplish using the ADV bearer. Thanks in advance,
Hi ,
In the demo(ble_mesh_provisione):
this line of code indicates that both PD-ADV and PB-GATT bearer are enabled at the same time, that is, the two types of channels can be used simultaneously.
`esp_ble_mesh_provisioner_prov_enable(ESP_BLE_MESH_PROV_ADV | ESP_BLE_MESH_PROV_GATT);`
For some reaon the provisioner keeps using GATT even though I changed the configuration to

Code: Select all

esp_ble_mesh_provisioner_prov_enable(ESP_BLE_MESH_PROV_ADV);

Re: Provisioning with ADV using ble_mesh api

Posted: Fri Jul 05, 2019 2:17 pm
by jokockx
Thank you for the reply, but my problem isn't resolved yet. I want to provision my nodes using the advertising channel only and removing gatt in the proposed line doesn't change anything to the provisioning bearer. I succeeded in backtracing the api some more but now I think this not possible at all even though this funcitonality should be present in a certified api. What am I missing?

Re: Provisioning with ADV using ble_mesh api

Posted: Mon Jul 08, 2019 7:37 am
by jokockx
I'm going to formulate my question somewhat clearer hoping to get an answer which could help me further.

So, I'm working on a ble mesh provisioner using the esp-idf. I would like to provision my nodes using PB-ADV only, but untill now I'm unable to do so. I'm using the example code esp-idf/examples/bluetooth/esp_ble_mesh/ble_mesh_provisioner/ and I did already changed the line in the function ble_mesh_init, which should enable the bearers, to the line below:

Code: Select all

esp_ble_mesh_provisioner_prov_enable(ESP_BLE_MESH_PROV_ADV);
//instead of
//esp_ble_mesh_provisioner_prov_enable(ESP_BLE_MESH_PROV_ADV | ESP_BLE_MESH_PROV_GATT);
Despite this, my esp32 keeps opening a PB-GATT link to provision the encountered unprovisioned device as shown in the monitoring output below:

Code: Select all

I (52855) ble_mesh_provisioner: ESP_BLE_MESH_PROVISIONER_RECV_UNPROV_ADV_PKT_EVT
I (52855) ble_mesh_provisioner: address: db05481fc4fb, address type: 1, adv type: 0
I (52855) ble_mesh_provisioner: device uuid: 05f60001000000002abba58015936329
I (52865) testing: oob info: 0, bearer: PB-GATT
I (52875) ble_mesh_provisioner: ESP_BLE_MESH_PROVISIONER_ADD_UNPROV_DEV_COMP_EVT, err_code 0
I (57365) ble_mesh_provisioner: PB-GATT link open
W (61365) BT_APPL: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0016
I (61375) ble_mesh_provisioner: node index: 0x0, unicast address: 0x05, element num: 22, netkey index: 0x00
I (61375) ble_mesh_provisioner: device uuid: 05f60001000000002abba58015936329
I (61385) ble_mesh_provisioner: Node info: 0x0005
I (61395) ble_mesh_provisioner: PB-GATT link close, reason 0x16
I (61395) ble_mesh_provisioner: ESP_BLE_MESH_PROVISIONER_SET_NODE_NAME_COMP_EVT, err_code 0
I (61405) ble_mesh_provisioner: Node 0 name is: NODE-0

Re: Provisioning with ADV using ble_mesh api

Posted: Fri Jul 12, 2019 6:51 am
by jokockx
Nobody who can help me out on this?

Re: Provisioning with ADV using ble_mesh api

Posted: Fri Jul 12, 2019 10:35 am
by Wangcheng
jokockx wrote:
Fri Jul 12, 2019 6:51 am
Nobody who can help me out on this?
Hi jokockx,
1. You also check the selection Component config--"Bluetooth --" BLuetooth controller--"Scan Duplicate Type (Scan Duplicate By Device Address And Advertising Date)
2. You also check the selection Componet config--》Bluetooth--》Bluetooth controller--》BLE full scan feature supported.
3. I see from your log that the configuration device is successfully connected to the network.
ble_mesh_provisioner: node index: 0x0, unicast address: 0x05, element num: 22, netkey index: 0x00
4. Can you give me the log information for configuring the device to access the network using PB-ADV ?

Re: Provisioning with ADV using ble_mesh api

Posted: Fri Jul 12, 2019 1:39 pm
by jokockx
Wangcheng wrote:
Fri Jul 12, 2019 10:35 am
jokockx wrote:
Fri Jul 12, 2019 6:51 am
Nobody who can help me out on this?
Hi jokockx,
1. You also check the selection Component config--"Bluetooth --" BLuetooth controller--"Scan Duplicate Type (Scan Duplicate By Device Address And Advertising Date)
2. You also check the selection Componet config--》Bluetooth--》Bluetooth controller--》BLE full scan feature supported.
3. I see from your log that the configuration device is successfully connected to the network.
ble_mesh_provisioner: node index: 0x0, unicast address: 0x05, element num: 22, netkey index: 0x00
4. Can you give me the log information for configuring the device to access the network using PB-ADV ?
Thank you for your reply and for providing a solution! Apparantly, your suggestion to change the config Component config--"Bluetooth --" BLuetooth controller--"Scan Duplicate Type (Scan Duplicate By Device Address And Advertising Date) made my provisioner work. The initialization code I used is given below:

Code: Select all

static uint8_t match[1] = {0};
err = esp_ble_mesh_provisioner_set_dev_uuid_match(match, 0, 0x00, false);
err = esp_ble_mesh_provisioner_prov_enable(ESP_BLE_MESH_PROV_ADV);
Could you also explain why this single configuration is crucial?