<?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 v5.0.0 chat_model &amp;quot;Out of segment buffers&amp;quot;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99368/mesh-v5-0-0-chat_model-out-of-segment-buffers</link><description>Hello, im trying to create a mesh system with sensors that work like a chat. I tested it on 5 devices and there is a strange behavior. After 120 test messages an error appears : &amp;quot; 
 i know it has to do with a buffer being full, but i dont know how to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 21 May 2023 21:24:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99368/mesh-v5-0-0-chat_model-out-of-segment-buffers" /><item><title>RE: MESH v5.0.0 chat_model "Out of segment buffers"</title><link>https://devzone.nordicsemi.com/thread/426400?ContentTypeID=1</link><pubDate>Sun, 21 May 2023 21:24:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b072db8c-1f20-4b36-912e-3e8d19d8f436</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi Jejpi23,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My sincerest apology for the long waiting time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As you have noted, the buffer is filled. However, it cannot be&amp;nbsp;emptied&amp;nbsp;at will by the application, as it is entirely controlled by the mesh stack. The rate data is &amp;quot;consumed&amp;quot; from this buffer is also controlled by the mesh stack. Therefore, our only approach to this is to reduce the rate the data is added to this buffer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Just like you have observed, one factor is how&amp;nbsp;often messages are being sent.&lt;/p&gt;
&lt;p&gt;Another factor is that, how many times each segment is resent.&lt;/p&gt;
&lt;p&gt;As recommended by the Mesh Profile Spec &lt;a href="https://www.bluetooth.com/specifications/specs/mesh-profile-1-0-1/"&gt;v1.0.1&lt;/a&gt;&amp;nbsp;(applicable to nRF Connect SDK v2.1.2), section 3.5.3.3, each segment is sent multiple times. The number of times is configurable by &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/kconfig/index.html#CONFIG_BT_MESH_TX_SEG_RETRANS_COUNT"&gt;CONFIG_BT_MESH_TX_SEG_RETRANS_COUNT&lt;/a&gt;. In my tests, reducing this to 2 has fixed the issue.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;On the other hand, I would like to recommend you reevaluate the strategy to send sensor data via human readable mesh chat messages. Like we have seen, segmented messages are quite costly to the mesh stack. It is actually quite costly to the network&amp;#39;s throughput and the devices&amp;#39; power consumption as well.&lt;br /&gt;All of those are often scarce resources that needed saving.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/nrf/libraries/bluetooth_services/mesh/sensor_models.html"&gt;The Sensor Models&lt;/a&gt; are created for&amp;nbsp;the purpose of&amp;nbsp;communicating sensor readings. Perhaps you could give those a try instead?&lt;br /&gt;You probably already know it, but here are the links to samples that use the Sensor Models:&lt;br /&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/nrf/samples/bluetooth/mesh/sensor_server/README.html"&gt;Bluetooth: Mesh sensor — nRF Connect SDK 2.1.2 documentation (nordicsemi.com)&lt;br /&gt;&lt;/a&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/nrf/samples/bluetooth/mesh/sensor_client/README.html"&gt;Bluetooth: Mesh sensor observer — nRF Connect SDK 2.1.2 documentation (nordicsemi.com)&lt;/a&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/nrf/samples/bluetooth/mesh/sensor_server/README.html"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;By the way, I don&amp;#39;t really understand the motivation behind the implementation in the &lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;my_enemy&lt;/span&gt;&amp;nbsp;function of your code.&amp;nbsp;Having said that, I&amp;nbsp;think it is just some test code, so it is not very important.&lt;/p&gt;
&lt;p&gt;Once again, I am very sorry for the very long wait.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MESH v5.0.0 chat_model "Out of segment buffers"</title><link>https://devzone.nordicsemi.com/thread/424039?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 14:00:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb46bcf3-53a7-4994-95e0-1e7dd353943e</guid><dc:creator>Jejpi23</dc:creator><description>&lt;p&gt;v3.12.0 - nrf Connect&lt;br /&gt;v1.2.4 - Toolchain&lt;br /&gt;v2.1.2 - nrf Connect SDK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MESH v5.0.0 chat_model "Out of segment buffers"</title><link>https://devzone.nordicsemi.com/thread/424031?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 13:56:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eac3b292-d2ef-493e-a121-38251be49c47</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;No problem. Please remember to tell me the version of NCS you are using.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MESH v5.0.0 chat_model "Out of segment buffers"</title><link>https://devzone.nordicsemi.com/thread/424013?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 13:24:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41d35c03-8f40-46dd-a5b1-494d1b53f102</guid><dc:creator>Jejpi23</dc:creator><description>&lt;p&gt;Yes, sorry my mistake.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MESH v5.0.0 chat_model "Out of segment buffers"</title><link>https://devzone.nordicsemi.com/thread/424011?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 13:21:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bed9db3-b968-4aa8-b9a7-6a1320bef66a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Jejpi23,&lt;/p&gt;
&lt;p&gt;You are using the nRF Connect SDK (NCS), right? The title says Mesh v5.0.0 and threw me off.&lt;/p&gt;
&lt;p&gt;I am out of office for the next three working days, but I will attempt to reproduce your issue and look into it when I return.&amp;nbsp;What version of NCS are you using?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MESH v5.0.0 chat_model "Out of segment buffers"</title><link>https://devzone.nordicsemi.com/thread/423932?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 09:25:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bfbf99f-a26b-4b83-8868-3cab33a820a3</guid><dc:creator>Jejpi23</dc:creator><description>&lt;p&gt;Update &lt;br /&gt;&lt;br /&gt;When i change the k_timer_start second time value the error appears either sonner ( if the value is lower) or way later ( value = 2000, ater 3000+ records i saw the error).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>