<?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>Send large amount of data through BLE with pc-ble-driver-py</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126623/send-large-amount-of-data-through-ble-with-pc-ble-driver-py</link><description>Hi, 
 
 I&amp;#39;m using nRF52840 BLE Dongle to connect and perform bonding to a custom target. 
 The connection and bonding are working but I need to write a token (lenght=291) to a characteristic and got error &amp;quot;NRF_ERROR_SD_RPC_SEND&amp;quot;. 
 From what I understand</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Jan 2026 08:40:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126623/send-large-amount-of-data-through-ble-with-pc-ble-driver-py" /><item><title>RE: Send large amount of data through BLE with pc-ble-driver-py</title><link>https://devzone.nordicsemi.com/thread/559438?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2026 08:40:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3c9b315-2019-46dc-91fe-382ab1bc1b2e</guid><dc:creator>Antoine.B</dc:creator><description>&lt;p&gt;Hi PJ,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Okay, all clear for me, thank you for the reply !&lt;/p&gt;
&lt;p&gt;I&amp;#39;m going to try to perform my tests with bleak python package or check if a firmware update to receive chunk is possible.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Antoine&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send large amount of data through BLE with pc-ble-driver-py</title><link>https://devzone.nordicsemi.com/thread/559405?ContentTypeID=1</link><pubDate>Thu, 22 Jan 2026 18:50:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e791434-c18f-4dc7-888d-f25bbb524735</guid><dc:creator>PjGlasso</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;So it is the same error just higher up from the SoftDevice...AFAIK there is NO 291 byte possible MTU &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f91e.svg" title="Fingers crossed"&gt;&amp;#x1f91e;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;the target would need some code to handle the chunks, maybe something like they do in I2S ?&lt;/p&gt;
&lt;p&gt;HTH&lt;/p&gt;
&lt;p&gt;GL :-) PJ &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/270c.svg" title="V"&gt;&amp;#x270c;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send large amount of data through BLE with pc-ble-driver-py</title><link>https://devzone.nordicsemi.com/thread/559240?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2026 10:23:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abe98d8b-5310-4b78-b885-4ff707545c5e</guid><dc:creator>Antoine.B</dc:creator><description>&lt;p&gt;Hi PJ,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for the details response !&lt;/p&gt;
&lt;p&gt;I tried your code sample and it does the correct job ! But unfortunately, the target does&amp;#39;t not handle chunk for token...&lt;/p&gt;
&lt;p&gt;I have few last questions:&lt;/p&gt;
&lt;p&gt;- So there is no possible update of pc-ble-driver-py package to increase the MTU ?&lt;/p&gt;
&lt;p&gt;- What the error&amp;nbsp;NRF_ERROR_SD_RPC_SEND means ? Because it occurs when trying to send the 291 bytes lenght data. but it&amp;#39;s not the same error as invalid lenght&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Anyway, thank for your response, it&amp;#39;s clear for my issue !&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Antoine&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Send large amount of data through BLE with pc-ble-driver-py</title><link>https://devzone.nordicsemi.com/thread/559201?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2026 19:46:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dec8465b-5c1c-4a90-91d2-45e8ab510dd3</guid><dc:creator>PjGlasso</dc:creator><description>&lt;p&gt;HI there,&lt;/p&gt;
&lt;div class="Y3BBE" data-sfc-cp="" data-hveid="CAEIAhAA" data-processed="true" data-complete="true"&gt;The maximum&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em class="eujQNb" data-complete="true" data-processed="true"&gt;practical&lt;/em&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true" data-processed="true"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;MTU size for the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;div class="Mat90e" data-animation-atomic="" data-wiz-uids="sEknEe_g" data-complete="true" data-sae=""&gt;
&lt;div class="AzjvZe" data-wiz-uids="sEknEe_i" data-complete="true"&gt;&lt;a id="pvlinkgdlvaeS5H5jNwbkP5cHPyQU_1" class="SmjhRb bqYA2d" href="https://www.google.com/search?ibp=oshop&amp;amp;prds=pvt:hg,pvo:29,mid:576462809295078448,imageDocid:13607908287477368484,gpcid:14691505606117474916,headlineOfferDocid:439784274715731626,catalogid:6044485316095743074,productDocid:12205709385768619420&amp;amp;q=product&amp;amp;sa=X&amp;amp;ved=2ahUKEwik_oGF75qSAxWYZjABHeXgM1kQxa4PegYIAQgCEAI" data-ved="2ahUKEwik_oGF75qSAxWYZjABHeXgM1kQxa4PegYIAQgCEAI"&gt;nRF52840&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span class="T286Pc" data-sfc-cp="" data-complete="true" data-processed="true"&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;using&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;code class="o8j0Mc" dir="ltr" data-complete="true" data-sae=""&gt;pc-ble-driver-py&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is around&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class="Yjhzub" data-complete="true" data-processed="true"&gt;247 bytes&lt;/strong&gt;, which is less than your 291-byte token.&lt;span class="uJ19be notranslate" data-wiz-uids="sEknEe_m" data-complete="true" data-processed="true"&gt;&lt;span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=sEknEe_l/TKHnVd" data-sae=""&gt;&amp;nbsp;&lt;span class="wiMplc ofC0Ud"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="Fsg96" data-sfc-cp="" data-complete="true" data-processed="true"&gt;&lt;/div&gt;
&lt;div class="otQkpb" data-animation-nesting="" data-sfc-cp="" data-processed="true" data-sae="" data-complete="true"&gt;MTU Limitation&lt;span class="txxDge notranslate" data-wiz-uids="sEknEe_t" data-complete="true"&gt;&lt;span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=sEknEe_s/TKHnVd" data-sae=""&gt;&lt;span class="wiMplc ofC0Ud"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="Y3BBE" data-sfc-cp="" data-hveid="CAEIBBAA" data-complete="true" data-processed="true"&gt;Your understanding is largely correct: the maximum configurable MTU size with the standard Nordic SoftDevice and&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="o8j0Mc" dir="ltr" data-complete="true" data-sae=""&gt;pc-ble-driver-py&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;setup is typically 247 bytes. This limit is due to underlying BLE packet structure and SoftDevice serialization constraints. Therefore, you cannot send a 291-byte payload in a single ATT packet.&lt;span class="uJ19be notranslate" data-wiz-uids="sEknEe_x" data-complete="true" data-processed="true"&gt;&lt;span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=sEknEe_w/TKHnVd" data-sae=""&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="Y3BBE" data-sfc-cp="" data-hveid="CAEIBBAA" data-complete="true" data-processed="true"&gt;
&lt;div class="otQkpb" data-animation-nesting="" data-sfc-cp="" data-complete="true" data-processed="true" data-sae=""&gt;Solution: Data Fragmentation&lt;span class="txxDge notranslate" data-wiz-uids="sEknEe_13" data-complete="true"&gt;&lt;span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=sEknEe_12/TKHnVd" data-sae=""&gt;&lt;span class="wiMplc ofC0Ud"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="Y3BBE" data-sfc-cp="" data-hveid="CAEIBhAA" data-complete="true" data-processed="true"&gt;To transfer a token of 291 bytes, you need to&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong class="Yjhzub" data-complete="true" data-processed="true"&gt;fragment (split) the data&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;into smaller chunks that fit within the negotiated MTU size and send them sequentially. The receiving device must then reassemble these chunks.&lt;span class="uJ19be notranslate" data-wiz-uids="sEknEe_17" data-complete="true" data-processed="true"&gt;&lt;span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=sEknEe_16/TKHnVd" data-sae=""&gt;&amp;nbsp;&lt;span class="wiMplc ofC0Ud"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="Y3BBE" data-sfc-cp="" data-hveid="CAEIBxAA" data-processed="true" data-complete="true"&gt;Here is how you can implement this approach using&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="o8j0Mc" dir="ltr" data-complete="true" data-sae=""&gt;adapter.write_req&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;or&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="o8j0Mc" dir="ltr" data-complete="true" data-sae=""&gt;adapter.write_cmd&lt;/code&gt;:&lt;span class="txxDge notranslate" data-wiz-uids="sEknEe_1d" data-processed="true" data-complete="true"&gt;&lt;span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=sEknEe_1c/TKHnVd" data-sae=""&gt;&lt;span class="wiMplc ofC0Ud"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul class="KsbFXc U6u95" data-complete="true" data-processed="true"&gt;
&lt;li data-hveid="CAEICBAA" data-complete="true" data-sae=""&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true"&gt;&lt;strong class="Yjhzub" data-complete="true"&gt;Determine the maximum payload size:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;After connecting and negotiating the MTU, you need to know the maximum number of data bytes you can send per write operation. This is typically&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="o8j0Mc" dir="ltr" data-complete="true" data-sae=""&gt;MTU - 3&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;bytes (3 bytes are used for the ATT command header).&lt;/span&gt;&lt;/li&gt;
&lt;li data-hveid="CAEICBAB" data-complete="true" data-sae=""&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true"&gt;&lt;strong class="Yjhzub" data-complete="true"&gt;Split the data:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;Divide your 291-byte token into chunks of this maximum payload size.&lt;/span&gt;&lt;/li&gt;
&lt;li data-hveid="CAEICBAC" data-complete="true" data-sae=""&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true"&gt;&lt;strong class="Yjhzub" data-complete="true"&gt;Send sequentially:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;Use a loop to send each chunk to the characteristic.&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="o8j0Mc" dir="ltr" data-complete="true" data-sae=""&gt;adapter.write_req&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;ensures reliable delivery with responses, while&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="o8j0Mc" dir="ltr" data-complete="true" data-sae=""&gt;adapter.write_cmd&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;(write without response) is faster but less reliable (you&amp;#39;d need to handle flow control, like waiting for a&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="o8j0Mc" dir="ltr" data-complete="true" data-sae=""&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;event, if sending many packets in quick succession). For a single large token,&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;code class="o8j0Mc" dir="ltr" data-complete="true" data-sae=""&gt;write_req&lt;/code&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;might be simpler.&lt;/span&gt;&lt;/li&gt;
&lt;li data-hveid="CAEICBAD" data-complete="true" data-sae=""&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true"&gt;&lt;strong class="Yjhzub" data-complete="true"&gt;Reassemble on the target:&lt;/strong&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;The custom target device&amp;#39;s firmware must be designed to receive these fragmented writes and concatenate them into the original 291-byte token.&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true"&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true"&gt;&lt;span&gt;While the exact implementation depends on your existing code structure, here&amp;#39;s a conceptual outline:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true"&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;python
# Assuming &amp;#39;adapter&amp;#39; is your BLEAdapter instance and &amp;#39;conn_handle&amp;#39; is the connection handle
# and &amp;#39;char_handle&amp;#39; is the handle of your characteristic

token = b&amp;quot;...&amp;quot; # Your 291-byte token as bytes

# The maximum payload size will be the negotiated MTU size minus 3 bytes for overhead.
# You can typically determine this after the connection and MTU exchange.
# Let&amp;#39;s assume a max payload size of 244 bytes for this example.
max_payload_size = 244 

# Split the token into chunks
chunks = [token[i:i + max_payload_size] for i in range(0, len(token), max_payload_size)]

for chunk in chunks:
    try:
        # Use adapter.write_req for a reliable transfer
        adapter.write_req(conn_handle, char_handle, chunk)
        print(f&amp;quot;Sent chunk of size {len(chunk)}&amp;quot;)
    except Exception as e:
        print(f&amp;quot;Error sending chunk: {e}&amp;quot;)
        # Handle the error, possibly NRF_ERROR_SD_RPC_SEND again if something is wrong with the chunking
        break

# The target device will receive multiple write events and combine the data.&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true"&gt;&lt;span&gt;HTH&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="T286Pc" data-sfc-cp="" data-complete="true"&gt;&lt;span&gt;GL :-) PJ &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/270c.svg" title="V"&gt;&amp;#x270c;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>