ESP32 esp-idf BLE Mesh Save/Delete Parameters

I have a question that I can not find my answer to.
I know that to save the BLE Mesh parameters and network configuration, I can check the Store BLE Mesh configuration in the “menuConfig”.
(*) Store BLE Mesh configuration persistently

so After resetting the ESP32 it’s restored automatically and my node is still joined to the network.
my question is
How can I delete the saved configuration and again save this configuration for a node?
I mean when my node joined to the network and that config save the network parameter to NVS flash how can I read that data and erase or rewrite it again?
Is there any function to manage it?
Does anyone know?

Seraching for that string in ESP-IDF leads you to the component where it’s declared and subsequently to CONFIG_BLE_MESH_SETTINGS being used in e.g.

And not long after that is

or just call bt_mesh_node_reset() that does that.

1 Like

thanks but I can not add it to the project

src/BLE_Mesh.c:113:13: error: implicit declaration of function ‘bt_mesh_clear_net’; did you mean ‘bt_mesh_conn_ref’? [-Werror=implicit-function-declaration]
the compiler does not know this lib.
and is it a true way? I think it’s the Sublayer libraries function Can I use them?


you need to include mesh_main.h

1 Like

Hi @maxgerhardt ,
I’m getting this error and the node is not getting unprovisioned.
can anyone please help me?
E (945) BLE_MESH: Failed to erase mesh/iv data (err 4359)
E (945) BLE_MESH: Failed to erase mesh/seq data (err 4359)
E (955) BLE_MESH: Failed to erase mesh/role data (err 4359)

Please ask at Issues · espressif/arduino-esp32 · GitHub with the code you’re using, I have no idea.