<?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>Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114098/is-there-any-reason-not-to-implement-an-bluetooth-mesh-blob-transfer-sample</link><description>When I first created the BLOB Transfer model, I had to analysis the DFU sample code because there was no BLOB Transfer model sample. 
 Is it possible for me to create a sample and contribute it to the sdk-nrf if possible? If possible, can I create a sample</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Nov 2025 14:59:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114098/is-there-any-reason-not-to-implement-an-bluetooth-mesh-blob-transfer-sample" /><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/554566?ContentTypeID=1</link><pubDate>Mon, 17 Nov 2025 14:59:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c48b2e0f-b89b-4d07-b678-9e6c8180fe2f</guid><dc:creator>Shahin97</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/tot0ro"&gt;TOT0Ro&lt;/a&gt;&amp;nbsp;has there been any update on this pr?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499859?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2024 23:00:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fa53cd4-5fc6-4fbd-950d-0f4b0cce30aa</guid><dc:creator>TOT0Ro</dc:creator><description>&lt;p&gt;Okay, thank you for your kind! I&amp;#39;ll be push a PR soon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499734?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2024 11:55:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b54853b6-67db-4547-be11-9fb5e1856a34</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;You will need a PR, yes. There are some general guidelines here:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/nrf/dev_model_and_contributions/contributions.html"&gt;Contribution guidelines in the nRF Connect SDK (nordicsemi.com)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I believe that if there are any details missing, our team would help you identify or fix them during reviews.&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499685?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2024 08:08:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbb372fa-c742-4b72-8af8-83cc746fa21f</guid><dc:creator>TOT0Ro</dc:creator><description>&lt;p&gt;Here!&lt;br /&gt;&lt;br /&gt;It might be important to look at line 192. You can use it as a replacement for the DFU target sample main.c.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/** @file
 *  @brief Bluetooth Mesh BLOB Transfer Server role sample
 */
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;bluetooth/mesh/dk_prov.h&amp;gt;
#include &amp;lt;zephyr/storage/flash_map.h&amp;gt;
#include &amp;lt;dk_buttons_and_leds.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/bluetooth.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/mesh.h&amp;gt;
#include &amp;quot;dfu_target.h&amp;quot;

#include &amp;lt;zephyr/logging/log.h&amp;gt;
LOG_MODULE_DECLARE(settings, CONFIG_SETTINGS_LOG_LEVEL);

#define BLOB_ID 0xDEADBEEFDEADBEEF

//static struct bt_mesh_blob_io_flash dfu_flash_stream;
static struct bt_mesh_blob_io_flash blob_flash_stream;
static int blob_xfer_start(struct bt_mesh_blob_srv *srv, struct bt_mesh_msg_ctx *ctx,
		     struct bt_mesh_blob_xfer *xfer);
static void blob_xfer_end(struct bt_mesh_blob_srv *srv, uint64_t id, bool success);
static void blob_xfer_suspended(struct bt_mesh_blob_srv *srv);
static void blob_xfer_resume(struct bt_mesh_blob_srv *srv);
static int blob_xfer_recover(struct bt_mesh_blob_srv *srv,
		       struct bt_mesh_blob_xfer *xfer,
		       const struct bt_mesh_blob_io **io);

/* Set up a repeating delayed work to blink the DK&amp;#39;s LEDs when attention is
 * requested.
 */
static struct k_work_delayable attention_blink_work;
static bool attention;

static void attention_blink(struct k_work *work)
{
	static int idx;
	const uint8_t pattern[] = {
#if DT_NODE_EXISTS(DT_ALIAS(led0))
		BIT(0),
#endif
#if DT_NODE_EXISTS(DT_ALIAS(led1))
		BIT(1),
#endif
#if DT_NODE_EXISTS(DT_ALIAS(led2))
		BIT(2),
#endif
#if DT_NODE_EXISTS(DT_ALIAS(led3))
		BIT(3),
#endif
	};

	if (attention) {
		dk_set_leds(pattern[idx++ % ARRAY_SIZE(pattern)]);
		k_work_reschedule(&amp;amp;attention_blink_work, K_MSEC(30));
	} else {
		dk_set_leds(DK_NO_LEDS_MSK);
	}
}

static void attention_on(const struct bt_mesh_model *mod)
{
	attention = true;
	k_work_reschedule(&amp;amp;attention_blink_work, K_NO_WAIT);
}

static void attention_off(const struct bt_mesh_model *mod)
{
	/* Will stop rescheduling blink timer */
	attention = false;
}

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,
};

BT_MESH_HEALTH_PUB_DEFINE(health_pub, 0);

static const struct bt_mesh_blob_srv_cb blob_srv_cb = {
	.start = blob_xfer_start,
	.end = blob_xfer_end,
	.suspended = blob_xfer_suspended,
	.resume = blob_xfer_resume,
	.recover = blob_xfer_recover,
};

static struct bt_mesh_blob_srv blob_srv = {
	.cb = &amp;amp;blob_srv_cb,
};

static int blob_xfer_start(struct bt_mesh_blob_srv *srv, struct bt_mesh_msg_ctx *ctx,
		     struct bt_mesh_blob_xfer *xfer)
{
	printk(&amp;quot;BLOB Transfer Start!!\n&amp;quot;);
	return 0;
}

static void blob_xfer_end(struct bt_mesh_blob_srv *srv, uint64_t id, bool success)
{
	uint8_t **data;
	int i;
	size_t size;
	if (success == 1){
		printk(&amp;quot;BLOB Transfer End: Success\n&amp;quot;);
		size = srv-&amp;gt;state.xfer.size;
		flash_area_read(blob_flash_stream.area, blob_flash_stream.offset, *data, size);
		for (i=0; i&amp;lt;size; i++) {
			printk(&amp;quot;%02X&amp;quot;, (*data)[i]);
		}
		printk(&amp;quot;\n&amp;quot;);
	}
	else {
		printk(&amp;quot;BLOB Transfer End: Failed\n&amp;quot;);
	}
	//bt_mesh_blob_srv_recv(&amp;amp;blob_srv, 0xDEADBEEFDEADBEEF, &amp;amp;blob_flash_stream.io, 0xFF, 2);
}

static void blob_xfer_suspended(struct bt_mesh_blob_srv *srv)
{
	printk(&amp;quot;BLOB Transfer Suspended!!\n&amp;quot;);
}
static void blob_xfer_resume(struct bt_mesh_blob_srv *srv)
{
	printk(&amp;quot;BLOB Transfer Resume\n&amp;quot;);
}
static int blob_xfer_recover(struct bt_mesh_blob_srv *srv,
		       struct bt_mesh_blob_xfer *xfer,
		       const struct bt_mesh_blob_io **io)
{
	//*io = &amp;amp;blob_flash_stream.io;
	printk(&amp;quot;BLOB Transfer Recover\n&amp;quot;);
	return 0;
}

static struct bt_mesh_model models[] = {
	BT_MESH_MODEL_CFG_SRV,
	BT_MESH_MODEL_HEALTH_SRV(&amp;amp;health_srv, &amp;amp;health_pub),
	BT_MESH_MODEL_DFU_SRV(&amp;amp;dfu_srv)
};

static struct bt_mesh_model models2[] = {
	BT_MESH_MODEL_BLOB_SRV(&amp;amp;blob_srv)
};

static struct bt_mesh_elem elements[] = {
	BT_MESH_ELEM(1, models, BT_MESH_MODEL_NONE),
	BT_MESH_ELEM(2, models2, BT_MESH_MODEL_NONE),
};

static const struct bt_mesh_comp comp = {
	.cid = CONFIG_BT_COMPANY_ID,
	.elem = elements,
	.elem_count = ARRAY_SIZE(elements),
};

static void bt_ready(int err)
{
	if (err) {
		printk(&amp;quot;Bluetooth init failed (err %d)\n&amp;quot;, err);
		return;
	}

	printk(&amp;quot;Bluetooth initialized\n&amp;quot;);

	dk_leds_init();

	printk(&amp;quot;B\n&amp;quot;);
	err = bt_mesh_init(bt_mesh_dk_prov_init(), &amp;amp;comp);
	if (err) {
		printk(&amp;quot;Initializing mesh failed (err %d)\n&amp;quot;, err);
		return;
	}

	printk(&amp;quot;C\n&amp;quot;);
	LOG_ERR(&amp;quot;C\n&amp;quot;);
	if (IS_ENABLED(CONFIG_SETTINGS)) {
		settings_load();
	}

	LOG_ERR(&amp;quot;D\n&amp;quot;);
	bt_mesh_prov_enable(BT_MESH_PROV_ADV | BT_MESH_PROV_GATT);

	printk(&amp;quot;Mesh initialized\n&amp;quot;);

	/* Confirm the image and mark it as applied after the mesh started. */
	dfu_target_image_confirm();
	
	bt_mesh_blob_srv_recv(&amp;amp;blob_srv, BLOB_ID, &amp;amp;blob_flash_stream.io, 0xFF, 2);

	printk(&amp;quot;Complete bt_ready\n&amp;quot;);
}

int main(void)
{
	int err;

	printk(&amp;quot;Initializing...\n&amp;quot;);

	// err = bt_mesh_blob_io_flash_init(&amp;amp;dfu_flash_stream, FIXED_PARTITION_ID(slot1_partition),
	// 				 0);
	// if (err) {
	// 	printk(&amp;quot;Failed to init BLOB IO Flash module: %d\n&amp;quot;, err);
	// 	return 1;
	// }
	err = bt_mesh_blob_io_flash_init(&amp;amp;blob_flash_stream, FIXED_PARTITION_ID(slot1_partition),
					 0);
	if (err) {
		printk(&amp;quot;Failed to init BLOB IO Flash module: %d\n&amp;quot;, err);
		return 1;
	}

	k_work_init_delayable(&amp;amp;attention_blink_work, attention_blink);
	dfu_target_init(&amp;amp;blob_flash_stream);

	err = bt_enable(bt_ready);
	if (err) {
		printk(&amp;quot;Bluetooth init failed (err %d)\n&amp;quot;, err);
		return 1;
	}

	return 0;
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499632?ContentTypeID=1</link><pubDate>Sat, 24 Aug 2024 05:27:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f93658c-bd08-41a0-8ac2-0cd5f86669fe</guid><dc:creator>TOT0Ro</dc:creator><description>&lt;p&gt;Cool! The hash idea is good. I guess both pair of BLOB Transfer Client/Server is needed. Right? So, how can I push the commit when I completed? Is there anything I can refer to when contributing? For example, I can request a PR to nrfconnect/sdk-nrf, or I need to write documentation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499599?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 14:02:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ead637ac-10c7-4727-aff8-ed5f5e2d9460</guid><dc:creator>R2</dc:creator><description>&lt;p&gt;Yes please, TOT0Ro, I would like to see it. My interest is moving arbitrary binary data around a mesh, unrelated to DFU.&lt;a title="TOT0Ro" href="https://devzone.nordicsemi.com/members/tot0ro"&gt; &lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499521?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 10:58:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e606615-6ce0-4f4d-b6bc-d9cdeef13b9c</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi TOT0Ro,&lt;/p&gt;
&lt;p&gt;I think printing the data is fine, but I am not sure about the stream. Mesh transfer isn&amp;#39;t exactly instantaneous, so there&amp;nbsp;can be a lot of loggings while the stream isn&amp;#39;t finished.&lt;/p&gt;
&lt;p&gt;I think printing the data, or a simpler hash of it, after the receipt is complete, is good.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499458?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 02:21:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d86bbd9-7ce1-4e3d-b2a3-0a0630de22b6</guid><dc:creator>TOT0Ro</dc:creator><description>&lt;p&gt;Hi rich.rarey,&lt;/p&gt;
&lt;p&gt;This is just from a DFU sample, but it might be a little challenging for someone new to BLOB Transfer and DFU.&lt;/p&gt;
&lt;p&gt;I only took out the BLOB Transfer Server from the DFU target. I can share it if you want.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499457?ContentTypeID=1</link><pubDate>Fri, 23 Aug 2024 02:17:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e36d294-9b05-4b27-a4fb-28b3837e95c1</guid><dc:creator>TOT0Ro</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;I have not used Shell control ever, but it sounds good. I can try it.&lt;/p&gt;
&lt;p&gt;What do you think would be a good feature for the BLOB Transfer sample? I would like to suggest a very simple feature, like printing just the data stream.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499443?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 19:57:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c63a6fdf-0165-428d-af1a-ebc5c1352747</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi rick.rarey,&lt;/p&gt;
&lt;p&gt;I cannot make any promise, but I will relay the interest to our R&amp;amp;D team &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499442?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 19:54:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93cfe744-53b6-48bf-8802-f8e71f6ed1a2</guid><dc:creator>R2</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;br /&gt;Although any BLOB sample would be appreciated--and DFU is a very logical BLOB application---there are a number of requests in DevZone for a standalone sample that moves a large amount of data though a BLE mesh, unrelated to DFU.&lt;/p&gt;
&lt;p&gt;Could the new DFU sample have the BLOB code in a separate file and a walkthough doc be written to show how BLOB works?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499400?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 14:09:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8144e830-bfe7-4b46-8fbf-1b849adb034a</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi TOT0Ro,&lt;/p&gt;
&lt;p&gt;Thank you for your interest in contributing to the SDK. We welcome it.&lt;/p&gt;
&lt;p&gt;Our Mesh R&amp;amp;D team think that&amp;nbsp;it might be better to add the BLOB&amp;nbsp;Server and Client, with Shell control, to the DFU samples. What do you think about this approach?&lt;/p&gt;
&lt;p&gt;Since&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/rich_4000_tomesoftware.com"&gt;R2&lt;/a&gt;&amp;nbsp;asked, below are the commands to evaluate BLOB models with the Mesh Shell sample. A&amp;nbsp;Mesh colleague found it in his note.&amp;nbsp;You will also need to enable the BLOB Server and Client models and Shell commands in the Mesh Shell sample first.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_BT_MESH_SHELL_BLOB_CLI"&gt;CONFIG_BT_MESH_SHELL_BLOB_SRV&lt;br /&gt;CONFIG_BT_MESH_SHELL_BLOB_CLI&lt;br /&gt;CONFIG_BT_MESH_SHELL_BLOB_IO_FLASH&lt;br /&gt;CONFIG_BT_MESH_BLOB_CLI&lt;br /&gt;CONFIG_BT_MESH_BLOB_SRV&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="batchfile"&gt;# On BLOB sender shell:

mesh init
mesh cdb create 1234
mesh cdb show
mesh cdb app-key-add 0 0 
mesh prov local 0 1
mesh models cfg appkey add 0 0
mesh models cfg model app-bind 1 0 0x1400
mesh models cfg model app-bind 1 0 0x1401
mesh prov auth-method none
mesh prov remote-adv dddd0000000000000000000000000000 0 5 10
mesh target dst 5
mesh models cfg appkey add 0 0
mesh models cfg model app-bind 5 0 0x1401
mesh models cfg model app-bind 5 0 0x1400
mesh models blob cli target 0x05


# On BLOB receiver shell:
mesh models blob srv rx 0xac

# Then, on BLOB sender shell:
mesh models blob cli tx 0xac 1024 12 30&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there any reason not to implement an bluetooth-mesh BLOB Transfer sample?</title><link>https://devzone.nordicsemi.com/thread/499396?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2024 13:59:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f313a566-1297-4b47-8ac1-59dc7180a65b</guid><dc:creator>R2</dc:creator><description>&lt;p&gt;I would be interested in seeing sample code using the BLOB Transfer Model.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>