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

NRF MESH provisioner node - appKey error

Hi,

I am in the process of provisioning and configuring a 2-element light switch server node and a common light switch server. I am using the orginal exemple for the provisioner and common light switch server and a modified 2-element light switch server node.

When I start the configuration with the 2-element node it works but the following configuration freezes while searching for the appKey. (Terminal_provisioner_view)

In the reverse order everything works normally.

I have attached debug terminal from each point of view.

Thanks.

(using nrf52840-DK / Mesh v4.1.0 / SDK v16.0.0)

<t:     300644>, main.c,  174, Configuration of device 0 successful
<t:     300651>, provisioner_helper.c,  326, Scanning For Unprovisioned Devices
<t:     328492>, provisioner_helper.c,  168, UUID : 07C5A7ED6C9D4B869FAB8C12A2DFE0F6
<t:     328495>, provisioner_helper.c,  171, ^RSSI: -40
<t:     328497>, provisioner_helper.c,  177, ^URI Hash: 74F97940
<t:     328512>, node_setup.c,  768, true<t:     328513>, provisioner_helper.c,  332, Stop Scanning For Unprovisioned Devices
<t:     328516>, provisioner_helper.c,  183, URI hash matched to ¹URI for LS Server example. Provisioning ...
<t:     335229>, provisioner_helper.c,  300, Provisioning link established
<t:     350923>, provisioner_helper.c,  295, Static authentication data provided
<t:     364631>, provisioner_helper.c,  233, Provisioning completed received
<t:     364634>, provisioner_helper.c,  238, Adding device address, and device keys
<t:     364658>, provisioner_helper.c,  251, Addr: 0x0201 addr_handle: 1 netkey_handle: 0 devkey_handle: 3
<t:     370193>, provisioner_helper.c,  192, Local provisioning link closed: prov_state: 2  remaining retries: 2
<t:     370201>, main.c,  194, Provisioning successful
<t:     370207>, provisioner_helper.c,  216, Provisioning complete. ¹URI for LS Server example - address: 0x0201 elements: 2
<t:     370211>, node_setup.c,  742, Configuring Node: 0x0201
<t:     370214>, node_setup.c,  638, Config client setup: devkey_handle:3 addr_handle:1
<t:     370218>, node_setup.c,  413, Getting composition data
<t:     373735>, main.c,  247, Config client event
<t:     373738>, node_setup.c,  422, Updating network transmit: count: 2 steps: 1
<t:     376261>, main.c,  247, Config client event
<t:     376263>, node_setup.c,  433, Adding appkey
<t:     381330>, main.c,  247, Config client event
<t:     381332>, node_setup.c,  273, opcode status field: 0 
<t:     381335>, node_setup.c,  472, App key bind: Health server on element address 0x0201
<t:     383875>, main.c,  247, Config client event
<t:     383877>, node_setup.c,  273, opcode status field: 0 
<t:     383894>, node_setup.c,  491, Setting publication address for Health server to 0x0001
<t:     391050>, main.c,  247, Config client event
<t:     391053>, node_setup.c,  273, opcode status field: 0 
<t:     391055>, node_setup.c,  472, App key bind: Generic OnOff server on element address 0x0201
<t:     393513>, main.c,  247, Config client event
<t:     393515>, node_setup.c,  273, opcode status field: 0 
<t:     393526>, node_setup.c,  577, Adding subscription to address 0xC002 for Generic OnOff server on element address 0x0201
<t:     395878>, main.c,  247, Config client event
<t:     395880>, node_setup.c,  273, opcode status field: 0 
<t:     395883>, node_setup.c,  443, Adding next element
<t:     395885>, node_setup.c,  472, App key bind: Generic OnOff server on element address 0x0202
<t:     398339>, main.c,  247, Config client event
<t:     398341>, node_setup.c,  273, opcode status field: 0 
<t:     398352>, node_setup.c,  577, Adding subscription to address 0xC003 for Generic OnOff server on element address 0x0202
<t:     400886>, main.c,  247, Config client event
<t:     400888>, node_setup.c,  273, opcode status field: 0 
<t:     400891>, main.c,  174, Configuration of device 1 successful
<t:     400898>, provisioner_helper.c,  326, Scanning For Unprovisioned Devices
<t:     496372>, main.c,  219, Node 0x0100 alive with 0 active fault(s), RSSI: -51
<t:     498792>, main.c,  219, Node 0x0100 alive with 0 active fault(s), RSSI: -51
<t:     713860>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -41
<t:     716373>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -41
<t:     823925>, main.c,  219, Node 0x0100 alive with 0 active fault(s), RSSI: -49
<t:     826680>, main.c,  219, Node 0x0100 alive with 0 active fault(s), RSSI: -49
<t:    1041723>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -33
<t:    1043935>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -33
<t:    1048962>, provisioner_helper.c,  168, UUID : B6942EF07507481AA0DFBF5FEEB35AFD
<t:    1048965>, provisioner_helper.c,  171, ^RSSI: -40
<t:    1048968>, provisioner_helper.c,  177, ^URI Hash: 74F97940
<t:    1048982>, node_setup.c,  768, true
<t:    1048984>, provisioner_helper.c,  332, Stop Scanning For Unprovisioned Devices
<t:    1048987>, provisioner_helper.c,  183, URI hash matched to ¹URI for LS Server example. Provisioning ...
<t:    1056118>, provisioner_helper.c,  300, Provisioning link established
<t:    1068742>, provisioner_helper.c,  295, Static authentication data provided
<t:    1082830>, provisioner_helper.c,  233, Provisioning completed received
<t:    1082833>, provisioner_helper.c,  238, Adding device address, and device keys
<t:    1082857>, provisioner_helper.c,  251, Addr: 0x0202 addr_handle: 2 netkey_handle: 0 devkey_handle: 4
<t:    1088688>, provisioner_helper.c,  192, Local provisioning link closed: prov_state: 2  remaining retries: 2
<t:    1088696>, main.c,  194, Provisioning successful
<t:    1088702>, provisioner_helper.c,  216, Provisioning complete. ¹URI for LS Server example - address: 0x0202 elements: 2
<t:    1088706>, node_setup.c,  742, Configuring Node: 0x0202
<t:    1088709>, node_setup.c,  638, Config client setup: devkey_handle:4 addr_handle:2
<t:    1088713>, node_setup.c,  413, Getting composition data
<t:    1111177>, main.c,  247, Config client event
<t:    1111180>, node_setup.c,  422, Updating network transmit: count: 2 steps: 1
<t:    1113811>, main.c,  247, Config client event
<t:    1113813>, node_setup.c,  433, Adding appkey
	

<t:          0>, main.c,  336, ----- BLE Mesh Light Switch Server Demo -----
<t:      12559>, main.c,  304, Initializing and adding models
<t:      12563>, main.c,  171, App OnOff Model Handle: 3
<t:      12616>, main.c,  282, Node Address: 0x0205 
<t:      12619>, mesh_app_utils.c,   66, Device UUID (raw): B6942EF07507481AA0DFBF5FEEB35AFD
<t:      12623>, mesh_app_utils.c,   67, Device UUID : B6942EF0-7507-481A-A0DF-BF5FEEB35AFD
<t:      12651>, main.c,  383, 
		-------------------------------------------------------------------------------
		 Button/RTT 1) LED state will toggle and inform clients about the state change.
		 Button/RTT 4) Clear all the states to reset the node.
		-------------------------------------------------------------------------------
<t:      55199>, main.c,  287, Successfully provisioned
<t:      55204>, main.c,  282, Node Address: 0x0201 
<t:      66570>, config_server.c,  630, dsm_appkey_add(appkey_handle:0 appkey_index:0)

<t:          0>, main.c,  296, ----- BLE Mesh Light Switch Server Demo -----
<t:      12760>, main.c,  264, Initializing and adding models
<t:      12764>, main.c,  139, App OnOff Model Handle: 2
<t:      17540>, mesh_app_utils.c,   66, Device UUID (raw): 5E612FCB7BA041B6A40B5663B8F9DA2D
<t:      17543>, mesh_app_utils.c,   67, Device UUID : 5E612FCB-7BA0-41B6-A40B-5663B8F9DA2D
<t:      17556>, main.c,  343, 
		-------------------------------------------------------------------------------
		 Button/RTT 1) LED state will toggle and inform clients about the state change.
		 Button/RTT 4) Clear all the states to reset the node.
		-------------------------------------------------------------------------------
<t:     115352>, main.c,  247, Successfully provisioned
<t:     115357>, main.c,  242, Node Address: 0x0204 
<t:     161186>, config_server.c,  630, dsm_appkey_add(appkey_handle:0 appkey_index:0)
<t:     195024>, config_server.c,  630, dsm_appkey_add(appkey_handle:0 appkey_index:0)
<t:     263057>, config_server.c,  630, dsm_appkey_add(appkey_handle:0 appkey_index:0)
<t:     399591>, config_server.c,  630, dsm_appkey_add(appkey_handle:0 appkey_index:0)
<t:     672302>, config_server.c,  630, dsm_appkey_add(appkey_handle:0 appkey_index:0)
<t:    1218544>, config_server.c,  630, dsm_appkey_add(appkey_handle:0 appkey_index:0)
<t:    2092800>, config_server.c,  630, dsm_appkey_add(appkey_handle:0 appkey_index:0)
<t:    2638085>, config_server.c,  630, dsm_appkey_add(appkey_handle:0 appkey_index:0)

Parents
  • Hi Loulou, 

    Could you debug and check what's the value of the return code when config_client_appkey_add() called in the provisioner ? 

    What's the output of the log on the client ? has it receive the app_key adding packet ?

    The node_setup.c is designed with some specific scenario so it might not work out of the box when you add more element into the server. The node_setup.c might need to be modified, I'm not sure.
    If you configure 2 servers each with 2 elements would it work ? 

  • Hi,

    This function returns 0 in any case. (bug and not)

    No problem with the client, its configuration is a success every time.

    I can understand that senario are quite rigid but an unconfigured element should not cause probleme.

    If you configure 2 servers each with 2 elements would it work ? 

    It depends, sometimes yes, sometimes no. It's very difficult to study this kind of random bug. That's why I found a case where it crashes every time: configuring a node with 2 elements and then a node with 1 element.

    Thanks

    BR

Reply
  • Hi,

    This function returns 0 in any case. (bug and not)

    No problem with the client, its configuration is a success every time.

    I can understand that senario are quite rigid but an unconfigured element should not cause probleme.

    If you configure 2 servers each with 2 elements would it work ? 

    It depends, sometimes yes, sometimes no. It's very difficult to study this kind of random bug. That's why I found a case where it crashes every time: configuring a node with 2 elements and then a node with 1 element.

    Thanks

    BR

Children
  • Could you provide us the server code so we can reproduce the issue here ? 

  • Thank you for your quick responses.

    I had time to retry your question : "If you configure 2 servers each with 2 elements would it work ?" I have attached the full terminal with one succes and one failure. I tried around 10 times and it had succed 3, it seems random.

    <t:          0>, main.c,  467, ----- BLE Mesh Static Provisioner Demo -----
    <t:       8810>, main.c,  397, Initializing and adding models
    <t:       8845>, main.c,  449, Setup defaults: Adding keys, addresses, and bindings 
    <t:       9024>, provisioner_helper.c,  383, netkey_handle: 0
    <t:       9074>, main.c,  495, <start> 
    <t:       9083>, main.c,  503, 
    		--------------------------------------------------------------------------------
    		 Button/RTT 1) Initiate provisioning and configuration of unprovisioned devices.
    		 Button/RTT 4) Clear all the states to reset the node.
    		--------------------------------------------------------------------------------
    <t:      10307>, main.c,  483, Starting application ...
    <t:      10309>, main.c,  484, Provisioned Nodes: 0, Configured Nodes: 0
    <t:      10313>, main.c,  486, Dev key : 248D70C4FDA3649A217ACD0091AF1EEF
    <t:      10316>, main.c,  487, Net key : 084C9D3A28B8C58D2EEB573A1D63460A
    <t:      10319>, main.c,  488, App key : DAA6049C089205A5F3AA3529C5DD2D4F
    <t:      10322>, main.c,  489, Press Button 1 to start provisioning and configuration process. 
    <t:     206104>, main.c,  351, Button 1 pressed
    <t:     206106>, main.c,  274, Start provisioning procedure ...
    <t:     206109>, provisioner_helper.c,  326, Scanning For Unprovisioned Devices
    <t:     238185>, provisioner_helper.c,  168, UUID : B6942EF07507481AA0DFBF5FEEB35AFD
    <t:     238188>, provisioner_helper.c,  171, ^RSSI: -55
    <t:     238191>, provisioner_helper.c,  177, ^URI Hash: 74F97940
    <t:     238205>, provisioner_helper.c,  332, Stop Scanning For Unprovisioned Devices
    <t:     238208>, provisioner_helper.c,  183, URI hash matched to �URI for LS Server example. Provisioning ...
    <t:     244596>, provisioner_helper.c,  300, Provisioning link established
    <t:     394074>, provisioner_helper.c,  295, Static authentication data provided
    <t:     407533>, provisioner_helper.c,  233, Provisioning completed received
    <t:     407536>, provisioner_helper.c,  238, Adding device address, and device keys
    <t:     407560>, provisioner_helper.c,  251, Addr: 0x0201 addr_handle: 0 netkey_handle: 0 devkey_handle: 2
    <t:     413531>, provisioner_helper.c,  192, Local provisioning link closed: prov_state: 2  remaining retries: 2
    <t:     413539>, main.c,  194, Provisioning successful
    <t:     413544>, provisioner_helper.c,  216, Provisioning complete. �URI for LS Server example - address: 0x0201 elements: 2
    <t:     413549>, node_setup.c,  738, Configuring Node: 0x0201
    <t:     413552>, node_setup.c,  633, Config client setup: devkey_handle:2 addr_handle:0
    <t:     413555>, node_setup.c,  413, Getting composition data
    <t:     417289>, main.c,  247, Config client event
    <t:     417292>, node_setup.c,  270, opcode statuspassed 
    <t:     417294>, node_setup.c,  658, Call config_step_execute with step : 3
    <t:     417297>, node_setup.c,  422, Updating network transmit: count: 2 steps: 1
    <t:     419676>, main.c,  247, Config client event
    <t:     419678>, node_setup.c,  270, opcode statuspassed 
    <t:     419681>, node_setup.c,  658, Call config_step_execute with step : 4
    <t:     419683>, node_setup.c,  433, Adding appkey
    <t:     424772>, main.c,  247, Config client event
    <t:     424774>, node_setup.c,  273, opcode status field: 0 
    <t:     424776>, node_setup.c,  658, Call config_step_execute with step : 5
    <t:     424779>, node_setup.c,  471, App key bind: Health server on element address 0x0201
    <t:     459435>, main.c,  247, Config client event
    <t:     459437>, node_setup.c,  273, opcode status field: 0 
    <t:     459440>, node_setup.c,  658, Call config_step_execute with step : 24
    <t:     459457>, node_setup.c,  490, Setting publication address for Health server to 0x0001
    <t:     487617>, main.c,  247, Config client event
    <t:     487619>, node_setup.c,  273, opcode status field: 0 
    <t:     487621>, node_setup.c,  658, Call config_step_execute with step : 6
    <t:     487624>, node_setup.c,  471, App key bind: Generic OnOff server on element address 0x0201
    <t:     522151>, main.c,  247, Config client event
    <t:     522154>, node_setup.c,  273, opcode status field: 0 
    <t:     522156>, node_setup.c,  658, Call config_step_execute with step : 25
    <t:     522173>, node_setup.c,  524, Setting publication address to 0xC005 for Generic OnOff server on element address 0x0201
    <t:     529703>, main.c,  247, Config client event
    <t:     529706>, node_setup.c,  273, opcode status field: 0 
    <t:     529708>, node_setup.c,  658, Call config_step_execute with step : 27
    <t:     529719>, node_setup.c,  573, Adding subscription to address 0xC003 for Generic OnOff server on element address 0x0201
    <t:     532141>, main.c,  247, Config client event
    <t:     532143>, node_setup.c,  273, opcode status field: 0 
    <t:     532146>, main.c,  174, Configuration of device 0 successful
    <t:     532153>, provisioner_helper.c,  326, Scanning For Unprovisioned Devices
    <t:     547470>, provisioner_helper.c,  168, UUID : EBE7B9A1188946E5830AD48A2E36B120
    <t:     547473>, provisioner_helper.c,  171, ^RSSI: -67
    <t:     547476>, provisioner_helper.c,  177, ^URI Hash: 74F97940
    <t:     547490>, provisioner_helper.c,  332, Stop Scanning For Unprovisioned Devices
    <t:     547493>, provisioner_helper.c,  183, URI hash matched to �URI for LS Server example. Provisioning ...
    <t:     556506>, provisioner_helper.c,  300, Provisioning link established
    <t:     570915>, provisioner_helper.c,  295, Static authentication data provided
    <t:     585198>, provisioner_helper.c,  233, Provisioning completed received
    <t:     585201>, provisioner_helper.c,  238, Adding device address, and device keys
    <t:     585224>, provisioner_helper.c,  251, Addr: 0x0202 addr_handle: 1 netkey_handle: 0 devkey_handle: 3
    <t:     590846>, provisioner_helper.c,  192, Local provisioning link closed: prov_state: 2  remaining retries: 2
    <t:     590854>, main.c,  194, Provisioning successful
    <t:     590860>, provisioner_helper.c,  216, Provisioning complete. �URI for LS Server example - address: 0x0202 elements: 2
    <t:     590864>, node_setup.c,  738, Configuring Node: 0x0202
    <t:     590867>, node_setup.c,  633, Config client setup: devkey_handle:3 addr_handle:1
    <t:     590871>, node_setup.c,  413, Getting composition data
    <t:     594668>, main.c,  247, Config client event
    <t:     594670>, node_setup.c,  270, opcode statuspassed 
    <t:     594672>, node_setup.c,  658, Call config_step_execute with step : 3
    <t:     594675>, node_setup.c,  422, Updating network transmit: count: 2 steps: 1
    <t:     597109>, main.c,  247, Config client event
    <t:     597111>, node_setup.c,  270, opcode statuspassed 
    <t:     597113>, node_setup.c,  658, Call config_step_execute with step : 4
    <t:     597116>, node_setup.c,  433, Adding appkey
    <t:     809394>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -51
    <t:     812105>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -50
    <t:     874431>, main.c,  247, Config client event
    <t:     874433>, node_setup.c,  273, opcode status field: 0 
    <t:     874435>, node_setup.c,  658, Call config_step_execute with step : 5
    <t:     874438>, node_setup.c,  471, App key bind: Health server on element address 0x0202
    <t:     877250>, main.c,  247, Config client event
    <t:     877252>, node_setup.c,  273, opcode status field: 0 
    <t:     877255>, node_setup.c,  658, Call config_step_execute with step : 24
    <t:     877272>, node_setup.c,  490, Setting publication address for Health server to 0x0001
    <t:     884855>, main.c,  247, Config client event
    <t:     884857>, node_setup.c,  273, opcode status field: 0 
    <t:     884860>, node_setup.c,  658, Call config_step_execute with step : 6
    <t:     884863>, node_setup.c,  471, App key bind: Generic OnOff server on element address 0x0202
    <t:     887429>, main.c,  247, Config client event
    <t:     887431>, node_setup.c,  273, opcode status field: 0 
    <t:     887434>, node_setup.c,  658, Call config_step_execute with step : 25
    <t:     887451>, node_setup.c,  524, Setting publication address to 0xC004 for Generic OnOff server on element address 0x0202
    <t:     894458>, main.c,  247, Config client event
    <t:     894460>, node_setup.c,  273, opcode status field: 0 
    <t:     894463>, node_setup.c,  658, Call config_step_execute with step : 27
    <t:     894474>, node_setup.c,  573, Adding subscription to address 0xC002 for Generic OnOff server on element address 0x0202
    <t:     897238>, main.c,  247, Config client event
    <t:     897240>, node_setup.c,  273, opcode status field: 0 
    <t:     897243>, main.c,  174, Configuration of device 1 successful
    <t:     897249>, provisioner_helper.c,  326, Scanning For Unprovisioned Devices
    <t:    1137366>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -52
    <t:    1139745>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -53
    <t:    1207489>, main.c,  219, Node 0x0202 alive with 0 active fault(s), RSSI: -67
    <t:    1209850>, main.c,  219, Node 0x0202 alive with 0 active fault(s), RSSI: -67
    <t:    1465015>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -65
    <t:    1467551>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -66
    <t:    1535179>, main.c,  219, Node 0x0202 alive with 0 active fault(s), RSSI: -63
    <t:    1537474>, main.c,  219, Node 0x0202 alive with 0 active fault(s), RSSI: -63
    <t:    1792739>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -52
    <t:    1795248>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -51
    <t:    1860235>, main.c,  351, Button 4 pressed
    <t:    1860238>, provisioner_helper.c,  332, Stop Scanning For Unprovisioned Devices
    <t:    1860381>, main.c,  331, ----- Node reset  -----
    <t:          0>, main.c,  467, ----- BLE Mesh Static Provisioner Demo -----
    <t:       8830>, main.c,  397, Initializing and adding models
    <t:       8866>, main.c,  449, Setup defaults: Adding keys, addresses, and bindings 
    <t:       9059>, provisioner_helper.c,  383, netkey_handle: 0
    <t:       9109>, main.c,  495, <start> 
    <t:       9119>, main.c,  503, 
    		--------------------------------------------------------------------------------
    		 Button/RTT 1) Initiate provisioning and configuration of unprovisioned devices.
    		 Button/RTT 4) Clear all the states to reset the node.
    		--------------------------------------------------------------------------------
    <t:      10345>, main.c,  483, Starting application ...
    <t:      10347>, main.c,  484, Provisioned Nodes: 0, Configured Nodes: 0
    <t:      10351>, main.c,  486, Dev key : 23AC95434D8BE81BDFE3B982EBC2D558
    <t:      10354>, main.c,  487, Net key : EDB0ECF2D82FEF518860A56ECB01D918
    <t:      10357>, main.c,  488, App key : 5C70B755FAF74C4164FC1EA17C678CB7
    <t:      10360>, main.c,  489, Press Button 1 to start provisioning and configuration process. 
    <t:     309826>, main.c,  351, Button 1 pressed
    <t:     309828>, main.c,  274, Start provisioning procedure ...
    <t:     309830>, provisioner_helper.c,  326, Scanning For Unprovisioned Devices
    <t:     330943>, provisioner_helper.c,  168, UUID : B6942EF07507481AA0DFBF5FEEB35AFD
    <t:     330946>, provisioner_helper.c,  171, ^RSSI: -57
    <t:     330949>, provisioner_helper.c,  177, ^URI Hash: 74F97940
    <t:     330963>, provisioner_helper.c,  332, Stop Scanning For Unprovisioned Devices
    <t:     330966>, provisioner_helper.c,  183, URI hash matched to �URI for LS Server example. Provisioning ...
    <t:     338220>, provisioner_helper.c,  300, Provisioning link established
    <t:     352951>, provisioner_helper.c,  295, Static authentication data provided
    <t:     367072>, provisioner_helper.c,  233, Provisioning completed received
    <t:     367075>, provisioner_helper.c,  238, Adding device address, and device keys
    <t:     367099>, provisioner_helper.c,  251, Addr: 0x0201 addr_handle: 0 netkey_handle: 0 devkey_handle: 2
    <t:     372665>, provisioner_helper.c,  192, Local provisioning link closed: prov_state: 2  remaining retries: 2
    <t:     372673>, main.c,  194, Provisioning successful
    <t:     372678>, provisioner_helper.c,  216, Provisioning complete. �URI for LS Server example - address: 0x0201 elements: 2
    <t:     372683>, node_setup.c,  738, Configuring Node: 0x0201
    <t:     372686>, node_setup.c,  633, Config client setup: devkey_handle:2 addr_handle:0
    <t:     372689>, node_setup.c,  413, Getting composition data
    <t:     375613>, main.c,  247, Config client event
    <t:     375615>, node_setup.c,  270, opcode statuspassed 
    <t:     375617>, node_setup.c,  658, Call config_step_execute with step : 3
    <t:     375620>, node_setup.c,  422, Updating network transmit: count: 2 steps: 1
    <t:     378395>, main.c,  247, Config client event
    <t:     378397>, node_setup.c,  270, opcode statuspassed 
    <t:     378400>, node_setup.c,  658, Call config_step_execute with step : 4
    <t:     378403>, node_setup.c,  433, Adding appkey
    <t:     383398>, main.c,  247, Config client event
    <t:     383400>, node_setup.c,  273, opcode status field: 0 
    <t:     383403>, node_setup.c,  658, Call config_step_execute with step : 5
    <t:     383405>, node_setup.c,  471, App key bind: Health server on element address 0x0201
    <t:     385545>, main.c,  247, Config client event
    <t:     385547>, node_setup.c,  273, opcode status field: 0 
    <t:     385550>, node_setup.c,  658, Call config_step_execute with step : 24
    <t:     385567>, node_setup.c,  490, Setting publication address for Health server to 0x0001
    <t:     413159>, main.c,  247, Config client event
    <t:     413161>, node_setup.c,  273, opcode status field: 0 
    <t:     413164>, node_setup.c,  658, Call config_step_execute with step : 6
    <t:     413167>, node_setup.c,  471, App key bind: Generic OnOff server on element address 0x0201
    <t:     415687>, main.c,  247, Config client event
    <t:     415689>, node_setup.c,  273, opcode status field: 0 
    <t:     415692>, node_setup.c,  658, Call config_step_execute with step : 25
    <t:     415708>, node_setup.c,  524, Setting publication address to 0xC005 for Generic OnOff server on element address 0x0201
    <t:     423612>, main.c,  247, Config client event
    <t:     423614>, node_setup.c,  273, opcode status field: 0 
    <t:     423617>, node_setup.c,  658, Call config_step_execute with step : 27
    <t:     423628>, node_setup.c,  573, Adding subscription to address 0xC003 for Generic OnOff server on element address 0x0201
    <t:     458118>, main.c,  247, Config client event
    <t:     458120>, node_setup.c,  273, opcode status field: 0 
    <t:     458123>, main.c,  174, Configuration of device 0 successful
    <t:     458130>, provisioner_helper.c,  326, Scanning For Unprovisioned Devices
    <t:     473382>, provisioner_helper.c,  168, UUID : EBE7B9A1188946E5830AD48A2E36B120
    <t:     473385>, provisioner_helper.c,  171, ^RSSI: -61
    <t:     473387>, provisioner_helper.c,  177, ^URI Hash: 74F97940
    <t:     473401>, provisioner_helper.c,  332, Stop Scanning For Unprovisioned Devices
    <t:     473404>, provisioner_helper.c,  183, URI hash matched to �URI for LS Server example. Provisioning ...
    <t:     480809>, provisioner_helper.c,  300, Provisioning link established
    <t:     562479>, provisioner_helper.c,  295, Static authentication data provided
    <t:     576136>, provisioner_helper.c,  233, Provisioning completed received
    <t:     576139>, provisioner_helper.c,  238, Adding device address, and device keys
    <t:     576163>, provisioner_helper.c,  251, Addr: 0x0202 addr_handle: 1 netkey_handle: 0 devkey_handle: 3
    <t:     581767>, provisioner_helper.c,  192, Local provisioning link closed: prov_state: 2  remaining retries: 2
    <t:     581775>, main.c,  194, Provisioning successful
    <t:     581781>, provisioner_helper.c,  216, Provisioning complete. �URI for LS Server example - address: 0x0202 elements: 2
    <t:     581785>, node_setup.c,  738, Configuring Node: 0x0202
    <t:     581788>, node_setup.c,  633, Config client setup: devkey_handle:3 addr_handle:1
    <t:     581792>, node_setup.c,  413, Getting composition data
    <t:     584979>, main.c,  247, Config client event
    <t:     584981>, node_setup.c,  270, opcode statuspassed 
    <t:     584983>, node_setup.c,  658, Call config_step_execute with step : 3
    <t:     584986>, node_setup.c,  422, Updating network transmit: count: 2 steps: 1
    <t:     652352>, main.c,  247, Config client event
    <t:     652354>, node_setup.c,  270, opcode statuspassed 
    <t:     652356>, node_setup.c,  658, Call config_step_execute with step : 4
    <t:     652359>, node_setup.c,  433, Adding appkey
    <t:     735419>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -53
    <t:     738125>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -53
    <t:    1062896>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -60
    <t:    1065369>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -59
    <t:    1390639>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -54
    <t:    1393139>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -54
    <t:    1718259>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -55
    <t:    1720783>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -55
    <t:    2046108>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -56
    <t:    2048786>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -55
    <t:    2373845>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -50
    <t:    2376533>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -52
    <t:    2618456>, main.c,  247, Config client event
    <t:    2618458>, node_setup.c,  682, Acknowledged message status not received 
    <t:    2618461>, node_setup.c,  686, Retry ...
    <t:    2618463>, node_setup.c,  433, Adding appkey
    <t:    2701465>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -57
    <t:    2703984>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -56
    <t:    3029203>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -61
    <t:    3031526>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -63
    <t:    3356779>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -59
    <t:    3358939>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -59
    <t:    3684425>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -55
    <t:    3686907>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -55
    <t:    4012299>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -58
    <t:    4014894>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -58
    <t:    4339836>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -52
    <t:    4342554>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -52
    <t:    4584561>, main.c,  247, Config client event
    <t:    4584563>, node_setup.c,  682, Acknowledged message status not received 
    <t:    4584566>, node_setup.c,  686, Retry ...
    <t:    4584568>, node_setup.c,  433, Adding appkey
    <t:    4667600>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -54
    <t:    4670156>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -54
    <t:    4995356>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -58
    <t:    4997868>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -58
    <t:    5323034>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -54
    <t:    5325458>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -54
    <t:    5650516>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -57
    <t:    5653191>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -58
    <t:    5978296>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -58
    <t:    5980631>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -59
    <t:    6305929>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -53
    <t:    6308572>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -53
    <t:    6550666>, main.c,  247, Config client event
    <t:    6550668>, node_setup.c,  682, Acknowledged message status not received 
    <t:    6550672>, main.c,  187, Configuration of device 1 failed. Press Button 1 to retry.
    <t:    6633549>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -56
    <t:    6635816>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -56
    <t:    6961300>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -57
    <t:    6963754>, main.c,  219, Node 0x0201 alive with 0 active fault(s), RSSI: -57

    My modifications of the server are inspired by this. However, I have attached my modified files.

    Any modification on the provisioner exemple.

     **\nrf5_SDK_for_Mesh_v4.1.0_src\examples\light_switch\client\src\main.c

     

    /* Copyright (c) 2010 - 2020, Nordic Semiconductor ASA
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without modification,
     * are permitted provided that the following conditions are met:
     *
     * 1. Redistributions of source code must retain the above copyright notice, this
     * list of conditions and the following disclaimer.
     *
     * 2. Redistributions in binary form, except as embedded into a Nordic
     *    Semiconductor ASA integrated circuit in a product or a software update for
     *    such product, must reproduce the above copyright notice, this list of
     *    conditions and the following disclaimer in the documentation and/or other
     *    materials provided with the distribution.
     *
     * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
     *    contributors may be used to endorse or promote products derived from this
     *    software without specific prior written permission.
     *
     * 4. This software, with or without modification, must only be used with a
     *    Nordic Semiconductor ASA integrated circuit.
     *
     * 5. Any software provided in binary form under this license must not be reverse
     *    engineered, decompiled, modified and/or disassembled.
     *
     * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
     * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
     * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
     * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
     * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
     * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    #include <stdint.h>
    #include <string.h>
    
    /* HAL */
    #include "boards.h"
    #include "simple_hal.h"
    #include "app_timer.h"
    
    /* Core */
    #include "nrf_mesh_config_core.h"
    #include "nrf_mesh_gatt.h"
    #include "nrf_mesh_configure.h"
    #include "nrf_mesh.h"
    #include "mesh_stack.h"
    #include "device_state_manager.h"
    #include "access_config.h"
    #include "proxy.h"
    
    /* Provisioning and configuration */
    #include "mesh_provisionee.h"
    #include "mesh_app_utils.h"
    
    /* Models */
    #include "generic_onoff_server.h"
    
    /* Logging and RTT */
    #include "log.h"
    #include "rtt_input.h"
    
    /* Example specific includes */
    #include "app_config.h"
    #include "example_common.h"
    #include "nrf_mesh_config_examples.h"
    #include "light_switch_example_common.h"
    #include "app_onoff.h"
    #include "ble_softdevice_support.h"
    
    /*****************************************************************************
     * Definitions
     *****************************************************************************/
    #define ONOFF_SERVER_0_LED          (BSP_LED_0)
    
    #define ONOFF_SERVER_1_LED          (BSP_LED_1) // changed - add
    
    #define APP_ONOFF_ELEMENT_INDEX     (0)
    
    /* Controls if the model instance should force all mesh messages to be segmented messages. */
    #define APP_FORCE_SEGMENTATION      (false)
    /* Controls the MIC size used by the model instance for sending the mesh messages. */
    #define APP_MIC_SIZE                (NRF_MESH_TRANSMIC_SIZE_SMALL)
    
    
    /*****************************************************************************
     * Forward declaration of static functions
     *****************************************************************************/
    static void app_onoff_server_set_cb(const app_onoff_server_t * p_server, bool onoff);
    static void app_onoff_server_get_cb(const app_onoff_server_t * p_server, bool * p_present_onoff);
    static void app_onoff_server_transition_cb(const app_onoff_server_t * p_server,
                                                    uint32_t transition_time_ms, bool target_onoff);
    static void app_onoff_server_set_cb_1(const app_onoff_server_t * p_server, bool onoff);
    static void app_onoff_server_get_cb_1(const app_onoff_server_t * p_server, bool * p_present_onoff);
    
    /*****************************************************************************
     * Static variables
     *****************************************************************************/
    static bool m_device_provisioned;
    
    /* Generic OnOff server structure definition and initialization */
    APP_ONOFF_SERVER_DEF(m_onoff_server_0,
                         APP_FORCE_SEGMENTATION,
                         APP_MIC_SIZE,
                         app_onoff_server_set_cb,
                         app_onoff_server_get_cb,
                         app_onoff_server_transition_cb)
    
     APP_ONOFF_SERVER_DEF(m_onoff_server_1,
                         APP_FORCE_SEGMENTATION,
                         APP_MIC_SIZE,
                         app_onoff_server_set_cb_1,
                         app_onoff_server_get_cb_1,
                         app_onoff_server_transition_cb)
    
    /* Callback for updating the hardware state */
    static void app_onoff_server_set_cb(const app_onoff_server_t * p_server, bool onoff)
    {
        /* Resolve the server instance here if required, this example uses only 1 instance. */
    
        hal_led_pin_set(ONOFF_SERVER_0_LED, onoff);
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Setting GPIO value: %d Server id : %d\n", onoff,p_server->server.model_handle)
    
    }
    /* Callback for updating the hardware state */
    static void app_onoff_server_set_cb_1(const app_onoff_server_t * p_server, bool onoff)
    {
        /* Resolve the server instance here if required, this example uses only 1 instance. */
    
        hal_led_pin_set(ONOFF_SERVER_1_LED, onoff);
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Setting GPIO value: %d Server id : %d\n", onoff,p_server->server.model_handle)
    
    }
    
    
    /* Callback for reading the hardware state */
    static void app_onoff_server_get_cb(const app_onoff_server_t * p_server, bool * p_present_onoff)
    {
        /* Resolve the server instance here if required, this example uses only 1 instance. */
    
        *p_present_onoff = hal_led_pin_get(ONOFF_SERVER_0_LED);
    }
    /* Callback for reading the hardware state */
    static void app_onoff_server_get_cb_1(const app_onoff_server_t * p_server, bool * p_present_onoff)
    {
        /* Resolve the server instance here if required, this example uses only 1 instance. */
       *p_present_onoff = hal_led_pin_get(ONOFF_SERVER_1_LED);
    }
    
    
    /* Callback for updating the hardware state */
    static void app_onoff_server_transition_cb(const app_onoff_server_t * p_server,
                                                    uint32_t transition_time_ms, bool target_onoff)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Transition time: %d, Target OnOff: %d\n",
                                           transition_time_ms, target_onoff);
    }
    
    
    static void app_model_init(void)
    {
    
        ERROR_CHECK(app_onoff_init(&m_onoff_server_1, APP_ONOFF_ELEMENT_INDEX + 1)); // changed - add
    
        /* Instantiate onoff server on element index APP_ONOFF_ELEMENT_INDEX */
        ERROR_CHECK(app_onoff_init(&m_onoff_server_0, APP_ONOFF_ELEMENT_INDEX));
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "App OnOff Model Handle: %d\n", m_onoff_server_0.server.model_handle);
    }
    
    /*************************************************************************************************/
    
    static void node_reset(void)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- Node reset  -----\n");
        hal_led_blink_ms(LEDS_MASK, LED_BLINK_INTERVAL_MS, LED_BLINK_CNT_RESET);
        /* This function may return if there are ongoing flash operations. */
        mesh_stack_device_reset();
    }
    
    static void config_server_evt_cb(const config_server_evt_t * p_evt)
    {
        if (p_evt->type == CONFIG_SERVER_EVT_NODE_RESET)
        {
            node_reset();
        }
    }
    
    #if NRF_MESH_LOG_ENABLE
    static const char m_usage_string[] =
        "\n"
        "\t\t-------------------------------------------------------------------------------\n"
        "\t\t Button/RTT 1) LED state will toggle and inform clients about the state change.\n"
        "\t\t Button/RTT 4) Clear all the states to reset the node.\n"
        "\t\t-------------------------------------------------------------------------------\n";
    #endif
    
    static void button_event_handler(uint32_t button_number)
    {
        /* Increase button number because the buttons on the board is marked with 1 to 4 */
        button_number++;
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Button %u pressed\n", button_number);
        switch (button_number)
        {
            /* Pressing SW1 on the Development Kit will result in LED state to toggle and trigger
            the STATUS message to inform client about the state change. This is a demonstration of
            state change publication due to local event. */
            case 1:
            {
                __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "User action \n");
                hal_led_pin_set(ONOFF_SERVER_0_LED, !hal_led_pin_get(ONOFF_SERVER_0_LED));// led 
                app_onoff_status_publish(&m_onoff_server_0);
                break;
            }
    
            case 2:
                hal_led_pin_set(BSP_LED_2,1);
            break;
    
            case 3:
                 hal_led_pin_set(BSP_LED_2,0);
            break;
    
            /* Initiate node reset */
            case 4:
            {
                /* Clear all the states to reset the node. */
                if (mesh_stack_is_device_provisioned())
                {
    #if MESH_FEATURE_GATT_PROXY_ENABLED
                    (void) proxy_stop();
    #endif
                    mesh_stack_config_clear();
                    node_reset();
                }
                else
                {
                    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "The device is unprovisioned. Resetting has no effect.\n");
                }
                break;
            }
    
            default:
                __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, m_usage_string);
                break;
        }
    }
    
    static void app_rtt_input_handler(int key)
    {
        if (key >= '1' && key <= '4')
        {
            uint32_t button_number = key - '1';
            button_event_handler(button_number);
        }
        else
        {
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, m_usage_string);
        }
    }
    
    static void device_identification_start_cb(uint8_t attention_duration_s)
    {
        hal_led_mask_set(LEDS_MASK, false);
        hal_led_blink_ms(BSP_LED_2_MASK  | BSP_LED_3_MASK,
                         LED_BLINK_ATTENTION_INTERVAL_MS,
                         LED_BLINK_ATTENTION_COUNT(attention_duration_s));
    }
    
    static void provisioning_aborted_cb(void)
    {
        hal_led_blink_stop();
    }
    
    static void unicast_address_print(void)
    {
        dsm_local_unicast_address_t node_address;
        dsm_local_unicast_addresses_get(&node_address);
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Node Address: 0x%04x \n", node_address.address_start);
    }
    
    static void provisioning_complete_cb(void)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Successfully provisioned\n");
    
    #if MESH_FEATURE_GATT_ENABLED
        /* Restores the application parameters after switching from the Provisioning
         * service to the Proxy  */
        gap_params_init();
        conn_params_init();
    #endif
    
        unicast_address_print();
        hal_led_blink_stop();
        hal_led_mask_set(LEDS_MASK, LED_MASK_STATE_OFF);
        hal_led_blink_ms(LEDS_MASK, LED_BLINK_INTERVAL_MS, LED_BLINK_CNT_PROV);
    }
    
    static void models_init_cb(void)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Initializing and adding models\n");
        app_model_init();
    }
    
    static void mesh_init(void)
    {
        mesh_stack_init_params_t init_params =
        {
            .core.irq_priority       = NRF_MESH_IRQ_PRIORITY_LOWEST,
            .core.lfclksrc           = DEV_BOARD_LF_CLK_CFG,
            .core.p_uuid             = NULL,
            .models.models_init_cb   = models_init_cb,
            .models.config_server_cb = config_server_evt_cb
        };
    
        uint32_t status = mesh_stack_init(&init_params, &m_device_provisioned);
        switch (status)
        {
            case NRF_ERROR_INVALID_DATA:
                __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Data in the persistent memory was corrupted. Device starts as unprovisioned.\n");
    			__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Reset device before start provisioning.\n");
                break;
            case NRF_SUCCESS:
                break;
            default:
                ERROR_CHECK(status);
        }
    }
    
    static void initialize(void)
    {
        __LOG_INIT(LOG_SRC_APP | LOG_SRC_FRIEND, LOG_LEVEL_DBG1, LOG_CALLBACK_DEFAULT);
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BLE Mesh Light Switch Server Demo -----\n");
    
        ERROR_CHECK(app_timer_init());
        hal_leds_init();
    
    #if BUTTON_BOARD
        ERROR_CHECK(hal_buttons_init(button_event_handler));
    #endif
    
        ble_stack_init();
    
    #if MESH_FEATURE_GATT_ENABLED
        gap_params_init();
        conn_params_init();
    #endif
    
        mesh_init();
    }
    
    static void start(void)
    {
        rtt_input_enable(app_rtt_input_handler, RTT_INPUT_POLL_PERIOD_MS);
    
        if (!m_device_provisioned)
        {
            static const uint8_t static_auth_data[NRF_MESH_KEY_SIZE] = STATIC_AUTH_DATA;
            mesh_provisionee_start_params_t prov_start_params =
            {
                .p_static_data    = static_auth_data,
                .prov_sd_ble_opt_set_cb = NULL,
                .prov_complete_cb = provisioning_complete_cb,
                .prov_device_identification_start_cb = device_identification_start_cb,
                .prov_device_identification_stop_cb = NULL,
                .prov_abort_cb = provisioning_aborted_cb,
                .p_device_uri = EX_URI_LS_SERVER
            };
            ERROR_CHECK(mesh_provisionee_prov_start(&prov_start_params));
        }
        else
        {
            unicast_address_print();
        }
    
        mesh_app_uuid_print(nrf_mesh_configure_device_uuid_get());
    
        ERROR_CHECK(mesh_stack_start());
    
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, m_usage_string);
    
        hal_led_mask_set(LEDS_MASK, LED_MASK_STATE_OFF);
        hal_led_blink_ms(LEDS_MASK, LED_BLINK_INTERVAL_MS, LED_BLINK_CNT_START);
    }
    
    int main(void)
    {
        initialize();
        start();
    
        for (;;)
        {
            (void)sd_app_evt_wait();
        }
    }
    

    **\nrf5_SDK_for_Mesh_v4.1.0_src\examples\light_switch\server\include\nrf_mesh_config_app.hnrf_mesh_config_app.h

    I hope you can reproduce the issue.

    (using 3 x nrf52840-DK / Mesh v4.1.0 / SDK v16.0.0)

  • Hi LouLou, 

    I tried your code here but I didn't see the crash. I assume you saw the provisioner crashed ?
    However, I had a look at the provisioner and it seems that the provisioner was not designed to provision the 2nd element of the server. 

    If you look at the config_scenarios.h you can find how it's defined. For example the light switch client will be configured as follow: 

    #define CONFIG_SCENARIO_LIGHT_SWITCH_CLIENT_EXAMPLE    \
        CONFIG_SCENARIO_COMMON,                            \
        CONFIG_ONOFF_CLIENT,                               \
        CONFIG_ONOFF_CLIENT,                               \
        NODE_SETUP_DONE

    You can find that there are 2 CONFIG_ONOFF_CLIENT being configured. And on top of each CONFIG_ONOFF_CLIENT  there is a NODE_SETUP_GET_NEXT_ELEMENT . The reason for this is that the config_onoff_client is not located on the first element but located on the 2nd and 3rd element. 

    It's a little bit different in your 2 elements server case. Your first server model is located on the 1st element with other model for example the Health model. 

    So what I did to modify the configuration scenario is to add CONFIG_ONOFF_SERVER2 as follow: 

    #define CONFIG_SCENARIO_LIGHT_SWITCH_SERVER_EXAMPLE    \
        CONFIG_SCENARIO_COMMON,                            \
        CONFIG_ONOFF_SERVER,                               \
        CONFIG_ONOFF_SERVER2,                               \
        NODE_SETUP_DONE

    #define CONFIG_ONOFF_SERVER2                      \
        NODE_SETUP_GET_NEXT_ELEMENT,                 \
        NODE_SETUP_CONFIG_APPKEY_BIND_ONOFF_SERVER,  \
        NODE_SETUP_CONFIG_PUBLICATION_ONOFF_SERVER,  \
        NODE_SETUP_CONFIG_SUBSCRIPTION_ONOFF_SERVER
    

    Attached is the config_scenatios.h I used. Note that I haven't modified the subscription address for the 2nd server, so it subscribe to the same group as the 1st server. 

    config_scenarios.h

  • Hi,

    I tried your code here but I didn't see the crash. I assume you saw the provisioner crashed ?

    Yes, on my side it crashes during the second configuration.

    I did something similare with the senario file but it seems like the previous random bug.

    #define CONFIG_SCENARIO_LIGHT_SWITCH_SERVER_EXAMPLE    \
        CONFIG_SCENARIO_COMMON,                            \
        CONFIG_ONOFF_SERVER,                               \
        NODE_SETUP_GET_NEXT_ELEMENT,                         \
        CONFIG_ONOFF_SERVER,                               \
        NODE_SETUP_DONE

    If you say that you can't see the crash, I will try to reset my setup.

  • Yes, please debug deeper and find why it crashes/stop continuing. Testing on a fresh copy of the SDK could be a good idea. 

Related