Trouble with ESP32 BLE Mesh Provisioning and Communication.

harish89
Posts: 3
Joined: Fri Aug 25, 2023 3:35 am

Trouble with ESP32 BLE Mesh Provisioning and Communication.

Postby harish89 » Tue Mar 05, 2024 4:22 pm

Hi ESP community,

I have two ESP32 provisioners for creating a mesh network. Initially, I provisioned a device using the first provisioner and then attempted to add a new device into the existing mesh network using the second provisioner. However, the newly provisioned device is unable to communicate with those devices provisioned by the first provisioner. It's worth noting that I'm using the same Net Key, App Key, and index values as those used in the first provisioner. Any insights on what might be causing this issue would be greatly appreciated.

Thank you!

chegewara
Posts: 2240
Joined: Wed Jun 14, 2017 9:00 pm

Re: Trouble with ESP32 BLE Mesh Provisioning and Communication.

Postby chegewara » Wed Mar 06, 2024 9:40 am

Hi,
are you sure you sure using the same net, app keys and idx?

Also remember to set second provisioner start address somehow higher than the first one to give both some pool of unicast addresses to assign.

This is how it looks like on my test rig when i set "static" keys:

Code: Select all

I (859) BLE_MESH: NetKeyIndex 0x000, NID 0x12
I (860) BLE_MESH: NetKey c5958a5ac895ee198a2495256d59a97b <----------- right after call esp_ble_mesh_provisioner_prov_enable
I (866) BLE_MESH: Primary address 0x0001, element count 1
I (875) NET KEY: 0x3fcbe9a0   c5 95 8a 5a c8 95 ee 19  8a 24 95 25 6d 59 a9 7b  |...Z.....$.%mY.{|
I (885) BLE_MESH: NetKey 5463144a3c4af3c698ac3d5d07797527, net_idx 0x000 <--------- then i update net key with "esp_ble_mesh_provisioner_update_local_net_key(new_net_key, 0)"
I (902) NET KEY: 0x3fcbe9a0   54 63 14 4a 3c 4a f3 c6  98 ac 3d 5d 07 79 75 27  |Tc.J<J....=].yu'|
I (912) APP KEY: 0x3fcbeb2a   a5 cc 2a 1a d2 99 06 7b  8f 39 8a f3 e0 11 22 9c  |..*....{.9....".|

harish89
Posts: 3
Joined: Fri Aug 25, 2023 3:35 am

Re: Trouble with ESP32 BLE Mesh Provisioning and Communication.

Postby harish89 » Wed Mar 20, 2024 1:55 am

Hi, thanks for the reply.

I understood what you're saying and tried it, but I haven't had any luck.
Could you please clarify if I need to add NetKey and AppKey to the provisioner? Because I don't think it's required.
And Is there any other parameter I need to take care of?

It would be great if you're helping me to resolve this issue.
Thanks.

chegewara
Posts: 2240
Joined: Wed Jun 14, 2017 9:00 pm

Re: Trouble with ESP32 BLE Mesh Provisioning and Communication.

Postby chegewara » Fri Mar 22, 2024 1:03 am

Ok,
so, you said you have 2x esp32 as a provisioner, but you didnt explain how you create NetKey and AppKeys on each of them.

Because of that, i only tried to explain you that both esp32 have to share exactly the same NetKey and AppKeys, so the provisioned nodes are considered to be in the same mesh network.

That will solve only part of the problem.
More drawbacks of having few provisioners:
- each of provisioner shall have different unicast address, and its best if they are far away from each other
- each provisioner can have a pool of unicast addresses which can assign during provisioning
- if you dont exchange data about provisioned devices, then each provisioner can control only the devices which are provisioned by it, because of lack of DevKeys
- yes, if all is correctly setup, then all devices provisioned by each provisioner can communicate within a mesh, as long as they are using the same NetKey and AppKeys (and of course IV)

To learn more about this topic i am suggesting to test with 2 smartphones with nrf mesh. There is option to export/import network data.

Who is online

Users browsing this forum: No registered users and 190 guests