<?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 second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24563/adding-second-element-to-a-light-control-server-node-mesh-example</link><description>Hi,
I&amp;#39;m trying to add another element with a simple onoff model to control a second LED on the same server node.
I get APP_ERROR. I try declaring m_server0, m_server1, generic_get0_cb, generic_get1_cb, etc..
but in that way I would have to call simple_on_off_server_init</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Sep 2017 14:34:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24563/adding-second-element-to-a-light-control-server-node-mesh-example" /><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96710?ContentTypeID=1</link><pubDate>Wed, 06 Sep 2017 14:34:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd235d44-aa83-4bf6-a1f5-f02a3e4505f3</guid><dc:creator>ms3412amo</dc:creator><description>&lt;p&gt;Thank you for this information. It will help for sure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96709?ContentTypeID=1</link><pubDate>Wed, 06 Sep 2017 07:11:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6831cd0-795f-4066-b7c6-9bda3f01f26d</guid><dc:creator>Thomas Stenersen</dc:creator><description>&lt;p&gt;Hi ms3412amo,&lt;/p&gt;
&lt;p&gt;The light control client example is unfortunately not made as a general purpose provisioner as you&amp;#39;ve discovered. It&amp;#39;s assuming that the node it&amp;#39;s provisioning is a light control server with only one element and one simple on off server model. In other words, multiple elements and models &lt;em&gt;is&lt;/em&gt; supported, it&amp;#39;s just not integrated into the provisioner &lt;em&gt;example&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;To make it work for multiple elements and multiple models, there are as Hung pointed out a couple of changes to be made:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;When the provisioner receives the &lt;code&gt;NRF_MESH_EVT_PROV_CAPS_RECEIVED&lt;/code&gt; event, it needs to inspect the &lt;code&gt;num_element&lt;/code&gt; variable and store it for the device currently being provisioned. As you may know, when being provisioned a device is assigned a range of unicast addresses: &lt;code&gt;[unicast_start, ..., unicast_start + num_elements - 1]&lt;/code&gt;. The provisioner needs to store the a publication address for each of the elements in the newly provisioned node to talk to them.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;When configuring the device, in the &lt;code&gt;config_client_event_cb()&lt;/code&gt;, the &lt;code&gt;CONFIG_OPCODE_COMPOSITION_DATA_STATUS&lt;/code&gt; event gives the &lt;em&gt;composition data&lt;/em&gt; of the node. It details the structure of the elements and models of the node. This can be used to know what models are present and configure the correct keys and publication state for them.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I understand that this is a lot to take in, the mesh provisioner can get quite complex. I would advise you to read the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v0.9.2/md_doc_getting_started_how_to_build_your_network.html?cp=4_1_0_3_5"&gt;How to build a network&lt;/a&gt; guide on the infocenter for an introduction to the provisioning and configuration process in Bluetooth Mesh. Otherwise the &lt;a href="https://www.bluetooth.com/specifications/mesh-specifications"&gt;official Bluetooth Mesh profile specification&lt;/a&gt; is not a terrible read.&lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;br /&gt;
Thomas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96704?ContentTypeID=1</link><pubDate>Tue, 05 Sep 2017 15:55:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e2823dd-4e7d-4da8-b92c-94e5df38989f</guid><dc:creator>ms3412amo</dc:creator><description>&lt;p&gt;Hi, thank you for your answer. I finally added more opcode and callback to simple_on_off_model to control more than just an output. It&amp;#39;s working fine, but I would like to have to ability to add elements in a node in a near future. I understand the Mesh specification is new and some features still need to be implemented in Nordic Mesh SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96703?ContentTypeID=1</link><pubDate>Tue, 05 Sep 2017 15:18:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8881da6-3b95-4b67-8619-fd9645521715</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi ms,
Sorry for late response.&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t seem the current provisioner in the lighting example check for the number of elements (num_components or num_elements) in the capability sent by the provisionee.
The number of element is reported back to the provisioner in NRF_MESH_EVT_PROV_CAPS_RECEIVED event  (event.params.prov_oob_caps_received.oob_caps.num_elements = p_pdu-&amp;gt;num_components;) but doesn&amp;#39;t seem this value is used by the provisioner. Also the provisioner doesn&amp;#39;t seems to assign the application key to the second server.
I will report this issue internally.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96708?ContentTypeID=1</link><pubDate>Tue, 29 Aug 2017 18:37:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:893d8bac-119b-46e7-ba48-aba7407e8a52</guid><dc:creator>ms3412amo</dc:creator><description>&lt;p&gt;Hi Petter, I&amp;#39;m on client&amp;#39;s project, assuming my server is OK. Do I need to change provisioner.c code to access 2 elements in a same node. In main.c access_setup seems ok to me without any change. I try this with 2 devkits, 1 clients(devkitA) controlling 2 servers in the same node(devkitB). I got the first LED working with button0 from devkitA, but I got APP_ERROR code 7 on ERROR_CHECK(status) at the end of button_event_handler when I try button1 to control the second LED (second element in the node). I suspect provisioning not binding the 2 elements to the clients model. I&amp;#39;m almost at a point to try adding a second led in the simpleOnOffModel, with more opcode and callback of opcode to control the other led, but I would prefer to understand adding a element with the same model before customising simpleOnOff model. Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96706?ContentTypeID=1</link><pubDate>Mon, 28 Aug 2017 10:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6d30452-0e1f-4405-81df-514cae98f5e6</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Seems to me like you have two elements with a Simple OnOff model in each, and your approach is correct. With regards to simple_on_off_server_init(), it should be okay to call it twice, as long as it is on different elements. If you have any more specific questions, let me know, I&amp;#39;ll try to answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96707?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2017 14:34:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:801d9662-63f4-4025-b86b-e92e0552e1e4</guid><dc:creator>ms3412amo</dc:creator><description>&lt;p&gt;It was in ERROR_CHECK(access_model_subscription_list_alloc(m_server1.model_handle)); on the second call of this function because I declare two m_serverX, one per element. That was because my ACCESS_MODEL_COUNT was set to 2 (one config model and one simple_on_off) instead of 3 (1 config and 2 simple_on_off), I don&amp;#39;t have this error anymore, I got provisioning message on RTT, so.. Now I still have to check on client&amp;#39;s code side to map button function to control the second LED on this the server. But as I wrote above, I still not sure about my server code, I&amp;#39;m not sure I really have 2 elements with a simple_on_off_model in each. I&amp;#39;m working on this today. If you have any suggestion or advice to help me solve this I would really appreciate this. I&amp;#39;m trying with 1 client(switchs) and 1 server(2 leds).Thanks to follow my case, I really appreciate it, my first experience with Nordic devices and Bluetooth Mesh.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96702?ContentTypeID=1</link><pubDate>Thu, 24 Aug 2017 12:44:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b5c3444-be18-4809-93db-fa9f4b88575a</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;No_RAM? Do you mean NRF_ERROR_NO_MEM? Which function returned it? And where inside the function was it returned from?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96701?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2017 15:20:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b76a3b0-9b49-4bbc-b58a-d033287a3ded</guid><dc:creator>ms3412amo</dc:creator><description>&lt;p&gt;Error was No_RAM, some numbers to scale missing in nrf_mesh_config_app.h like ACCESS_MODEL_COUNT. Now on server node it seems to run but still not sure about some points: DSM_VIRTUAL_ADDR_MAX is it the number of Model to be addressed in the device, I put 2.
I got provisionning completed, I&amp;#39;m now on client side to adapt code to control 2 Led on the same server. I&amp;#39;m in access_setup() to see whats going there...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adding second element to a light control server node mesh example</title><link>https://devzone.nordicsemi.com/thread/96705?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2017 14:44:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba95e41f-fca3-484c-80e2-92486d380f7a</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Which error do you get? From which function?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>