<?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>Custom mesh 3.0.1 messages.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44366/custom-mesh-3-0-1-messages</link><description>Hello everyone, 
 This question is aimed at both Nordic and everyday users of a forum. I am testing out NRF52832 devboards in a mesh configuration I can run examples from sdk 3.0.1 and I am interested in having a mesh configuration where I could send</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 05 Aug 2019 10:50:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44366/custom-mesh-3-0-1-messages" /><item><title>RE: Custom mesh 3.0.1 messages.</title><link>https://devzone.nordicsemi.com/thread/202387?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2019 10:50:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3185157-4344-4e6a-a737-00879f8474a6</guid><dc:creator>Biliban Tierli</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am not sure if the MAC address is transmitted, but if so you can find it in the&amp;nbsp;&lt;strong&gt;access_message_rx_t -&amp;gt;&amp;nbsp;&lt;span&gt;access_message_rx_meta_t&lt;/span&gt;&amp;nbsp;&lt;/strong&gt;Struct that is received with every message. This documentation shows you what is sent:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Findex.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Findex.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope this helps&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom mesh 3.0.1 messages.</title><link>https://devzone.nordicsemi.com/thread/201385?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2019 02:32:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69f13fc3-3889-4401-8160-9e2e54b576fb</guid><dc:creator>viper1983</dc:creator><description>&lt;p&gt;&lt;span class="tgt"&gt;Hello, how does the receiver get the MAC address and element address of the sender?&lt;/span&gt;&lt;span class="tgt"&gt;Thank you, you gave me a great help, address problem in there get&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom mesh 3.0.1 messages.</title><link>https://devzone.nordicsemi.com/thread/178914?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 12:18:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77f1a738-9903-4dc4-b42d-55b6dff215b2</guid><dc:creator>Biliban Tierli</dc:creator><description>&lt;p&gt;No sorry, I uploaded the same code twice, probably because they are both called main.c.&lt;/p&gt;
&lt;p&gt;This is the Code for the Server:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7242.main.c"&gt;devzone.nordicsemi.com/.../7242.main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But yes technically it is possible to have a Node act as both a client and a server. For that you would just need to merge the two Models to one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom mesh 3.0.1 messages.</title><link>https://devzone.nordicsemi.com/thread/178888?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 10:40:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9e47108-8984-4e69-b186-694207d4ce12</guid><dc:creator>JohnRickman</dc:creator><description>&lt;p&gt;are server and client using same code? is it because you are not using light switch model as a base?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom mesh 3.0.1 messages.</title><link>https://devzone.nordicsemi.com/thread/178686?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 13:26:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:234e48ec-23ff-498c-8076-e0ff3d1097fb</guid><dc:creator>Biliban Tierli</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;of Course! In my example i am using two nRF52840 Development Kits. I am using the light_switch example from the mesh sdk. I have a Server as well as a Client. The Client can remotely control the LEDs of the Server. I am currently using my Phone and the nRF-Mesh App to provision these Node. You have to set the Client Publication Address to the Unicast Address of the Server or you could also Publish to a Group Address (0xC0 or higher) and Subscribe with the Server to the same Address.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Server&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/412810.main.c"&gt;devzone.nordicsemi.com/.../412810.main.c&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Client&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/412810.main.c"&gt;devzone.nordicsemi.com/.../412810.main.c&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you have anymore questions feel free to ask.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Kilian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom mesh 3.0.1 messages.</title><link>https://devzone.nordicsemi.com/thread/178599?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 09:33:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a833ca4d-4bdd-4d3f-b36b-beab0c3c832c</guid><dc:creator>JohnRickman</dc:creator><description>&lt;p&gt;Hey Kilian,&lt;/p&gt;
&lt;p&gt;I am also looking into using Bluetooth mesh to pass custom messages for my home sensor network. I am bit of hobbyist and coding is not my strong side yet as I am just getting into trying nordics devboards, could you share your&amp;nbsp; source code for this project so I would have a reference point to test passing some custom messages back and forth.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;John.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom mesh 3.0.1 messages.</title><link>https://devzone.nordicsemi.com/thread/173997?ContentTypeID=1</link><pubDate>Mon, 04 Mar 2019 13:23:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd49cd80-866c-4647-b489-2cb6207d91c2</guid><dc:creator>Biliban Tierli</dc:creator><description>&lt;p&gt;Hi James,&lt;/p&gt;
&lt;p&gt;I am pretty new to the NRF52 ecosystem and so I was wondering the same. After a lot of research and trial &amp;amp; error I found the following:&lt;/p&gt;
&lt;p&gt;A model_init_cb function can be specified in the init_params of the&amp;nbsp;&lt;strong&gt;mesh_stack_init&lt;/strong&gt; function. In your &lt;span&gt;model_init_cb&amp;nbsp;&lt;/span&gt;function this should be done:&lt;/p&gt;
&lt;p&gt;The function that actually adds the model is&amp;nbsp;&lt;strong&gt;access_model_add&lt;/strong&gt;. This function takes two arguments,&amp;nbsp;&lt;strong&gt;access_model_add_params_t&lt;/strong&gt; and &lt;strong&gt;access_model_handle_t&lt;/strong&gt; which is just a &lt;strong&gt;uint16_t&lt;/strong&gt;. Here is a code example of my usecase:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;uint16_t model_handle;&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;access_model_add_params_t add_params =&lt;/em&gt;&lt;br /&gt;&lt;em&gt; {&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .model_id = ACCESS_MODEL_VENDOR(0xFFAA, 0xF001),&amp;nbsp; // Format of ACCESS_MODEL_VENDOR is (model_id, company_id)&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .element_index = 0,&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .p_opcode_handlers = &amp;amp;m_opcode_handlers[0],&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .opcode_count = ARRAY_SIZE(m_opcode_handlers),&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .p_args = NULL,&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .publish_timeout_cb = publish_interval_cb&lt;/em&gt;&lt;br /&gt;&lt;em&gt; };&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;uint32_t status = access_model_add(&amp;amp;add_params, &amp;amp;model_handle);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Some of the Parameters inside the&amp;nbsp;&lt;strong&gt;access_model_add_params_t&amp;nbsp;&lt;/strong&gt;need some explaining:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;- model_id: The Model ID is used for identifying predefined Models, like the Simple_OnOff_Client you are probably using. If you want to make your own you you can choose your own ID and Company value. What I have found is, that the two MSB of these values should be 1 (0xC0 or higher).&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;- element_index: Defines in which element your model will be imported. Health and Config Server are at index 0.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;-&amp;nbsp;&amp;nbsp;p_opcode_handlers: This contains your OpCodes and should look something like this:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;static const access_opcode_handler_t m_opcode_handlers[] =&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ACCESS_OPCODE_VENDOR(0xC1, 0xF001), your_opcode_handler_function},&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Format of ACCESS_OPCODE_VENDOR is (opcode, company_id)&lt;br /&gt;&lt;/em&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Again what I have found is, that the two MSB of these values should be 1 (0xC0 or higher).&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Your OpCode Handler Function should look like this:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //&amp;nbsp;static void your_opcode_handler_function(access_model_handle_t handle, const access_message_rx_t * p_rx_msg, void * p_args);&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;- p_args: Can be any additional arguments&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;- publish_timeout_cb: Haven&amp;#39;t played around with it yet, currently is just an empty function for me.&lt;/p&gt;
&lt;p&gt;After calling&amp;nbsp;&lt;strong&gt;access_model_add&lt;/strong&gt; you should call&amp;nbsp;&lt;strong&gt;access_model_subscription_list_alloc&lt;/strong&gt;, to allow it to subscribe to addresses. If both of these functions return the status 0 (NRF_SUCCESS) your model is added.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To send data you can now use the&amp;nbsp;&lt;strong&gt;access_model_publish &lt;/strong&gt;function. In my example I have it bound to a button in the button event handler. The parameter for the function look like this:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;const uint8_t data[] = {0x00};&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;const access_message_tx_t msg = {&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .opcode = ACCESS_OPCODE_VENDOR(0xC2, 0xF001), // Format of ACCESS_OPCODE_VENDOR is (opcode, company_id)&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .p_buffer = &amp;amp;data,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .length = ARRAY_SIZE(data),&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .force_segmented = false,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .transmic_size = NRF_MESH_TRANSMIC_SIZE_SMALL,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .access_token = nrf_mesh_unique_token_get()&lt;/em&gt;&lt;br /&gt;&lt;em&gt; };&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;access_model_publish(model_handle, &amp;amp;msg);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Here you can now specify your own data. You could make a Structure with all your Data and a Function which converts it to a uint8_t Array, aswel as a function which can then convert it back from a uint8_t Array to your Structure.&lt;/p&gt;
&lt;p&gt;For most of the Information I used the Mesh SDK Documentation:&amp;nbsp;&lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/Mesh_SDK/v3-1-0/index"&gt;www.nordicsemi.com/.../index&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope this was helpful and if you have any more questions feel free to ask.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Kilian&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>