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

How to configure a node for control model?

How to configure a node for control model. I have used light switch on/off template to implement a control mode but i i don't know how to make a control logic for client. Have to use only client at a time but if i run the code i'm getting error and it run both client and sever at same time. I have merge the client and server program for control model but i'm getting a error as NRF_INVALID_STATE which is in nrf_mesh_init function.Please help me and thanks in advance.

  • It was not acting as a server so there is a problem in configuring control model. I can use one model at same time

  • is it enough to merge simple on off client and simple on off server model ?

  • i have merged simple on/off client and simple on/off server model as control model. using that control model for both client and server main.c file. The client gets provisioned successfully but while the server gets error during provisioning 

    <t: 0>, main.c, 558, ----- BLE Mesh Light Switch Provisioner Demo -----
    <t: 0>, mesh_softdevice_init.c, 117, Initializing SoftDevice...
    <t: 0>, mesh_softdevice_init.c, 75, Enabling BLE...
    <t: 16>, mesh_softdevice_init.c, 109, sd_ble_enable: app_ram_base should be adjusted to 0x20002DA0
    <t: 594>, main.c, 496, Initializing and adding models
    <t: 607>, main.c, 539, Setup defaults: Adding keys, addresses, and bindings
    <t: 755>, provisioner_helper.c, 335, netkey_handle: 0
    <t: 767>, main.c, 588, <start>
    <t: 1080>, main.c, 119, Flash write complete
    <t: 1082>, main.c, 575, Starting application ...
    <t: 1084>, main.c, 577, Provisoned Nodes: 0, Configured Nodes: 0 Next Address: 0x0100
    <t: 1088>, main.c, 578, Dev key : 15CBB6EBA3B243D446A7A13F757AA765
    <t: 1091>, main.c, 579, Net key : 069E2520CC89FF819051F0487B56675A
    <t: 1094>, main.c, 580, App key : DAEA9D7EA61CBB9AC62DDB00BAB3A308
    <t: 1097>, main.c, 581, Press Button 1 to start provisioning and configuration process.
    <t: 52598>, main.c, 456, Button 1 pressed
    <t: 52600>, main.c, 363, Waiting for Client node to be provisioned ...
    <t: 57359>, provisioner_helper.c, 284, Scanning For Unprovisioned Devices
    <t: 92624>, provisioner_helper.c, 144, UUID seen: 0059ABCDEFABCDEFACCDEFABCDEFABCD
    <t: 92627>, provisioner_helper.c, 95, UUID filter matched
    <t: 92930>, provisioner_helper.c, 261, Provisioning link established
    <t: 105480>, provisioner_helper.c, 256, Static authentication data provided
    <t: 117233>, provisioner_helper.c, 192, Provisioning completed received
    <t: 117236>, provisioner_helper.c, 197, Adding device address, and device keys
    <t: 117241>, provisioner_helper.c, 216, Addr: 0x0100 addr_handle: 0 netkey_handle: 0 devkey_handle: 2
    <t: 121292>, provisioner_helper.c, 155, Local provisioning link closed: prov_state: 2 remaining retries: 2
    <t: 121296>, main.c, 284, Provisioning successful
    <t: 121299>, provisioner_helper.c, 181, Provisioning complete. Node addr: 0x0100 elements: 2
    <t: 121302>, node_setup.c, 774, Configuring Node: 0x0100
    <t: 121306>, node_setup.c, 688, Config client setup: devkey_handle:2 addr_handle:0
    <t: 121309>, node_setup.c, 407, Getting composition data
    <t: 121351>, main.c, 119, Flash write complete
    <t: 141725>, main.c, 334, Config client event
    <t: 141728>, node_setup.c, 417, Adding appkey
    <t: 145109>, main.c, 334, Config client event
    <t: 145112>, node_setup.c, 318, opcode status field: 0
    <t: 145114>, node_setup.c, 428, App key bind: Health server
    <t: 146039>, main.c, 334, Config client event
    <t: 146041>, node_setup.c, 318, opcode status field: 0
    <t: 146044>, node_setup.c, 496, Setting publication address for the health server to 0x0001
    <t: 149310>, main.c, 334, Config client event
    <t: 149313>, node_setup.c, 318, opcode status field: 0
    <t: 149315>, node_setup.c, 462, App key bind: Simple On/Off client on element 0x0101
    <t: 150722>, main.c, 334, Config client event
    <t: 150725>, node_setup.c, 318, opcode status field: 2
    <t: 150727>, main.c, 277, Configuration of device 0 failed. Press Button 1 to retry. 

  • Sorry for the delayed response. If you take a look at second to last log message, you can see you received the opcode status field 2 instead of 0. We unfortunately do not have an example for building a control model, but I do not believe it is enough to only merge the simple on off client & server models. You will still need to include control functionality. Are you able to debug a bit further to see why you receive this opcode field status?

Related