<?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>10 second delay after PB-GATT completed until first Mesh Proxy Service advertisement</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43992/10-second-delay-after-pb-gatt-completed-until-first-mesh-proxy-service-advertisement</link><description>Hi, 
 After provisioning a device using PB-GATT there is a 10 second delay after the PB-GATT connection is closed and the first Mesh Proxy Service advertisement is sent. 
 When the PB-GATT connection is closed the stack will end up in sd_state_evt_handler</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 28 Apr 2019 18:55:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43992/10-second-delay-after-pb-gatt-completed-until-first-mesh-proxy-service-advertisement" /><item><title>RE: 10 second delay after PB-GATT completed until first Mesh Proxy Service advertisement</title><link>https://devzone.nordicsemi.com/thread/184192?ContentTypeID=1</link><pubDate>Sun, 28 Apr 2019 18:55:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fad2e2f0-67cb-4d62-8538-e4fac707b712</guid><dc:creator>JonasJ</dc:creator><description>&lt;p&gt;Thanks, this worked as expected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 10 second delay after PB-GATT completed until first Mesh Proxy Service advertisement</title><link>https://devzone.nordicsemi.com/thread/183819?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2019 12:36:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4955a71-a0cf-498b-b855-9464cb83ab52</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;It seems this workaround was slightly unstable, as figured out internally &amp;amp; thanks to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/jonasj"&gt;JonasJ&lt;/a&gt;&amp;nbsp;in&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46583/scanner-is-disabled-after-provision-completes-with-pb-gatt-enabled-with-10-second-delay-workaround"&gt;this case&lt;/a&gt;! We have a new workaround.&amp;nbsp;&lt;span&gt;In the bearer_handler.c file found under mesh/bearer/src/bearer_handler.c, you can make these changes inside the bearer_handler_stop() function:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;
--- a/mesh/bearer/src/bearer_handler.c
+++ b/mesh/bearer/src/bearer_handler.c
@@ -319,10 +319,14 @@ uint32_t bearer_handler_stop(bearer_handler_stopped_cb_t cb)
         /* Will stop the timeslot when the current action ends. */
         m_stopped_callback = cb;
         m_stopped = true;
-        if (timeslot_session_is_active())
+        if (timeslot_is_in_ts())
         {
             timeslot_trigger();
         }
+        else if (timeslot_session_is_active())
+        {
+            timeslot_stop();
+        }
         else
         {
             notify_stop();&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&amp;nbsp;&lt;/strong&gt;As can be seen in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/43301/nrf_mesh_disable-function-changed-since-sdk-for-mesh-v3-1-0/180061#180061"&gt;this &lt;/a&gt;case, one should also replace action_switch() in&amp;nbsp;&lt;span&gt;bearer_handler_timer_irq_handler() with this code:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; if (m_stopped)
        {
            timeslot_stop();
        }
        else
        {
            action_switch();
        }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This ensures that the 10 second delay works in both PB-ADV &amp;amp; PB-GATT. Without this extra code, the 10 second delay is still present in PB-ADV.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 10 second delay after PB-GATT completed until first Mesh Proxy Service advertisement</title><link>https://devzone.nordicsemi.com/thread/174664?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 20:14:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cca81180-9de1-4acf-806e-326ebf2f8c64</guid><dc:creator>JonasJ</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve verified it and the delay is below 1 second now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 10 second delay after PB-GATT completed until first Mesh Proxy Service advertisement</title><link>https://devzone.nordicsemi.com/thread/174625?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 15:37:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48a761c5-6117-45db-843c-e2dc7b9d3bcb</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Just an update for the case, we found a bug in our SDK v3.1 that caused the issue.&lt;/p&gt;
&lt;p&gt;If you add&amp;nbsp;scanner_disable(); inside&amp;nbsp;nrf_mesh_disable() function, it would reduce the provisioning time.&lt;/p&gt;
&lt;p&gt;It was an issue that disabling mesh was not immediately disable the timeslot but wait until it&amp;#39;s finished. With scanner_disable we can terminate the session right away and reduce the provisioning time (when switching from provisioning to configuration).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 10 second delay after PB-GATT completed until first Mesh Proxy Service advertisement</title><link>https://devzone.nordicsemi.com/thread/173627?ContentTypeID=1</link><pubDate>Fri, 01 Mar 2019 08:22:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4eee4f84-e8d6-4358-8c62-3bb4397540ae</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Yes, the 10 second delay will still be there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 10 second delay after PB-GATT completed until first Mesh Proxy Service advertisement</title><link>https://devzone.nordicsemi.com/thread/173319?ContentTypeID=1</link><pubDate>Wed, 27 Feb 2019 19:28:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58db6a76-0483-41d1-9b21-560a818f42f1</guid><dc:creator>JonasJ</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;That would speed things up once the connection is established, but the 10 second delay would still be there regardless of the connection interval parameters, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 10 second delay after PB-GATT completed until first Mesh Proxy Service advertisement</title><link>https://devzone.nordicsemi.com/thread/172824?ContentTypeID=1</link><pubDate>Mon, 25 Feb 2019 15:03:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:597c5b1f-0a1a-495c-89f1-25ff1478c9ee</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;We are aware of this bug in the mesh sdk v3.1.0. I will let you know when we find a workaround or fix.&lt;/p&gt;
&lt;p&gt;For now, it can be a good idea to decrease the connection interval in the FW code to min &amp;amp; max values of 30 ms to 60 ms for example (see MIN_CONN_INTERVAL &amp;amp; MAX_CONN_INTERVAL) in nrf_mesh_config_examples.h.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Beware however&lt;/strong&gt;, that the mesh stack shares the timeslot with the softdevice (softdevice is used for the GATT connection). By setting the connection interval so low, you will achieve quicker identification &amp;amp; provisioning times, but you will also make the GATT communication use up more of the timeslot. This leaves less time for the mesh stack to operate, which limits the amount of time the proxy node connected to the phone is able to communicate with the mesh network. Therefore, you can expect less throughput between the proxy node &amp;amp; the nodes it is connected to.&lt;/p&gt;
&lt;p&gt;You will need to figure out a good balance of communication speed between the phone &amp;amp; the proxy node vs. the proxy node &amp;amp; the mesh network by testing different values for min &amp;amp; max connection intervals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>