<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31267/adding-a-second-model-to-the-example-publish-adress-handle-not-set</link><description>Hi guys, 
 I&amp;#39;m adding my own &amp;#39;hello world&amp;#39; model to the example on element 0. 
 For this i&amp;#39;ve implemented a simple model; 
 Client sends &amp;#39;Set Unreliable&amp;#39; with char[20] value. 
 Server receives and outputs this in the terminal (Segger embedded studio)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 May 2018 12:16:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31267/adding-a-second-model-to-the-example-publish-adress-handle-not-set" /><item><title>RE: Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/thread/132752?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 12:16:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d1b42c7-ca7b-4596-b6d8-c02e1744beb7</guid><dc:creator>sommmen</dc:creator><description>&lt;p&gt;no in main.c. also please open a new issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/thread/132738?ContentTypeID=1</link><pubDate>Tue, 22 May 2018 11:55:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2cbd7e7c-7305-4334-afe9-a34ee4f4a82f</guid><dc:creator>Igor</dc:creator><description>&lt;p&gt;config? You mean the do_config_step() method?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/thread/132610?ContentTypeID=1</link><pubDate>Mon, 21 May 2018 19:29:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:169b037f-a110-401b-a666-b7d9f40cdafa</guid><dc:creator>sommmen</dc:creator><description>&lt;p&gt;also; if you open a second ticket with more information Nordic staff will help you out (they&amp;#39;re quire responsive) and if you linkit here i&amp;#39;ll also take a look.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/thread/132609?ContentTypeID=1</link><pubDate>Mon, 21 May 2018 19:28:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81c5646e-84e3-42bf-8dc5-a1597da490cb</guid><dc:creator>sommmen</dc:creator><description>&lt;p&gt;at the time i was using the mesh sdk v1.0.1 and my answer fixed it - the config wasn&amp;#39;t right. are you using the sdk v2.0.1? anyways - make sure that you configure the model correctly&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/thread/132601?ContentTypeID=1</link><pubDate>Mon, 21 May 2018 15:37:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c08d36f1-324e-4676-b9bd-63c53e5091f8</guid><dc:creator>Igor</dc:creator><description>&lt;p&gt;@sommmen I have the same problem. Code is written as in your example above. How did fix this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/thread/123885?ContentTypeID=1</link><pubDate>Mon, 12 Mar 2018 11:26:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16b1e507-ad1b-4c3c-bb0e-c8fdc71689df</guid><dc:creator>sommmen</dc:creator><description>&lt;p&gt;Figured it out; &lt;/p&gt;
&lt;p&gt;1. set the publish address in void provisioner_config_successful_cb&lt;/p&gt;
&lt;p&gt;2. add it to local storage in void provisioner_prov_complete_cb&lt;/p&gt;
&lt;p&gt;messed something up there, it is fixed now.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could still do with a proper tutorial on the provisioning/configurating part though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/thread/123849?ContentTypeID=1</link><pubDate>Mon, 12 Mar 2018 09:08:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0214d7e-dea1-4165-83e6-adaf439a55ba</guid><dc:creator>sommmen</dc:creator><description>&lt;p&gt;Hi, thanks for your response!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I did, however nowhere is described how to properly use the provisioner/configuration in the example.&lt;/p&gt;
&lt;p&gt;The example itself is still working fine.&lt;/p&gt;
&lt;p&gt;The on/off example uses a mechanism to add several servers to the clients and im now trying to figure out how to add my own model properly.&lt;/p&gt;
&lt;p&gt;Basically it comes down to the fact that i don&amp;#39;t know how to do these parts;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void provisioner_config_successful_cb(void)
{
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Configuration of device %u successful\n&amp;quot;, m_configured_devices);

    /* Set publish address for the client to the corresponding server. */
    ERROR_CHECK(access_model_publish_address_set(m_clients[m_configured_devices].model_handle,
                                                 m_server_handles[m_configured_devices]));
    
    //@TODO add own model here

    access_flash_config_store();

    hal_led_pin_set(BSP_LED_0 + m_configured_devices, false);
    m_configured_devices++;

    if (m_configured_devices &amp;lt; SERVER_COUNT)
    {
        provisioner_wait_for_unprov(UNPROV_START_ADDRESS + m_provisioned_devices);
        hal_led_pin_set(BSP_LED_0 + m_configured_devices, true);
    }
    else
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;All servers provisioned\n&amp;quot;);
        hal_led_blink_ms(LEDS_MASK, 100, 4);
    }
}

void provisioner_prov_complete_cb(const nrf_mesh_prov_evt_complete_t * p_prov_data)
{
    /* We should not get here if all servers are provisioned. */
    NRF_MESH_ASSERT(m_configured_devices &amp;lt; SERVER_COUNT);

    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Provisioning complete. Adding address 0x%04x.\n&amp;quot;, p_prov_data-&amp;gt;address);

    /* Add to local storage. */
    ERROR_CHECK(dsm_address_publish_add(p_prov_data-&amp;gt;address, &amp;amp;m_server_handles[m_provisioned_devices]));
    ERROR_CHECK(dsm_devkey_add(p_prov_data-&amp;gt;address, m_netkey_handle, p_prov_data-&amp;gt;p_devkey, &amp;amp;m_devkey_handles[m_provisioned_devices]));

    //@TODO add own model to local storage and bind client/config.

    /* Bind the device key to the configuration server and set the new node as the active server. */
    ERROR_CHECK(config_client_server_bind(m_devkey_handles[m_provisioned_devices]));
    ERROR_CHECK(config_client_server_set(m_devkey_handles[m_provisioned_devices],
                                         m_server_handles[m_provisioned_devices]));

    m_provisioned_devices++;

    /* Move on to the configuration step. */
    provisioner_configure(UNPROV_START_ADDRESS + m_configured_devices);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I bound my client/server to element 0.&lt;/p&gt;
&lt;p&gt;I can publish server -&amp;gt; client fine, but a client -&amp;gt; server publish gives the invalid param error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/thread/123844?ContentTypeID=1</link><pubDate>Mon, 12 Mar 2018 08:54:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53da070f-0d0c-4641-b1dc-de28d97400cf</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Did you follow this howto in the mesh docs when creating your own model?&lt;/p&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v1.0.1/md_doc_getting_started_how_to_models.html?cp=4_1_0_3_4"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v1.0.1/md_doc_getting_started_how_to_models.html?cp=4_1_0_3_4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you updated your code with the configuration from on/off server, did you get different behavior?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding a second model to the example: Publish adress handle not set.</title><link>https://devzone.nordicsemi.com/thread/123484?ContentTypeID=1</link><pubDate>Thu, 08 Mar 2018 15:45:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e84759e2-5625-42a0-ad63-0770def4b956</guid><dc:creator>sommmen</dc:creator><description>&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;I copied the configuration code from the on/off server:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case PROV_STATE_CONFIG_PUBLICATION_XXX:
        {
            /* also configure XXX @TODO move to own state */
            config_publication_state_t pubstate2 = {0};
            pubstate2.element_address = m_target_address;
            pubstate2.publish_address.type = NRF_MESH_ADDRESS_TYPE_UNICAST;
            pubstate2.publish_address.value = PROVISIONER_ADDRESS;//PROVISIONER_ADDRESS + m_target_address - UNPROV_START_ADDRESS; //@TODO what should this be?
            pubstate2.appkey_index = 0;
            pubstate2.frendship_credential_flag = false;
            pubstate2.publish_ttl = SERVER_COUNT;
            pubstate2.publish_period.step_num = 0;
            pubstate2.publish_period.step_res = ACCESS_PUBLISH_RESOLUTION_100MS;
            pubstate2.retransmit_count = 1;
            pubstate2.retransmit_interval = 0;
            pubstate2.model_id.company_id = ACCESS_COMPANY_ID_NORDIC;
            pubstate2.model_id.model_id = XXX_SERVER_MODEL_ID;
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;Setting publication address for the XXX server to 0x%04x\n&amp;quot;, pubstate2.publish_address.value);

            ERROR_CHECK(config_client_model_publication_set(&amp;amp;pubstate2));          

            break;
        }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>