This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Failed after configuring the slave multiple times

Nordic team,

mesh sdk:nrf5_SDK_for_Mesh_v1.0.1_src

example: light switch

The client repeatedly configures the server multiple times. After a few configurations, there will be a failure.

If there is more configuration after the configuration fails, the program will report an error.

I modified the following places:

Fullscreen
1
2
3
#ifndef PERSISTENT_STORAGE
#define PERSISTENT_STORAGE 0
#endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static void button_event_handler(uint32_t button_number)
{
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Button %u pressed\n", button_number);
// if (m_configured_devices == 0)
// {
// __LOG(LOG_SRC_APP, LOG_LEVEL_WARN, "No devices provisioned\n");
// return;
// }
// else if (m_configured_devices <= button_number && button_number != BUTTON_NUMBER_GROUP)
// {
// __LOG(LOG_SRC_APP, LOG_LEVEL_WARN, "Device %u not provisioned yet.\n", button_number);
// return;
// }
uint32_t status = NRF_SUCCESS;
switch (button_number)
{
case 0:
m_provisioned_devices = 0;
m_configured_devices = 0;
ERROR_CHECK(dsm_address_publish_remove(m_server_handles[0]));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Pressing button 0 will delete the server, then the server will be powered on again, and the client will configure the server again,This operation is repeated multiple times.

the error message :

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<t: 0>, main.c, 437, ----- BLE Mesh Light Switch Client Demo -----
<t: 0>, nrf_mesh_sdk.c, 187, Initializing softdevice
<t: 0>, nrf_mesh_sdk.c, 122, Initializing SoftDevice...
<t: 1>, nrf_mesh_sdk.c, 131, Ram base: 0x200019C0
<t: 14>, nrf_mesh_sdk.c, 197, Initializing mesh stack
<t: 292>, nrf_mesh_sdk.c, 205, Enabling mesh stack
<t: 296>, main.c, 183, Setting up access layer and models
<t: 183533>, provisioner.c, 283, Local provisioning link established
<t: 184963>, provisioner.c, 269, Using static authentication
<t: 195366>, provisioner.c, 278, Static authentication data provided
<t: 205854>, main.c, 408, Provisioning complete. Adding address 0x0100.
<t: 209541>, provisioner.c, 237, Local provisioning link closed
<t: 209543>, provisioner.c, 121, Getting composition data
<t: 234411>, provisioner.c, 324, Composition data: 0059000000000020000100000002010000020059000000
<t: 234414>, provisioner.c, 129, Adding appkey
<t: 246253>, provisioner.c, 138, Binding appkey to the Health model
<t: 248174>, provisioner.c, 150, Binding appkey to the Simple On/Off model
<t: 248829>, provisioner.c, 175, Setting publication address for the health server to 0x0001
<t: 251615>, provisioner.c, 197, Setting publication address for the On/Off server to 0x0001
<t: 253985>, provisioner.c, 206, Adding subscription
<t: 255582>, main.c, 371, Configuration of device 0 successful
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The configuration time will increase with the number of times until the configuration fails.

Three questions:

1.Configuration time, why is it longer than the previous one?

2.Why does it fail after multiple configurations? I tried the same result 20 times.

3.After the configuration fails, the next configuration is performed. At this time, the program will error.

How will I solve such a problem and give me some help?