<?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>BLE mesh : Failed to publish &amp;amp; Out of network adv</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118997/ble-mesh-failed-to-publish-out-of-network-adv</link><description>Hi, 
 I am using sensor observer sample to get the data from sensor sample. However, I notice the power consuption is too high. I have look thourgh the forum and found this technique to reduce the power consumtion. I write one driver for this tehcnique</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 13 May 2025 12:39:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118997/ble-mesh-failed-to-publish-out-of-network-adv" /><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/535127?ContentTypeID=1</link><pubDate>Tue, 13 May 2025 12:39:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bb09d02-a627-4bd3-bfbb-491278eecc17</guid><dc:creator>Ziyao Zhou</dc:creator><description>&lt;p&gt;Thank you for your information！&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/535123?ContentTypeID=1</link><pubDate>Tue, 13 May 2025 12:23:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e3ec75a-71d5-4be3-a8f3-c065d8d07e15</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Here is the&amp;nbsp;&lt;span&gt;PR with fix: &lt;a title="https://github.com/zephyrproject-rtos/zephyr/pull/89881" href="https://github.com/zephyrproject-rtos/zephyr/pull/89881" rel="noopener noreferrer" target="_blank"&gt;https://github.com/zephyrproject-rtos/zephyr/pull/89881&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/529352?ContentTypeID=1</link><pubDate>Thu, 27 Mar 2025 15:44:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54eda44d-499a-4529-972d-05b57ef8d367</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Not fixed in v.2.9.1 yet.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/528739?ContentTypeID=1</link><pubDate>Tue, 25 Mar 2025 05:11:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47e8a32f-6113-4baa-8f8f-637f8387ab78</guid><dc:creator>Ziyao Zhou</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have test in the new 2.91 sdk, the problems is still there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/524132?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 15:15:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5777f25c-7024-40a9-903f-4758768c4d34</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;We cannot promise any schedule on Devzone. Sorry for the inconvenience.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/523976?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 00:21:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5877659e-5da6-42ca-beca-20a11b7feefa</guid><dc:creator>Ziyao Zhou</dc:creator><description>&lt;p&gt;Thank you so much for your information. Could you please let me know when you solve this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/523900?ContentTypeID=1</link><pubDate>Thu, 20 Feb 2025 13:30:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae8fce17-f116-4829-b2ca-cdd61a6d4935</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the team:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Preliminary assesment shows the mesh stack code does not free up advertising memory slabs when mesh is suspended. This, the slabs keep getting consumed during suspend-resume cycles, eventually running out of ADV buffer pool. This requires a bug fix and we might need some time to fix it.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/523650?ContentTypeID=1</link><pubDate>Wed, 19 Feb 2025 09:30:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8da299f-1700-4d81-a2b0-bed68e68aed5</guid><dc:creator>Ziyao Zhou</dc:creator><description>&lt;p&gt;&lt;span&gt;&lt;/span&gt;I have put this code in the original sample and will still have this issue, so the NUS service is not the problem.&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In addition I change the&amp;nbsp;&lt;/span&gt;&lt;a title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_BT_MESH_ADV_BUF_COUNT"&gt;&lt;code&gt;&lt;span&gt;CONFIG_BT_MESH_ADV_BUF_COUNT&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;to&amp;nbsp;256, Still cannot use. But I noticed when the&amp;nbsp;&lt;a title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_BT_MESH_ADV_BUF_COUNT"&gt;&lt;code&gt;CONFIG_BT_MESH_ADV_BUF_COUNT&lt;/code&gt;&lt;/a&gt;&amp;nbsp;is higher, the time when data read stuck to error log is higher. (I do notice that people count will stop printing and after some time the error log happen).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1739973666222v2.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To make sure every&amp;nbsp;&lt;/span&gt;&lt;span&gt;bt_mesh_resume&lt;/span&gt;&lt;span&gt;() and&amp;nbsp;&lt;/span&gt;bt_mesh_suspend() work.&amp;nbsp;&lt;span&gt;My new code is:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;zephyr/bluetooth/bluetooth.h&amp;gt;
#include &amp;lt;bluetooth/mesh/models.h&amp;gt;
#include &amp;quot;model_handler.h&amp;quot;
#include &amp;quot;nus_handler.h&amp;quot; 
#include &amp;quot;pm.h&amp;quot; 

#define GET_DATA_INTERVAL 999

static struct k_work_delayable get_data_work;
BT_MESH_HEALTH_PUB_DEFINE(health_pub, 0);
static bool mesh_suspended = false;


static void sensor_cli_data_cb(struct bt_mesh_sensor_cli *cli,
                               struct bt_mesh_msg_ctx *ctx,
                               const struct bt_mesh_sensor_type *sensor,
                               const struct bt_mesh_sensor_value *value)
{
    if (sensor-&amp;gt;id == bt_mesh_sensor_people_count.id) {
        const char *count_str = bt_mesh_sensor_ch_str(value);
        printk(&amp;quot;People count is %s\n&amp;quot;, count_str);
        nus_update_people_count(count_str);
        if (!mesh_suspended) {
            int err = bt_mesh_suspend();
            if (err) {
                printk(&amp;quot;Error suspending mesh (%d)\n&amp;quot;, err);
            } else {
                mesh_suspended = true;
            }
        } else {
            printk(&amp;quot;Mesh is not resumed, skipping suspend.\n&amp;quot;);
        }
    }
}


static const struct bt_mesh_sensor_cli_handlers bt_mesh_sensor_cli_handlers = {
    .data = sensor_cli_data_cb,
};

static struct bt_mesh_sensor_cli sensor_cli =
    BT_MESH_SENSOR_CLI_INIT(&amp;amp;bt_mesh_sensor_cli_handlers);

static void get_data(struct k_work *work)
{   
    int err;
    if (!bt_mesh_is_provisioned()||(health_pub.addr == BT_MESH_ADDR_UNASSIGNED)) {
        k_work_schedule(&amp;amp;get_data_work, K_MSEC(GET_DATA_INTERVAL));
        return;
    }

    if (mesh_suspended) {
        err = bt_mesh_resume();
        if (err) {
            printk(&amp;quot;Error resuming mesh (%d)\n&amp;quot;, err);
            k_work_schedule(&amp;amp;get_data_work, K_MSEC(GET_DATA_INTERVAL));
             return;
        }
        mesh_suspended = false;
    }

    /* 发送获取People Count的请求 */
    err = bt_mesh_sensor_cli_get(&amp;amp;sensor_cli, NULL, &amp;amp;bt_mesh_sensor_people_count, NULL);
    if (err) {
        printk(&amp;quot;Error getting people count (%d)\n&amp;quot;, err);
        
    }
    

    k_work_schedule(&amp;amp;get_data_work, K_MSEC(GET_DATA_INTERVAL));
}


static void attention_on(const struct bt_mesh_model *mod) {}
static void attention_off(const struct bt_mesh_model *mod) {}

static const struct bt_mesh_health_srv_cb health_srv_cb = {
    .attn_on = attention_on,
    .attn_off = attention_off,
};

static struct bt_mesh_health_srv health_srv = {
    .cb = &amp;amp;health_srv_cb,
};




static struct bt_mesh_elem elements[] = {
    BT_MESH_ELEM(1,
        BT_MESH_MODEL_LIST(
            BT_MESH_MODEL_CFG_SRV,
            BT_MESH_MODEL_HEALTH_SRV(&amp;amp;health_srv, &amp;amp;health_pub),
            BT_MESH_MODEL_SENSOR_CLI(&amp;amp;sensor_cli)
        ),
        BT_MESH_MODEL_NONE
    ),
};

static const struct bt_mesh_comp comp = {
    .cid = CONFIG_BT_COMPANY_ID,
    .elem = elements,
    .elem_count = ARRAY_SIZE(elements),
};

const struct bt_mesh_comp *model_handler_init(void)
{
    k_work_init_delayable(&amp;amp;get_data_work, get_data);
    k_work_schedule(&amp;amp;get_data_work, K_MSEC(GET_DATA_INTERVAL));
    
    return &amp;amp;comp;
}
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;Could you please help me figure out this, thank you so much!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/523377?ContentTypeID=1</link><pubDate>Tue, 18 Feb 2025 01:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a6b21d9-1b09-4762-9174-584d14e294b7</guid><dc:creator>Ziyao Zhou</dc:creator><description>&lt;p&gt;Hi, I am using NCS 2.9.&lt;/p&gt;
&lt;p&gt;After I change the&amp;nbsp;&lt;a title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_BT_MESH_ADV_BUF_COUNT"&gt;&lt;code&gt;&lt;span&gt;CONFIG_BT_MESH_ADV_BUF_COUNT&lt;/span&gt;&lt;/code&gt;&lt;/a&gt; to 30&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1739842050717v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;I will still got this error&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1739842066653v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;By the way, on this mesh device I still got a NUS service, does that affect this issue?&lt;/p&gt;
&lt;p&gt;And only when I add my power management code into the model_handler will I have this issue. If&amp;nbsp;&amp;nbsp; bt_mesh_prov is always enable, this will be OK. Is there any way to clear ADV buffer after disable the mesh?&lt;/p&gt;
&lt;p&gt;Thank you so much for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE mesh : Failed to publish &amp; Out of network adv</title><link>https://devzone.nordicsemi.com/thread/523365?ContentTypeID=1</link><pubDate>Mon, 17 Feb 2025 20:14:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57347a5f-e77b-495c-8ad7-9a9d1fadc82c</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is your NCS version?&lt;/p&gt;
[quote user=""] it can work well for around 30s and then will have &amp;quot;&amp;lt;err&amp;gt; bt_mesh_access: Failed to publish (err -105) &amp;lt;err&amp;gt; bt_mesh_transport: Out of network advs&amp;quot;[/quote]
&lt;p&gt;The error indicates a failure to publish a message likely due to insufficient&amp;nbsp;&lt;span&gt;network advertisement buffers from &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.7.99-ncs1/subsys/bluetooth/mesh/transport.c#L128"&gt;this line&lt;/a&gt;. T&lt;/span&gt;&lt;span&gt;ry to increase&amp;nbsp;&lt;/span&gt;&lt;a title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_BT_MESH_ADV_BUF_COUNT"&gt;&lt;code&gt;&lt;span&gt;CONFIG_BT_MESH_ADV_BUF_COUNT&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>