ESP BLE Mesh v0.6 Released, SIG Certified

EddLeon
Posts: 5
Joined: Mon May 13, 2019 8:40 am

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby EddLeon » Sat May 18, 2019 5:18 pm

EddLeon wrote:
Fri May 17, 2019 3:10 pm
ESP_Island wrote:
Wed May 15, 2019 3:05 am
EddLeon wrote:
Mon May 13, 2019 3:20 pm
Hi Espressif,

I am currently trying to build a testing network with the ESP32 chips. I plan to have a bunch of nodes and configure them in such a way I can test out the Mesh flooding mechanism.

At this moment, I want to self-provision and self-configure nodes so I can deploy the mesh faster and make quick reconfigurations. The problem is that the API does not provide access to the functions to do so. (bt_mesh_cfg_app_key_add and bt_mesh_cfg_mod_app_bind; self-provision seems to work fine). I've been trying different ways but they all end up in kernel panics.

Would anyone be so kind to help me out here?

Kind regards,
Ed

Hi, EddLeon

For BLE Mesh unprovisioned devices entering network automatically, we have developed two test APIs (one for node, the other for provisioner). They are not released and currently used for the internal test, but you can test it if you need.

Following are the introductions about those two test APIs:

1. For Node

int ble_mesh_device_auto_enter_network(struct bt_mesh_device_network_info *info), the parameter includes the following info:

* Network key, Network key Index, flags, iv_index and unicast address (which can be assigned during provisioning)

* Device key

* Application Key and Application Key Index

* Group address

2. For Provisioner

int bt_mesh_provisioner_store_node_info(struct bt_mesh_node_t *node_info), the parameter includes the following info:

* node's name (max length 31 octets)

* Device UUID and oob_info

* unicast address, element number

* Network key Index, flags, iv_index

* Device key

Note:

1. Currently these two APIs are just for test.

2. Before Provisioner invokes the API bt_mesh_provisioner_store_node_info() to add node information, the followings need to done previously.

* Call esp_ble_mesh_provisioner_add_local_net_key() to add local Network Key (which is used by bt_mesh_provisioner_store_node_info())

* Call esp_ble_mesh_provisioner_add_local_app_key() to add local Application Key (which is used by bt_mesh_provisioner_store_node_info())

* Call esp_ble_mesh_provisioner_bind_app_key_to_local_model() to bind AppKey with Provisioner's models

3. The source files which contain these APIs.

* bt_mesh_device_auto_enter_network() -> components/bt/ble_mesh/mesh_core/test.c

* bt_mesh_provisioner_store_node_info() -> components/bt/ble_mesh/mesh_core/provisioner_main.c

* esp_ble_mesh_provisioner_add_local_net_key() -> component/bt/ble_mesh/api/core/esp_ble_mesh_networking_api.c

* esp_ble_mesh_provisioner_add_local_app_key() -> component/bt/ble_mesh/api/core/esp_ble_mesh_networking_api.c

* esp_ble_mesh_provisioner_bind_app_key_to_local_model() -> component/bt/ble_mesh/api/core/esp_ble_mesh_networking_api.c
Thanks so much for the info, I had seen already the provisioner's apis in your provisioner examples. I'll definitely take a look into the bt_mesh_device_auto_enter_network and bt_mesh_provisioner_store_node_info.

Once again, thanks!
Hi again!

How about self-binding app keys to models by nodes? With hard-coded keys of course without enabling provisioning regular nodes?

Regards,
Ed

ESP_Island
Posts: 36
Joined: Thu Jun 29, 2017 7:20 am

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby ESP_Island » Mon May 20, 2019 5:13 am

EddLeon wrote:
Sat May 18, 2019 5:18 pm
EddLeon wrote:
Fri May 17, 2019 3:10 pm
ESP_Island wrote:
Wed May 15, 2019 3:05 am
Thanks so much for the info, I had seen already the provisioner's apis in your provisioner examples. I'll definitely take a look into the bt_mesh_device_auto_enter_network and bt_mesh_provisioner_store_node_info.

Once again, thanks!
Hi again!

How about self-binding app keys to models by nodes? With hard-coded keys of course without enabling provisioning regular nodes?

Regards,
Ed

Hi, EddLeon

If you want to use APIs to bind AppKey or add group address to models locally, the following method can be used to achieve this goal:

1. Bind Appkey with models

The AppKey bound with models are listed in the array uint16_t keys[CONFIG_BLE_MESH_MODEL_KEY_COUNT], which is contained in the esp_ble_mesh_model_t struct. Users can use the pointer of models to access (add/remove/clear) the keys array directly.

Note: before doing this, users need to make sure that the corresponding application key has been added to the node, and the configuration message Config AppKey Add can be used for this.

2. Add group address to models' subscription lists

The group addresses are listed in the array uint16_t groups[CONFIG_BLE_MESH_MODEL_GROUP_COUNT], which is also contained in the esp_ble_mesh_model_t struct. Users can use the pointer of models to access (add/remove/clear) the groups' array directly.

EddLeon
Posts: 5
Joined: Mon May 13, 2019 8:40 am

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby EddLeon » Wed May 22, 2019 5:25 pm

ESP_Island wrote:
Mon May 20, 2019 5:13 am
EddLeon wrote:
Sat May 18, 2019 5:18 pm
EddLeon wrote:
Fri May 17, 2019 3:10 pm

Thanks so much for the info, I had seen already the provisioner's apis in your provisioner examples. I'll definitely take a look into the bt_mesh_device_auto_enter_network and bt_mesh_provisioner_store_node_info.

Once again, thanks!
Hi again!

How about self-binding app keys to models by nodes? With hard-coded keys of course without enabling provisioning regular nodes?

Regards,
Ed

Hi, EddLeon

If you want to use APIs to bind AppKey or add group address to models locally, the following method can be used to achieve this goal:

1. Bind Appkey with models

The AppKey bound with models are listed in the array uint16_t keys[CONFIG_BLE_MESH_MODEL_KEY_COUNT], which is contained in the esp_ble_mesh_model_t struct. Users can use the pointer of models to access (add/remove/clear) the keys array directly.

Note: before doing this, users need to make sure that the corresponding application key has been added to the node, and the configuration message Config AppKey Add can be used for this.

2. Add group address to models' subscription lists

The group addresses are listed in the array uint16_t groups[CONFIG_BLE_MESH_MODEL_GROUP_COUNT], which is also contained in the esp_ble_mesh_model_t struct. Users can use the pointer of models to access (add/remove/clear) the groups' array directly.
Hi once yet again,

It works, I've tested app_key binding.
Just to clarify, uint16_t keys[CONFIG_BLE_MESH_MODEL_KEY_COUNT] contains the app_idx of the previously stored AppKey (Note)

Thanks!

Regards,
Ed

Benbu2018
Posts: 5
Joined: Tue May 28, 2019 7:51 pm

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby Benbu2018 » Tue May 28, 2019 8:26 pm

Hi Espressif,
I am trying to build a simple mesh network with 2 ESP32 chips periodictly blinking the leds. One ESP32 is provisioner the other one is node, I use the code ble_mesh_provisioner and ble_mesh_node examples.
For the provisioner, I tried to create a new task in app_main() after the ble_mesh_init(). In the task function, it periodiclty calls two functions to send client onoff set message to the node:
esp_ble_mesh_set_msg_common(&common, node, onoff_client.model, ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET);
err = esp_ble_mesh_generic_client_set_state(&common, &set_state);
I tried to configure the parameters inside &common, &set_state. THe remote address is alwasy 0x0005 for the node, so I just fixed it. I also tried get the node information by calling the esp_ble_mesh_get_node_info(addr); However it always end up in kernel panics.
I want to check if there's something wrong with my code? Is there an API to initial these parameters?
Will be appreciated if anyone can give me some help!
Ben

ESP_Island
Posts: 36
Joined: Thu Jun 29, 2017 7:20 am

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby ESP_Island » Wed May 29, 2019 7:02 am

Benbu2018 wrote:
Tue May 28, 2019 8:26 pm
Hi Espressif,
I am trying to build a simple mesh network with 2 ESP32 chips periodictly blinking the leds. One ESP32 is provisioner the other one is node, I use the code ble_mesh_provisioner and ble_mesh_node examples.
For the provisioner, I tried to create a new task in app_main() after the ble_mesh_init(). In the task function, it periodiclty calls two functions to send client onoff set message to the node:
esp_ble_mesh_set_msg_common(&common, node, onoff_client.model, ESP_BLE_MESH_MODEL_OP_GEN_ONOFF_SET);
err = esp_ble_mesh_generic_client_set_state(&common, &set_state);
I tried to configure the parameters inside &common, &set_state. THe remote address is alwasy 0x0005 for the node, so I just fixed it. I also tried get the node information by calling the esp_ble_mesh_get_node_info(addr); However it always end up in kernel panics.
I want to check if there's something wrong with my code? Is there an API to initial these parameters?
Will be appreciated if anyone can give me some help!
Ben

Hi, Benbu

To initial these parameters without provisioning, I think the above answers to EddLeon's questions may help you. It is recommended to read the tutorials in the examples to have a better knowledge about it.

EddLeon
Posts: 5
Joined: Mon May 13, 2019 8:40 am

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby EddLeon » Wed Jun 05, 2019 11:59 am

Hi again Espressif,

I continue my development but would like to know if you could provide an example for a proper Sensor Server model, since the API only has direct functions for a SensorClient; my guess so far has been trying the generic ESP_BLE_MESH_SIG_MODEL macro.

I have been reading the BT-Mesh Model official documentation and it says that when SensorServer this model is present on an element, the corresponding Sensor Setup Server model shall also be present [section 4.3.1.1 of the MeshModel]. I'd like to know how to implement this with the ESP_API and if it's possible to do a "self-setup". Also, I would like to know if the SensorServer can periodically transmit packets based on the SensorCadence state (4.1.3) and/or if a publishing model is also needed (esp_ble_mesh_model_pub_t).

My objective is deploy mock nodes that simulate environment sensor traffic inside a building.

Kind regards,
Ed

ESP_Island
Posts: 36
Joined: Thu Jun 29, 2017 7:20 am

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby ESP_Island » Wed Jun 05, 2019 2:14 pm

EddLeon wrote:
Wed Jun 05, 2019 11:59 am
Hi again Espressif,

I continue my development but would like to know if you could provide an example for a proper Sensor Server model, since the API only has direct functions for a SensorClient; my guess so far has been trying the generic ESP_BLE_MESH_SIG_MODEL macro.

I have been reading the BT-Mesh Model official documentation and it says that when SensorServer this model is present on an element, the corresponding Sensor Setup Server model shall also be present [section 4.3.1.1 of the MeshModel]. I'd like to know how to implement this with the ESP_API and if it's possible to do a "self-setup". Also, I would like to know if the SensorServer can periodically transmit packets based on the SensorCadence state (4.1.3) and/or if a publishing model is also needed (esp_ble_mesh_model_pub_t).

My objective is deploy mock nodes that simulate environment sensor traffic inside a building.

Kind regards,
Ed

Hi, EddLeon

The Sensor Server Model is under development and it is about to finish. If you want to test it before its release, we can give you a patch for a pre-test.

Please give us your contact via BS Team .

jerome
Posts: 37
Joined: Wed Jan 23, 2019 2:28 pm

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby jerome » Wed Jun 05, 2019 2:30 pm

Dear All
Thanks for this release.

What is the esp-idf version included in the ESP BLE Mesh v0.6 branch ?
Is there a way to use esp-idf latest version on top of BLE mesh branch ?

Thanks to all.
Jerome

ESP_Island
Posts: 36
Joined: Thu Jun 29, 2017 7:20 am

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby ESP_Island » Thu Jun 06, 2019 3:39 am

jerome wrote:
Wed Jun 05, 2019 2:30 pm
Dear All
Thanks for this release.

What is the esp-idf version included in the ESP BLE Mesh v0.6 branch ?
Is there a way to use esp-idf latest version on top of BLE mesh branch ?

Thanks to all.
Jerome

Hi, Jerome

We use the master branch (in April) of the esp-idf. The commit id is c064e008424d6f87cc78ca93ed572d4b2ba346d9.

If you want to use the latest version esp-idf, you can try to rebase ESP BLE Mesh 0.6.1 branch to the latest esp-idf master branch, and resolve the conflicts (I'am not sure if there are many esp-idf breaking changes introduced from April).

Thanks,
Island

jerome
Posts: 37
Joined: Wed Jan 23, 2019 2:28 pm

Re: ESP BLE Mesh v0.6 Released, SIG Certified

Postby jerome » Fri Jun 14, 2019 2:12 pm

Dear All
I'm planning to use BLE mesh to send/receive custom customs buffers (max 64 bytes each) to/from a mobile app (provisionner) to multiple devices (ESP32) provisioned from the mobile app.
I'm new to mesh and cannot find any suitable model to send/receive customs buffers.
Anybody here could point me to the correct Mesh model to start with (so I can customize to send/receive buffers) ?
Thanks
Jerome

Who is online

Users browsing this forum: Baldhead and 90 guests