<?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>Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45319/proxy-and-nus-in-one-application</link><description>Hi, 
 We are encountering a problem when we try to avail Nordic UART service (NUS) and Mesh service in one application. The problem statement is that after Provisioning, when we disconnect through the nRF Mesh application and go to nRF Connect application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Apr 2019 15:09:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45319/proxy-and-nus-in-one-application" /><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/180069?ContentTypeID=1</link><pubDate>Wed, 03 Apr 2019 15:09:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dac71295-8c7d-4a69-b84e-7c7c78f8ad35</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;If you don&amp;#39;t fully understand how BLE and the NUS service works, it&amp;#39;s very hard for us to help you. I strongly suggest you to get to know how NUS works on both the nRF52 side and the Android/iOS side. Try to answer these questions:&lt;/p&gt;
&lt;p&gt;- How&amp;nbsp;does NUS send data from the nRF52 to the phone, using notification or write command ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- How a notification can be enabled for sending (check CCCD)&lt;/p&gt;
&lt;p&gt;- How does the phone send data down to the NRF52,&amp;nbsp;&lt;span&gt;&amp;nbsp;using notification or write command ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;- Try to make your own app to connect to your nRF52, you can refer to the nRF Blinky app.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/179638?ContentTypeID=1</link><pubDate>Tue, 02 Apr 2019 06:21:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:015e2f72-4e19-470f-987e-0ef47daba040</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;I have fixed that particular issue and can connect via the nRF Toolbox application &lt;strong&gt;after i disconnect &lt;/strong&gt;from the Mesh application. But again, disconnecting from the Mesh application &lt;strong&gt;does not allow a transfer of more than 20 bytes&lt;/strong&gt;.&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/45319/proxy-and-nus-in-one-application/178905"]Here is where you can init your NUS service again.[/quote]
&lt;p&gt;I have initialized the NUS inside the &lt;strong&gt;proxy_init()&lt;/strong&gt; function. This is the reason why I can see the extra service added after I provision the device like you mentioned before. Now after Provisioning, I ideally need to disconnect and send the data via the nRF Toolbox application but the major problem now is:&lt;/p&gt;
&lt;p&gt;1) I cannot send more than 20 bytes of data here and have no idea why&lt;/p&gt;
&lt;p&gt;because &lt;strong&gt;BLE_NUS_MAX_DATA_LEN &lt;/strong&gt;has been set to 244 bytes for sure and hence all the characteristics of NUS must reflect the same.&lt;/p&gt;
&lt;p&gt;2) I cannot receive the data from the node because ble_nus_data_send is not working. I have attached the understanding and the points which are not being executed which is resulting the same action.&lt;pre class="ui-code" data-mode="text"&gt;// In ble_nus.c inside the function ble_nus_data_send
if (!p_client-&amp;gt;is_notification_enabled)
{
    return NRF_ERROR_INVALID_STATE; //The error is returning here and hence the data is not being sent over NUS to the mobile application
}

//Keeping breakpoints we have realised that
if (ble_srv_is_notification_enabled(p_evt_write-&amp;gt;data))
{
    p_client-&amp;gt;is_notification_enabled = true; //This is being executed when we initialize connection via nRFToolbox
    evt.type = BLE_NUS_EVT_COMM_STARTED;
}

//BUT!!!!! 
if (p_client-&amp;gt;is_notification_enabled)  //Does not enter here
{
    memset(&amp;amp;evt, 0, sizeof(ble_nus_evt_t));
    evt.type        = BLE_NUS_EVT_TX_RDY;
    evt.p_nus       = p_nus;
    evt.conn_handle = p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle;
    evt.p_link_ctx  = p_client;
    p_nus-&amp;gt;data_handler(&amp;amp;evt);
}

//I cannot narrow down as to why this is happening&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/179526?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 13:25:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a2b9bc4-b6d5-4ea4-b998-e503b3eadda1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;If there is a NUS service in the attribute table, nRFToolbox should keep the connection. Could you find the logging on nRFToolbox ? Could you try to test also with nRFUART app ?&amp;nbsp;&lt;br /&gt;When you see an issue, please try to find the root cause, don&amp;#39;t use assumption. Why would a reset help here ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/179477?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 11:55:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d884eca8-d504-4fc6-a8ce-543871cea457</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;When I open the nRF Connect app, we can see 4 services which include UART_service &lt;strong&gt;(Only after Provisioning. Before Provisioning we cannot see the NUS)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When I try to connect via nRF Toolbox, it disconnects automatically after connection. Checking the log there, I have come to an understanding that:&lt;/p&gt;
&lt;p&gt;The node is giving out Mesh proxy service first. Hence the services do not match and it disconnects. Therefore I cant think of a method to have both the services placed on the same priority level. Meaning, if I want the to avail NUS, it would be ideal to have the Node provisioned first. But I should not be able to use NUS without provisioning.&lt;/p&gt;
&lt;p&gt;Hence after connecting via Mesh_proxy service we are able to use NUS. Now since the services do not match via the nRF Toolbox app, it is disconnecting.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m assuming by your reply that the only way to do this is to Reset the node right?&lt;/p&gt;
&lt;p&gt;I will take a look at it.&lt;/p&gt;
&lt;p&gt;King Regards,&lt;/p&gt;
&lt;p&gt;Shrinidhi Bhat&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/179459?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 11:20:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39243057-6675-407e-aa01-7b150bc9f5d1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I would suggest you to study BLE and how the softdevice works a little bit more. Try playing with the NUS example.&lt;/p&gt;
&lt;p&gt;Please test using nRF Connect, to check what service you have inside the attribute table.&amp;nbsp;What did you observe when you can&amp;#39;t connect using nRFToolbox, do you see the devices in the list ? NRFToolbox should connect to any device, and if it check there is no NUS service it will disconnect.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There shouldn&amp;#39;t be any problem having multiple services in the GATT table.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To trigger a reset you call&amp;nbsp;NVIC_SystemReset()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/179382?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 05:59:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc219c84-0037-4e71-a7a5-cf4b9146d40a</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;My 3rd point does not do the reset part of it.&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/45319/proxy-and-nus-in-one-application/179276"]my suggestion is to trigger a reset after your finish with&amp;nbsp; configuration[/quote]
&lt;p&gt;Could you please help me out here?&lt;/p&gt;
&lt;p&gt;Currently I haven&amp;#39;t called NUS is the main.c file. It is present &lt;strong&gt;inside the proxy_init() &lt;/strong&gt;function itself which is called during the second part of provisioning.&lt;/p&gt;
&lt;p&gt;Should I just add the same inside the &lt;strong&gt;initialiaze() &lt;/strong&gt;function in the main function?&lt;/p&gt;
&lt;p&gt;2 further questions:&lt;/p&gt;
&lt;p&gt;1) Currently I am not able to connect via nRF Toolbox. I have a feeling it is because of the services which do not match. During connection also it hits inside the proxy.c file because of the Mesh_GATT event handler. Am I correct here? Please do let me know where I have gone wrong&lt;/p&gt;
&lt;p&gt;2) But if I want to use the Mesh service again, do we require a reset all over again? Because we cannot have two services parallel right? It can work one after the other.&lt;/p&gt;
&lt;p&gt;How do I go about this?&lt;/p&gt;
&lt;p&gt;I thought that we need send different advertising packets from the node for it to connect via the nRF Toolbox app. Please correct me if I am wrong.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Shrinidhi Bhat&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/179276?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 14:47:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9df506ae-dc7a-40c9-8764-a6b45bf04e21</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I don&amp;#39;t understand your #3.&amp;nbsp;&lt;br /&gt;What is &amp;quot;&lt;strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;NUS is not yet Proxy service because it is not running on the Mesh app&amp;quot; ?&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For your application, unless it has special requirement, my suggestion is to trigger a reset after your finish with&amp;nbsp; configuration. You usually only do provisioning+configuration once in the product&amp;nbsp; lifetime, so I don&amp;#39;t see the problem trigger a reset after you finish with configuration.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So what you do is to initiate the NUS service at the booting up, in main.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After you have NUS, you can use nRFToolbox UART profile to connect to it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/179185?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 10:30:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e00a28c-f18b-4255-99c1-fccf89d1aed5</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;I have solved that problem and I am able to send 240 bytes of data. The Process for acquiring the NUS is as follows:&lt;/p&gt;
&lt;p&gt;1) I connect from nRF Mesh application and do the entire Provisioning process.&lt;/p&gt;
&lt;p&gt;2) I open nRF Connect app and &lt;strong&gt;cannot see the node because its running in nRF Mesh&lt;/strong&gt; &amp;amp; hence I disconnect from nRF Mesh app.&lt;/p&gt;
&lt;p&gt;3) I now go to nRF Connect and connect and see 4 services, but the&lt;strong&gt; NUS is not yet Proxy service because it is not running on the Mesh app&lt;/strong&gt;. Hence I disconnect it in nRF Connect application &lt;strong&gt;but still keep the tab open.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;4) I connect via nRF Mesh app and go to nRF Connect application. &lt;strong&gt;Here the connection is already established because of the action of the nRF Mesh app, hence no need to voluntarily connect application&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;5) Now we can push 240 bytes of data.&lt;/p&gt;
&lt;p&gt;The problem now is since we plan on creating a custom application, we need nRF Mesh and nRF Connect. But since nRF Connect is not open source we have to use nRF Toolbox.&lt;/p&gt;
&lt;p&gt;nRF Toolbox now does not even connect with the node because of it waiting for a mesh_gatt event right? How should the flow be for our custom use? How is the nRF Connect apps &lt;strong&gt;connect &lt;/strong&gt;button so dynamic that it connects with any Nordic device/service. &lt;/p&gt;
&lt;p&gt;In this application we have switch between nRF Connect and nRF Mesh. After Provisioning we have an extra service added too.&lt;/p&gt;
&lt;p&gt;King Regards,&lt;/p&gt;
&lt;p&gt;Shrinidhi Bhat&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/179104?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 05:34:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c1f906b-dfe4-4fcc-966f-84fcb94286ec</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;So, I did both the steps as mentioned in my previous reply, but both threw the same error. To make it simple I added Log files after before and after uart_service_init (NUS). The mesh_provisionee.c chunk of code is given below along with the Log file.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//************This is the chunk of code from mesh_provisionee.c 
#if GATT_PROXY
            mesh_key_index_t key_index;
            uint32_t count = 1;
            nrf_mesh_key_refresh_phase_t kr_phase;

            APP_ERROR_CHECK(dsm_subnet_get_all(&amp;amp;key_index, &amp;amp;count));
            APP_ERROR_CHECK(dsm_subnet_kr_phase_get(dsm_net_key_index_to_subnet_handle(key_index),
                                                    &amp;amp;kr_phase));

            proxy_init();
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;AFTER :proxy_init\n&amp;quot;); //These lines were added
            uart_services_init();
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;AFTER :uart_services_init\n&amp;quot;); //These lines were added

            /* NOTE: Even though the device supports the GATT proxy feature, enabling the proxy
             * state is _not_ required. The Node Identity will be advertised for 60s, if the proxy
             * is enabled, the device will start advertising the Network ID afterwards. The default
             * state for the proxy feature is set with `PROXY_ENABLED_DEFAULT`.
             */
            NRF_MESH_ERROR_CHECK(proxy_node_id_enable(NULL, kr_phase));
//End of code sample
//***************************Start of Log file 
//1st Log is right after dumping the code (Initializations)
&amp;lt;t:        588&amp;gt;, main.c,  856, Initializing and adding models
&amp;lt;t:        592&amp;gt;, ble_nus.c,  506, NUS_DATA_HANDLER being assigned to nus_init in ble_nus.c
&amp;lt;t:        596&amp;gt;, ble_nus.c,  388, Inside ble_nus_init in ble_nus.c
&amp;lt;t:       5457&amp;gt;, mesh_gatt.c,  553, Effective MTU Packet size of Mesh_GATT: 244
&amp;lt;t:       5475&amp;gt;, main.c, 1111, Device UUID : 005955AA000000004BB1BF73B8371451

//2nd Log is after connecting to the node
&amp;lt;t:     281713&amp;gt;, main.c,  784, Successfully updated connection parameters
&amp;lt;t:     281717&amp;gt;, mesh_gatt.c,  714, Log inside the mesh_gatt file after BLE_GAP_EVT_CONNECTED
&amp;lt;t:     315256&amp;gt;, mesh_gatt.c,  807, Entered here: BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST
&amp;lt;t:     315266&amp;gt;, mesh_gatt.c,  535, exchange_mtu_req_handle packet size: 244
&amp;lt;t:     315511&amp;gt;, main.c,  784, Successfully updated connection parameters

//3rd Log is after Identifying and TRYING to Provision the node
//This is where it fails
&amp;lt;t:         12&amp;gt;, mesh_gatt.c,  553, Effective MTU Packet size of Mesh_GATT: 244
&amp;lt;t:         20&amp;gt;, mesh_provisionee.c,  112, AFTER :proxy_init
&amp;lt;t:         22&amp;gt;, app_error_weak.c,  105, Mesh error 8 at 0x00000000 (:0)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I will use addr2line and see the exact line which is throwing the error.&lt;/p&gt;
&lt;p&gt;Thank you for your patience and answers.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Shrinidhi Bhat&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/179030?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 16:32:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaa8f49e-5023-444e-98d1-9bc16373f552</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please post your log.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use addr2line to debug which line throwing the error. Have a look &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/27212/mesh-examples-not-working"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/178962?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 13:52:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f260f18-c678-40cf-bbb0-42a3cb18e081</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Thank you so much for the valuable input. Now I understand why it disconnects and reconnects again during provisioning. Coming back to the problem we are facing.&lt;/p&gt;
&lt;p&gt;My uart_service is initialized in the main.c file. I just externed it and called it right after proxy_init [A very beginner approach]. It is throwing a app_weak_error (Mesh error).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now my next approach would be to initialize the same inside ble_nus.c instead of main.c and calling the header file, &lt;strong&gt;but I&amp;#39;m not sure that is will give me the right result&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;What would your approach be? I also don&amp;#39;t know how to interpret the app_weak_error.c.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Shrinidhi Bhat&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/178905?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 11:55:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83cff8e7-1c51-4bfe-a75e-4faea27cbc41</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi &lt;span&gt;Shrinidhi&lt;/span&gt;,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think I can explain this. The provisioning process is combined of 2 phases, provisioning and configuration. They are performed on different GATT profile. A PB-GATT profile and the Proxy GATT profile respectively.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;PB-GATT is replaced by Proxy GATT after the device provisioned. In our current softdevice we don&amp;#39;t support removing services (only adding) so what we do is to disable softdevice and enable it again and add the Proxy Gatt service in.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Because of this your NUS service is removed after the device is provisioned. And when you reset the device, it will be added as normal.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The code that does the re-initialization of the Proxy GATT is inside mesh_provisionee.c. You can find at&amp;nbsp;NRF_MESH_PROV_EVT_LINK_CLOSED event if the device is provisioned, gatt_database_reset() will be called. This function will disable mesh and then disable softdevice in&amp;nbsp;mesh_evt_handler(). After the softdevice re-enabled (by NRF_SDH_EVT_STATE_DISABLED event) , inside&amp;nbsp;NRF_SDH_EVT_STATE_ENABLED event you can find we initialize proxy_init().&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is where you can init your NUS service again.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/178879?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 10:19:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8024995-234b-40d1-b22f-3387be520aa1</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;We have gotten a partial solution after some tests, hence sorry for the late reply. I will update you with what has been done and the steps afresh:&lt;/p&gt;
&lt;p&gt;1) After dumping the code, in the nRF Connect app we can see NUS and Mesh Proxy service. (4 service)&lt;/p&gt;
&lt;p&gt;2) We Provision the node, bind app keys and give all the addresses. &lt;strong&gt;(All in debug mode)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;3) &lt;strong&gt;&lt;/strong&gt;When we open the nRF Connect app again, we cannot see NUS anymore &lt;strong&gt;(Probably because we availed the Mesh proxy service )&lt;/strong&gt; hence there are only 3 services [Generic access, Generic attribute and Mesh Proxy service]&lt;/p&gt;
&lt;p&gt;4) We shut the debug mode and rerun it again (F5) and we can see &lt;strong&gt;NUS now in nRF Connect app now. We can now send 240 bytes of data too!!!! &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Hence there are 4 services again.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;BUT&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;When we dump the code we cannot avail both the services. My understanding is that the Mesh proxy service is overriding the NUS and hence re-flashing again after &lt;strong&gt;creating a proxy &lt;/strong&gt;&lt;strong&gt;mesh &lt;/strong&gt;&lt;strong&gt;network&lt;/strong&gt; will allow us to send 240 bytes of data. I believe we have 2 Primary services apart from the other generic ones which is causing the problem. &lt;/p&gt;
&lt;p&gt;Now the Question is:&lt;/p&gt;
&lt;p&gt;Q) How do I make the NUS to fall inside the Mesh proxy service. I should be able to use NUS after Provisioning and disconnecting from Mesh network. I don&amp;#39;t want one service to override the other.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Shrinidhi Bhat&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/178485?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 16:56:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e28dd9de-d441-496b-8a35-b1c74ebb73a8</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;No Mesh gatt is just normal BLE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please capture sniffer traces (working and non working situations).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/178397?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 13:59:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a4fda3b-ce2c-4282-af36-1c2f4e143ff4</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/45319/proxy-and-nus-in-one-application/178380"]Could you double check if you can send more than 20 bytes[/quote]
&lt;p&gt;I&amp;#39;m pretty sure the phone supports more than 240 bytes of data. This can be seen in the Log file as:&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: Debug logging for UART over RTT started.&lt;br /&gt;&amp;lt;info&amp;gt; app: Connected inside the ble_evt_handler&lt;br /&gt;&amp;lt;info&amp;gt; app: Data len is set to 0xF4(244)&lt;br /&gt;&amp;lt;info&amp;gt; app: The length of the Data received from nRF Connect is: 33 // I have added a Log to check the length&lt;/p&gt;
&lt;p&gt;I will check the sniffer trace like you suggested.&lt;/p&gt;
&lt;p&gt;But I believe any data upwards of 20 bytes is not hitting mesh_gatt.c. But the Log file shows the the size to be set at 240 bytes.&lt;/p&gt;
&lt;p&gt;Have tested this case before? Of sending more than 240 bytes of data via mesh_gatt? Is there a rule set from the app that &lt;strong&gt;no more than 20 bytes of data can be sent to any Mesh gatt feature? &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Shrinidhi Bhat&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/178380?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 13:24:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f32ee760-5050-4bb9-a12c-7a51607722d6</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;It would be much easier to find the issue by having a &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF-Sniffer/"&gt;sniffer trace&lt;/a&gt;&amp;nbsp;to check if the MTU has been updated and to see what happens&amp;nbsp;between the device and the phone.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can also printout a log if you receive event&amp;nbsp;BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST on the nRF52.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you double check if you can send more than 20 bytes when you modify the ble_app_uart example to support 240 bytes ? There could be a chance that the phone doesn&amp;#39;t support that.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/178223?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 05:58:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07cf39eb-dbed-4220-8e4f-4f4d0ef4fe8f</guid><dc:creator>Shrinidhi Bhat</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;I had done that prior to asking you this question. I had initially set them at 244 and 247 bytes respectively. I even have a log result inside the &lt;strong&gt;exchange_mtu_req_handle &lt;/strong&gt;function which shows the &lt;strong&gt;server_rx_mtu&lt;/strong&gt; size as 247 bytes after the following line of code:&amp;nbsp;&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;uint16_t server_rx_mtu = MAX(MIN(MIN(client_rx_mtu, NRF_SDH_BLE_GATT_MAX_MTU_SIZE), MESH_GATT_MTU_SIZE_MAX), BLE_GATT_ATT_MTU_EDITED); // BLE_GATT_ATT_MTU_EDITED = 247 bytes.&lt;/p&gt;
&lt;p&gt;The problem is when I try to avail the NUS. When I open the nRF Connect application and connect with the DK, it again enters inside the &lt;strong&gt;proxy.c&lt;/strong&gt; and hence &lt;strong&gt;mesh_gatt.c &lt;/strong&gt;as shown by the Log details. Now when I click on NUS and try to send &lt;strong&gt;20 bytes of data&lt;/strong&gt;, it works &lt;strong&gt;perfectly&lt;/strong&gt;. But when I increase that to 21 bytes, it does not even hit the DK and after some time throws a GATT timeout error (0x85/133).&lt;/p&gt;
&lt;p&gt;I will attach the log file in the sequence of operation as given below:&lt;/p&gt;
&lt;p&gt;1) Connect to the DK via nRF Mesh application (Node is already provisioned before)&lt;/p&gt;
&lt;p&gt;2) Disconnect the node from the nRF Mesh application.&lt;/p&gt;
&lt;p&gt;3) Connect the node via nRF Connect application.&lt;/p&gt;
&lt;p&gt;4) Send 20 Bytes of data using nRF connect app.&lt;/p&gt;
&lt;p&gt;5) Send more than 20 bytes of data.&lt;/p&gt;
&lt;p&gt;NOTE:- I will separate each activity by 3 spaces on the Log file for ease of understanding.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//This is the Log file and not the code
//**********1st Activity
&amp;lt;t:        570&amp;gt;, main.c,  847, Initializing and adding models
&amp;lt;t:        606&amp;gt;, mesh_gatt.c,  573, Effective MTU Packet size of Mesh_GATT: 244
&amp;lt;t:        614&amp;gt;, mesh_gatt.c,  556, nus_gatt_peripheral_set: 247
&amp;lt;t:        631&amp;gt;, main.c, 1075, Device UUID : 005955AA000000004BB1BF73B8371451
&amp;lt;t:     959866&amp;gt;, main.c,  775, Successfully updated connection parameters
&amp;lt;t:     959869&amp;gt;, proxy.c,  579, Connected
&amp;lt;t:     959872&amp;gt;, mesh_gatt.c,  517, Inside connect_evt_handle: 247
&amp;lt;t:     959874&amp;gt;, mesh_gatt.c,  731, Log inside the mesh_gatt file after BLE_GAP_EVT_CONNECTED
&amp;lt;t:     996995&amp;gt;, main.c,  775, Successfully updated connection parameters
&amp;lt;t:     999691&amp;gt;, mesh_gatt.c,  527, Checking this out client: 517
&amp;lt;t:     999697&amp;gt;, mesh_gatt.c,  531, Checking this out server: 247
&amp;lt;t:     999701&amp;gt;, mesh_gatt.c,  534, Another Log check: 244
&amp;lt;t:    1009277&amp;gt;, proxy.c,  605, TX ready
&amp;lt;t:    1009287&amp;gt;, mesh_gatt.c,  768, Entered here: BLE_GATTS_EVT_WRITE
&amp;lt;t:    1022062&amp;gt;, mesh_gatt.c,  773, Entered here: BLE_GATTS_EVT_HVN_TX_COMPLETE
&amp;lt;t:    1022069&amp;gt;, proxy.c,  610, Enters the RX via Mesh gatt Handler
&amp;lt;t:    1022072&amp;gt;, proxy.c,  553, RX GATT PDU type 0x2, len 19
&amp;lt;t:    1022083&amp;gt;, mesh_gatt.c,  768, Entered here: BLE_GATTS_EVT_WRITE
&amp;lt;t:    1028442&amp;gt;, mesh_gatt.c,  773, Entered here: BLE_GATTS_EVT_HVN_TX_COMPLETE



//**********2nd Activity
&amp;lt;t:    3498036&amp;gt;, proxy.c,  594, Disconnected
&amp;lt;t:    3498392&amp;gt;, mesh_gatt.c,  741, Log inside the mesh_gatt file after BLE_GAP_EVT_DISCONNECTED


//**********3rd Activity Connect via nRF Connect application
&amp;lt;t:    4619492&amp;gt;, main.c,  775, Successfully updated connection parameters
&amp;lt;t:    4619495&amp;gt;, proxy.c,  579, Connected
&amp;lt;t:    4619497&amp;gt;, mesh_gatt.c,  517, Inside connect_evt_handle: 244
&amp;lt;t:    4619500&amp;gt;, mesh_gatt.c,  731, Log inside the mesh_gatt file after BLE_GAP_EVT_CONNECTED
&amp;lt;t:    4658977&amp;gt;, main.c,  775, Successfully updated connection parameters



//**********4th Activity Send 20 bytes of data via NUS of nRF Connect application
&amp;lt;t:    8517069&amp;gt;, main.c,  932, The Length of Data received from nRF Connect is 20
&amp;lt;t:    8517076&amp;gt;, mesh_gatt.c,  768, Entered here: BLE_GATTS_EVT_WRITE


//**********5th Activity Send more than 20 bytes of data via NUS of nRF Connect application
No Log file as nothing is received by the DK. 
Seeing the Log file of nRF Connect app, there are few takeaways. 
1--&amp;gt; Writing request to characteristics works fine
2--&amp;gt; gatt.writeCharacteristic also visible
3--&amp;gt; Data written to xxxx is NOT visible for anything over 20 bytes
And after some time GATT timeout error is detected

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To help debug, I have tried to get as many Logs as possible. Its still not hitting the &lt;strong&gt;nus_data_handler&lt;/strong&gt; function when sending upwards of 20 bytes.&lt;strong&gt; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Awaiting your reply,&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Shrinidhi Bhat&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proxy and NUS in one application</title><link>https://devzone.nordicsemi.com/thread/178168?ContentTypeID=1</link><pubDate>Mon, 25 Mar 2019 15:24:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6e40018-e9e9-4cc8-ab97-5a716110f0a3</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tried to change&amp;nbsp;MESH_GATT_MTU_SIZE_MAX and&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE from 69 to 240 in the proxy light switch example in our SDK and has no problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please be aware that&amp;nbsp;mesh already has a gatt library (mesh_gatt.c) that handles sd_ble_gatts_exchange_mtu_reply(), you don&amp;#39;t need to have nrf_ble_gatt.c library. There should be only one reply to the MTU exchange request.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you see an error, please go into the root cause.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>