<?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>mesh nodes: concurrent advertising and scanning</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107475/mesh-nodes-concurrent-advertising-and-scanning</link><description>We are developing a project where we have a BLE Mesh netrwork where each node is implementing generic ON OFF client and server, a specific vendor model (derived from the Nordic&amp;#39;s Chat example), and DFU target. 
 After some hard work, everything is working</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 Jan 2024 14:24:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107475/mesh-nodes-concurrent-advertising-and-scanning" /><item><title>RE: mesh nodes: concurrent advertising and scanning</title><link>https://devzone.nordicsemi.com/thread/464848?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 14:24:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bcc4cda-f576-4097-ad09-b69a60b85171</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Excellent. Glad to know that it works now. &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f44d.svg" title="Thumbsup"&gt;&amp;#x1f44d;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mesh nodes: concurrent advertising and scanning</title><link>https://devzone.nordicsemi.com/thread/464843?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 14:16:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57d2ee17-0982-4ebd-a216-e511cefde414</guid><dc:creator>DavideDN</dc:creator><description>&lt;p&gt;OK, I tested it. It failed at the first try, but after adding some line into proj.conf it worked!&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_BT_EXT_ADV=y
# 5 sets are used by Bluetooth mesh, 1 is needed for the sample advs.
CONFIG_BT_EXT_ADV_MAX_ADV_SET=6
CONFIG_BT_MAX_CONN=2
CONFIG_BT_ID_MAX=2&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;At the end it looks reasonable and correct, but sometime it is a little hard to understand all the pieces that are needed to bi stitched together!&lt;/p&gt;
&lt;p&gt;Good, Thank for the right hints!&lt;/p&gt;
&lt;p&gt;you may close this ticket now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mesh nodes: concurrent advertising and scanning</title><link>https://devzone.nordicsemi.com/thread/464796?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 12:37:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:732746b6-ee05-432f-9f18-6b823c1644e1</guid><dc:creator>DavideDN</dc:creator><description>&lt;p&gt;OK, thank you for the &amp;quot;scanning&amp;quot; approach confirmation.&lt;/p&gt;
&lt;p&gt;Later I am checking the advertising part copying the relevant snippets from the &amp;quot;ble_peripheral_lbs_coex&amp;quot; as you suggested.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mesh nodes: concurrent advertising and scanning</title><link>https://devzone.nordicsemi.com/thread/464792?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 12:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84eec7ff-9fe6-413e-b4cc-6e2618570fe8</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi again,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You are right,&amp;nbsp;bt_le_scan_cb_register() is the way to go. What I suggested earlier was outdated.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can find the practice of doing this in how we scan for Enocean beacons in the nrf/samples/bluetooth/mesh/silviar_enocean sample.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;We declare&amp;nbsp;bt_le_scan_cb_register() inside&amp;nbsp;bt_enocean_init() in&amp;nbsp;\nrf\subsys\bluetooth\enocean.c&amp;nbsp; to process the&amp;nbsp;Enocean advertising packet when mesh scanning. &lt;br /&gt;&lt;br /&gt;enocean.c is used by&amp;nbsp;\nrf\subsys\bluetooth\mesh\vnd\silvair_enocean_srv.c server.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mesh nodes: concurrent advertising and scanning</title><link>https://devzone.nordicsemi.com/thread/464785?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 12:19:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9b6e841-b756-4eea-b25a-9fc47831dfd9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Davide,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry that I misread what you wrote. I will check with the team to see if what you do is correct or if they have another opinion.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mesh nodes: concurrent advertising and scanning</title><link>https://devzone.nordicsemi.com/thread/464764?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 11:19:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b02a171-5168-4114-9f59-46f2b3bd16a8</guid><dc:creator>DavideDN</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Thank you for the answer.&lt;/p&gt;
&lt;p&gt;I believe there is no need to have or risk scan conflicts: the BLE mesh stack *HAS* to rely on a continuous scanning activity to work, our need is to simply have a copy of each scan event also inside our application code. We do not need any new scanner instance to be activated.&lt;/p&gt;
&lt;p&gt;Following this idea I discovered and tried bt_le_scan_cb_register(&amp;amp;scan_callbacks); as said in my first message.&lt;/p&gt;
&lt;p&gt;Can you comment on it? is this a &amp;quot;correct&amp;quot; approach to listen to other applications advertising messages?&lt;/p&gt;
&lt;p&gt;br&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Davide&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mesh nodes: concurrent advertising and scanning</title><link>https://devzone.nordicsemi.com/thread/464759?ContentTypeID=1</link><pubDate>Thu, 18 Jan 2024 10:42:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:774d7070-5d96-4061-83d4-5a8a8b81055c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi David,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t have a sample doing observer and beacon at the same time with mesh.&lt;/p&gt;
&lt;p&gt;But we do have example doing advertising and peripheral with mesh. Please take a look at the nrf/samples/bluetooth/mesh/ble_peripheral_lbs_coex. After you flash the sample you can find it will advertise with 2 advertising sets one as an unprovisioned mesh and one with LBS UUID.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The reason that the observer is usually not showed concurrently with mesh is that there will be conflict.&amp;nbsp;For a mesh node to be able to operate it need to scan for BLE ADV packets. If you do scanning at the same time at mesh you will reduce the time the mesh&amp;nbsp;stack can scan for mesh packet. So there will be some compromise here. But from my point of view it should be fine in the code to do so, just need to reduce the duty cycle of scanning to minimum as possible (then you have less chance to catch your message when you do scanning)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Another better option is to piggybacking your scanning with the mesh scanning. I don&amp;#39;t think it&amp;#39;s support in the mesh stack. You will have no callback in your application when the mesh stack scan and find a packet. This ticket is related to it:&amp;nbsp;&lt;a href="https://lists.zephyrproject.org/g/devel/topic/bt_le_scan_of_node_in_mesh/27269871"&gt;https://lists.zephyrproject.org/g/devel/topic/bt_le_scan_of_node_in_mesh/27269871&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What the ticket suggested was to&amp;nbsp;implement your code inside&amp;nbsp;bt_mesh_scan_cb() in&amp;nbsp;\zephyr\subsys\bluetooth\mesh\adv to add your own callback in.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>