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

How can I modify the model's default publish period in the Provisioner example?

I'm using nRF5 SDK for Mesh v5.0 and I'm evaluating the Provisioner example to provision a node with sensor server model .

I want to modify the default publish period of Sensor Server model.

But when I set the step_num to a non-zero value in Line 540 (see below) in node_setup.c, the configuration process failed.

 

......
case NODE_SETUP_CONFIG_PUBLICATION_SENSOR_SERVER:
case NODE_SETUP_CONFIG_PUBLICATION_SENSOR_SETUP_SERVER:
case NODE_SETUP_CONFIG_PUBLICATION_SCENE_SERVER:
case NODE_SETUP_CONFIG_PUBLICATION_SCENE_SETUP_SERVER:
    {
        access_publish_period_t publish_period =
            {
                .step_num = 1, 
                .step_res = ACCESS_PUBLISH_RESOLUTION_100MS //ACCESS_PUBLISH_RESOLUTION_100MS
            };
......
 

Parents
  • Hi Charmin, 

    Could you let me know what exactly failed ? Was it on the provisioner node or on the provisionee  ? Do you have any log showing where it failed ? 

    You can find in the same file node_setup.c in NODE_SETUP_CONFIG_PUBLICATION_HEALTH case in config_step_execute() we set step_num = 1 for the health model. 

  • Sir, here is the RTT output on the provisioner node:

    <t:     711537>, main.c,  262, Start provisioning procedure ...
    <t:     711540>, provisioner_helper.c,  326, Scanning For Unprovisioned Devices
    <t:     744718>, provisioner_helper.c,  168, UUID : 0B7F887250DB4E189FC2B6CE1D935F0D
    <t:     744721>, provisioner_helper.c,  171, ^RSSI: -52
    <t:     744723>, provisioner_helper.c,  177, ^URI Hash: FB611461
    <t:     744760>, provisioner_helper.c,  332, Stop Scanning For Unprovisioned Devices
    <t:     744763>, provisioner_helper.c,  183, URI hash matched to ¹URI for Sensor Server example. Provisioning ...
    <t:     754044>, provisioner_helper.c,  300, Provisioning link established
    <t:     768624>, provisioner_helper.c,  295, Static authentication data provided
    <t:     848991>, provisioner_helper.c,  233, Provisioning completed received
    <t:     848994>, provisioner_helper.c,  238, Adding device address, and device keys
    <t:     849021>, provisioner_helper.c,  251, Addr: 0x0801 addr_handle: 0 netkey_handle: 0 devkey_handle: 2
    <t:     854802>, provisioner_helper.c,  192, Local provisioning link closed: prov_state: 2  remaining retries: 2
    <t:     854810>, main.c,  200, Provisioning successful
    <t:     854817>, provisioner_helper.c,  216, Provisioning complete. ¹URI for Sensor Server example - address: 0x0801 elements: 1
    <t:     854822>, node_setup.c,  779, Configuring Node: 0x0801
    <t:     854825>, node_setup.c,  675, Config client setup: devkey_handle:2 addr_handle:0
    <t:     854828>, node_setup.c,  430, Getting composition data
    <t:     858351>, main.c,  253, Config client event
    <t:     858353>, node_setup.c,  439, Updating network transmit: count: 2 steps: 1
    <t:     860710>, main.c,  253, Config client event
    <t:     860712>, node_setup.c,  450, Adding appkey
    <t:     865056>, main.c,  253, Config client event
    <t:     865059>, node_setup.c,  282, opcode status field: 0 
    <t:     865061>, node_setup.c,  492, App key bind: Health server on element address 0x0801
    <t:     867883>, main.c,  253, Config client event
    <t:     867886>, node_setup.c,  282, opcode status field: 0 
    <t:     867902>, node_setup.c,  511, Setting publication address for Health server to 0x0001
    <t:     875054>, main.c,  253, Config client event
    <t:     875056>, node_setup.c,  282, opcode status field: 0 
    <t:     875058>, node_setup.c,  492, App key bind: Sensor server on element address 0x0801
    <t:     877467>, main.c,  253, Config client event
    <t:     877470>, node_setup.c,  282, opcode status field: 0 
    <t:     877472>, node_setup.c,  492, App key bind: Sensor setup server on element address 0x0801
    <t:     879902>, main.c,  253, Config client event
    <t:     879905>, node_setup.c,  282, opcode status field: 0 
    <t:     879921>, node_setup.c,  549, Setting publication address to 0xC005 for Sensor server on element address 0x0801
    <t:     893009>, main.c,  253, Config client event
    <t:     893012>, node_setup.c,  282, opcode status field: 0 
    <t:     893028>, node_setup.c,  549, Setting publication address to 0xC005 for Sensor setup server on element address 0x0801
    <t:    1085139>, main.c,  253, Config client event
    <t:    1085142>, node_setup.c,  282, opcode status field: 7 
    <t:    1085145>, main.c,  191, Configuration of device 0 failed.
    <t:    1085147>, main.c,  192, Press Button/RTT 1 to retry configuration.
    <t:    1085150>, main.c,  193, Press Button/RTT 2 to start provisioning new nodes.

  • Hi Charmin, 

    Status field 7 means Invalid Publish Parameters.

    What I can see in the log is that you were trying to write to  "Sensor setup server". And it seems that in the node_setup it use the same parameter to the "Sensor server" . So most likely "Sensor setup server" doesn't support periodic publication and you shouldn't send the publication set with step_num = 1 to the "sensor setup server".

    What you need to do is to split the setup for _SENSOR_SERVER  (for example case NODE_SETUP_CONFIG_PUBLICATION_SENSOR_SERVER) in config_step_execute() and change the parameters for these cases only, not all as you do now. 

Reply Children
No Data
Related