Topics

[Bluetooth Mesh] How is the correct way to make a self provision #zephyrbluetoothmesh #bluetoothmesh

Lucas Peixoto
 
Edited

Hello, I need help to understand what is the correct way to make a self provision. I have two boards(nrf52_pca10040) and them will be provisioned on the same network to make some tests. So far I was using my phone(nRF mesh) to make the provision. However this approach was delaying the development, so I decided use self provision. Reading some examples like bluetooth/mesh_demo I implemented this:





Below I show the necessary elements and srv models to solve my problem:



The problem is that when I flashed the firmware I got this:



"Advertising failed: err -22" and "Failed to avertise using Network ID" keep happening all the time, in loop.  So what I need to do to solve this?

@EDIT: err -22 is related to "Invalid Argument" according to the errno.h, but I don't know exactly which one.

Johan Hedberg
 

Hi Lucas,

It looks like you’ve enabled CONFIG_BT_SETTINGS, but are not calling settings_load() in your app. It might explain the behaviour you’re seeing, since you’re effectively leaving the stack partially uninitialised without an identity address. Since you mentioned the mesh_demo app, you could e.g. look at where/how it calls settings_load().

Johan

On 21 Mar 2019, at 20.34, Lucas Peixoto <@lucaspeixotoac> wrote:

[Edited Message Follows]

Hello, I need help to understand what is the correct way to make a self provision. I have two boards(nrf52_pca10040) and them will be provisioned on the same network to make some tests. So far I was using my phone(nRF mesh) to make the provision. However this approach was delaying the development, so I decided use self provision. Reading some examples like bluetooth/mesh_demo I implemented this:

<bt_ready.png>
<self_configure1.png><self_configure2.png><self_provision.png>


Below I show the necessary elements and srv models to solve my problem:

<elements_models.png>

The problem is that when I flashed the firmware I got this:

<log_self_provision.png>

"Advertising failed: err -22" and "Failed to avertise using Network ID" keep happening all the time, in loop. So what I need to do to solve this?

@EDIT: err -22 is related to "Invalid Argument" according to the errno.h, but I don't know exactly which one.

Lucas Peixoto
 

Interesting, I was using this CONFIG_BT_SETTINGS because I got it on other project. I did what you said and the errors were gone, thank you, apparently is working. One more thing, this messages "<wrn> bt_mesh_cfg_cli: Unexpected App Key Status message" are normal or is missing something?

Johan Hedberg
 

Hi Lucas,

(added zephyr-devel back to CC since this info may benefit others as well)

On 21 Mar 2019, at 21.29, Lucas Peixoto <@lucaspeixotoac> wrote:
Interesting, I was using this CONFIG_BT_SETTINGS because I got it on other project. I did what you said and the errors were gone, thank you, apparently is working. One more thing, this messages "<wrn> bt_mesh_cfg_cli: Unexpected App Key Status message" are normal or is missing something?
No, that’s normal. It means you used the configuration client API without requesting it to wait for the response messages from the (local) configuration server. In that case the client code considers the responses unexpected since it didn't saved any context for the pending request.

Johan