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:
#ifndef PERSISTENT_STORAGE #define PERSISTENT_STORAGE 0 #endif
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])); ERROR_CHECK(dsm_devkey_delete(m_devkey_handles[0])); provisioner_wait_for_unprov(UNPROV_START_ADDRESS+0); break; case 1: case 2: /* Invert LED. */ status = simple_on_off_client_set(&m_clients[button_number], !hal_led_pin_get(BSP_LED_0 + button_number)); break; case 3: /* Group message: invert all LEDs. */ status = simple_on_off_client_set_unreliable(&m_clients[GROUP_CLIENT_INDEX], !hal_led_pin_get(BSP_LED_0 + button_number), 3); break; default: break; } if (status == NRF_ERROR_INVALID_STATE || status == NRF_ERROR_NO_MEM || status == NRF_ERROR_BUSY) { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Cannot send. Device is busy.\n"); hal_led_blink_ms(LEDS_MASK, 50, 4); } else { ERROR_CHECK(status); } }
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 :
<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
<t: 297171>, main.c, 314, Button 0 pressed
<t: 461645>, provisioner.c, 283, Local provisioning link established
<t: 463458>, provisioner.c, 269, Using static authentication
<t: 473249>, provisioner.c, 278, Static authentication data provided
<t: 483982>, main.c, 408, Provisioning complete. Adding address 0x0100.
<t: 487707>, provisioner.c, 237, Local provisioning link closed
<t: 487710>, provisioner.c, 121, Getting composition data
<t: 546648>, provisioner.c, 324, Composition data: 0059000000000020000100000002010000020059000000
<t: 546651>, provisioner.c, 129, Adding appkey
<t: 567989>, provisioner.c, 138, Binding appkey to the Health model
<t: 570330>, provisioner.c, 150, Binding appkey to the Simple On/Off model
<t: 570901>, provisioner.c, 175, Setting publication address for the health server to 0x0001
<t: 573143>, provisioner.c, 197, Setting publication address for the On/Off server to 0x0001
<t: 585504>, provisioner.c, 206, Adding subscription
<t: 587090>, main.c, 371, Configuration of device 0 successful
<t: 653420>, main.c, 314, Button 0 pressed
<t: 801713>, provisioner.c, 283, Local provisioning link established
<t: 803571>, provisioner.c, 269, Using static authentication
<t: 812675>, provisioner.c, 278, Static authentication data provided
<t: 824108>, main.c, 408, Provisioning complete. Adding address 0x0100.
<t: 827686>, provisioner.c, 237, Local provisioning link closed
<t: 827688>, provisioner.c, 121, Getting composition data
<t: 966856>, provisioner.c, 324, Composition data: 0059000000000020000100000002010000020059000000
<t: 966860>, provisioner.c, 129, Adding appkey
<t: 968457>, provisioner.c, 138, Binding appkey to the Health model
<t: 969952>, provisioner.c, 150, Binding appkey to the Simple On/Off model
<t: 970875>, provisioner.c, 175, Setting publication address for the health server to 0x0001
<t: 973340>, provisioner.c, 197, Setting publication address for the On/Off server to 0x0001
<t: 985426>, provisioner.c, 206, Adding subscription
<t: 986779>, main.c, 371, Configuration of device 0 successful
<t: 1057574>, main.c, 314, Button 0 pressed
<t: 1161732>, provisioner.c, 283, Local provisioning link established
<t: 1162771>, provisioner.c, 269, Using static authentication
<t: 1172799>, provisioner.c, 278, Static authentication data provided
<t: 1184390>, main.c, 408, Provisioning complete. Adding address 0x0100.
<t: 1188035>, provisioner.c, 237, Local provisioning link closed
<t: 1188037>, provisioner.c, 121, Getting composition data
<t: 1780102>, provisioner.c, 324, Composition data: 0059000000000020000100000002010000020059000000
<t: 1780106>, provisioner.c, 129, Adding appkey
<t: 1791322>, provisioner.c, 138, Binding appkey to the Health model
<t: 1793196>, provisioner.c, 150, Binding appkey to the Simple On/Off model
<t: 1793865>, provisioner.c, 175, Setting publication address for the health server to 0x0001
<t: 1796590>, provisioner.c, 197, Setting publication address for the On/Off server to 0x0001
<t: 1799075>, provisioner.c, 206, Adding subscription
<t: 1800929>, main.c, 371, Configuration of device 0 successful
<t: 1848026>, main.c, 314, Button 0 pressed
<t: 1943172>, provisioner.c, 283, Local provisioning link established
<t: 1944995>, provisioner.c, 269, Using static authentication
<t: 1954490>, provisioner.c, 278, Static authentication data provided
<t: 1965597>, main.c, 408, Provisioning complete. Adding address 0x0100.
<t: 1969687>, provisioner.c, 237, Local provisioning link closed
<t: 1969689>, provisioner.c, 121, Getting composition data
<t: 3129178>, provisioner.c, 324, Composition data: 0059000000000020000100000002010000020059000000
<t: 3129181>, provisioner.c, 129, Adding appkey
<t: 3140576>, provisioner.c, 138, Binding appkey to the Health model
<t: 3142171>, provisioner.c, 150, Binding appkey to the Simple On/Off model
<t: 3142771>, provisioner.c, 175, Setting publication address for the health server to 0x0001
<t: 3145164>, provisioner.c, 197, Setting publication address for the On/Off server to 0x0001
<t: 3157248>, provisioner.c, 206, Adding subscription
<t: 3158891>, main.c, 371, Configuration of device 0 successful
<t: 3296049>, main.c, 314, Button 0 pressed
<t: 3388466>, provisioner.c, 283, Local provisioning link established
<t: 3390350>, provisioner.c, 269, Using static authentication
<t: 3400333>, provisioner.c, 278, Static authentication data provided
<t: 3410276>, main.c, 408, Provisioning complete. Adding address 0x0100.
<t: 3413826>, provisioner.c, 237, Local provisioning link closed
<t: 3413828>, provisioner.c, 121, Getting composition data
<t: 5379918>, main.c, 395, Configuration of device 0 failed
<t: 15506845>, provisioner.c, 283, Local provisioning link established
<t: 15508461>, provisioner.c, 269, Using static authentication
<t: 15517851>, provisioner.c, 278, Static authentication data provided
<t: 15528575>, main.c, 408, Provisioning complete. Adding address 0x0101.
<t: 15532384>, provisioner.c, 237, Local provisioning link closed
<t: 15532387>, provisioner.c, 121, Getting composition data
<t: 15557389>, provisioner.c, 324, Composition data: 0059000000000020000100000002010000020059000000
<t: 15557393>, provisioner.c, 129, Adding appkey
<t: 15568859>, provisioner.c, 138, Binding appkey to the Health model
<t: 15570262>, nrf_mesh_sdk.c, 78, MESH ASSERT at 0x00020332
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?