Page 1 of 2

Multi client ble mesh

Posted: Wed Apr 06, 2022 11:52 am
by elDi@mond
Greetings smart people
I'm working with BLE Mesh, and have a trouble with several things:
First of all i used vendor example to crerate a server and client and everything looks fine, server find client and provide it to mesh.
But only one client, when i flash another one ESP32, it won't connect and server don't see it.
Next i tryied each model in example folder: sensor, fast_prov, on-off model, mesh_node... each of them connect only one client.
So i'm confused and don't know what i'm missing.

My question is: How to create mesh network where client will connect to server (or server will provide connection to mesh several times)

Re: Multi client ble mesh

Posted: Fri Apr 08, 2022 5:56 am
by elDi@mond
any ideas? i missing something? is there are identifier for client that should be unique?

Re: Multi client ble mesh

Posted: Mon Apr 11, 2022 9:59 am
by chegewara
In ble mesh you have 3 basic types of devices:
- provisioner
- client
- server
You can find also proxy and relay devices, but in this case its not important.

Provisioner is used to add clients and servers to mesh network by assigning address to each element in client/server (it is simplified description).
With provisioner you can add as many clients and servers as you want, but you have to remember you have to share data between provisioner devices if you want to use few.
From now on it gets more complicated, because you need some app which will configure your client/server device, unless you want to hardcode some values. The basic configuration is to route client devices to read/write values like on/off on selected server devices or group of devices, or even on all devices.

Here for example you have provisioner mixed with client node with hardcoded values, thats why you can provision only one additional node:
https://github.com/espressif/esp-idf/bl ... procedures

You can also start with nimble
https://github.com/espressif/esp-idf/tr ... le/blemesh

https://mynewt.apache.org/latest/networ ... tooth-mesh

Re: Multi client ble mesh

Posted: Mon Apr 11, 2022 11:49 am
by elDi@mond
Thank you @chegewara
My concept does not imply app which will configurate mesh network, so i gues i have to hardcode parametrs, could you point which of them i have to change

With best regards

Re: Multi client ble mesh

Posted: Mon Apr 11, 2022 11:54 am
by chegewara
https://github.com/espressif/esp-idf/bl ... through.md

Also there is some video from espressif on youtube demonstrating fast provisioning, and IIRC android app from espressif (maybe iOS too).

Re: Multi client ble mesh

Posted: Thu Apr 14, 2022 8:28 am
by elDi@mond
i'l still don't get it
which parametrs acting in provisioning, what should i change?
how provisioner perform provisioning?

Re: Multi client ble mesh

Posted: Thu Apr 14, 2022 12:31 pm
by elDi@mond
The provisioning process progresses through five steps:
Step 1. Beaconing
Step 2. Invitation
Step 3. Exchanging Public Keys
Step 4. Authentication
Step 5. Distribution of the Provisioning Data

So, how device start to beaconing?

Re: Multi client ble mesh

Posted: Thu Apr 14, 2022 11:06 pm
by chegewara

Code: Select all

esp_ble_mesh_node_prov_enable(ESP_BLE_MESH_PROV_ADV | ESP_BLE_MESH_PROV_GATT);
But this only works when node is unprovisioned. You should study docs (see note):
https://docs.espressif.com/projects/esp ... cal_resetv

Also all or many ble mesh examples have tutorial. I think it may be the best documented protocol on esp32.

Re: Multi client ble mesh

Posted: Fri Apr 15, 2022 10:45 am
by elDi@mond
chegewara wrote:
Thu Apr 14, 2022 11:06 pm

Code: Select all

esp_ble_mesh_node_prov_enable(ESP_BLE_MESH_PROV_ADV | ESP_BLE_MESH_PROV_GATT);
But this only works when node is unprovisioned. You should study docs (see note):
https://docs.espressif.com/projects/esp ... cal_resetv

Also all or many ble mesh examples have tutorial. I think it may be the best documented protocol on esp32.
i added at end of main_app next code

Code: Select all

if(esp_ble_mesh_node_is_provisioned()) {
        ESP_LOGI(TAG, "device allready provisioned");
    } else {
        err = esp_ble_mesh_node_prov_enable(ESP_BLE_MESH_PROV_ADV | ESP_BLE_MESH_PROV_GATT);
        if(err) {
            ESP_LOGE(TAG, "esp_ble_mesh_node_prov_enable failed: err = 0x%4x", err);
        } else {
            ESP_LOGI(TAG, "esp_ble_mesh_node_prov_enable succed: err = 0x%4x", err);
        }
    }
and get next log
W (2757) BLE_MESH: btc_ble_mesh_prov_call_handler, Unknown act 1I
(2767) BRICK_6_HUB: esp_ble_mesh_node_prov_enable succed: err = 0x 0
nothing happend...
So diging dipper in source code i found that part of code was disabled by #if derective. So i change in menuconfig Component config -> ESP BLE Mesh Support -> Support for BLE Mesh Node and turn it on. But now i get cyclic reboot with next error
assert failed: bt_mesh_prov_init prov.c:1773 (prov_info->uuid)

Backtrace:0x40081b5e:0x3ffd43d00x400913e1:0x3ffd43f0 0x4009661d:0x3ffd4410 0x4010a081:0x3ffd4530 0x40106c68:0x3ffd4550 0x400fe344:0x3ffd4570 0x401226c1:0x3ffd45e0 0x40123b05:0x3ffd4600 0x40093fd9:0x3ffd4620

UPD: Even if added code commented there are still cyclic reboot

Re: Multi client ble mesh

Posted: Wed Apr 20, 2022 12:35 pm
by elDi@mond
any ideas? i realy need help

How, using vendor model, i can increase node number, what should i change?

with best regards