<?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>how to send large payload(16k byte) using Bluetooth mesh</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62906/how-to-send-large-payload-16k-byte-using-bluetooth-mesh</link><description>We are planing to use nrf52840 sdk in our project.we want to use mesh stack for that. 
 our product is sensor: 
 -deployed in oil field. 
 - send data 8 times a day. 
 -payload is 16K bytes. 
 -max hope will be 7. 
 currently using mobile app for provisioning</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Jun 2020 13:55:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62906/how-to-send-large-payload-16k-byte-using-bluetooth-mesh" /><item><title>RE: how to send large payload(16k byte) using Bluetooth mesh</title><link>https://devzone.nordicsemi.com/thread/257622?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2020 13:55:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e24bc1df-0b75-4b8b-b150-14452d905db9</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. You can find the documentation for the Instaburst feature &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v4.1.0/md_doc_user_guide_modules_instaburst.html?cp=7_6_0_2_4_4" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;, and APIs for Instaburst &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v4.1.0/group__INSTABURST__TX.html?resultof=%22%69%6e%73%74%61%62%75%72%73%74%22%20" rel="noopener noreferrer" target="_blank"&gt;TX module&lt;/a&gt; and &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v4.1.0/group__INSTABURST__RX.html?resultof=%22%69%6e%73%74%61%62%75%72%73%74%22%20" rel="noopener noreferrer" target="_blank"&gt;RX module&lt;/a&gt;.&lt;/p&gt;
[quote user="karan patel"]I want to integrate this feature in mesh sdk light_switch example is it possible?[/quote]
&lt;p&gt;Yes, it should be possible.&lt;/p&gt;
&lt;p&gt;2. Instead of setting a flag in the &lt;span&gt;NRF_MESH_EVT_TX_COMPLETE&amp;nbsp;&lt;/span&gt;event and sending the data in main loop, try sending the data directly after getting the event? Doing it from main will cause interrupt priority issues as you mentioned. I recommend you to have a look at the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v4.1.0/md_doc_user_guide_mesh_interrupt_priorities.html?cp=7_6_0_2_5" rel="noopener noreferrer" target="_blank"&gt;interrupt priority documentation&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send large payload(16k byte) using Bluetooth mesh</title><link>https://devzone.nordicsemi.com/thread/257016?ContentTypeID=1</link><pubDate>Thu, 25 Jun 2020 18:02:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56090b77-3b85-433b-9641-80dab97fa858</guid><dc:creator>karan patel</dc:creator><description>&lt;p&gt;Thank you for your reply ,&lt;/p&gt;
&lt;p&gt;1- I go through the post about instaburst but as mentioned in that post there is no separate api for this feature as the person who ask did not share code or anything,is there any example how to use this feature? I want to integrate this feature in mesh sdk light_switch example is it possible?&lt;/p&gt;
&lt;p&gt;2- I got that point so before your answer i&amp;nbsp; keep packet size 350 and tried&amp;nbsp; to send such multi pal packet from server side by modifying below function,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static uint32_t status_send(generic_onoff_server_t * p_server,
                            const access_message_rx_t * p_message,
                            const generic_onoff_status_params_t * p_params)
{
   uint8_t data[500];
  memset(data,&amp;#39;K&amp;#39;,498);
  data[499]=0;
    uint8_t lpVar,lpCnt;
    uint32_t rstat=0;
    uint16_t delay,maxDatalen=350;//ACCESS_MESSAGE_LENGTH_MAX-1;
    generic_onoff_status_msg_pkt_t msg_pkt;

    if (p_params-&amp;gt;present_on_off &amp;gt; GENERIC_ONOFF_MAX ||
        p_params-&amp;gt;target_on_off  &amp;gt; GENERIC_ONOFF_MAX ||
        p_params-&amp;gt;remaining_time_ms &amp;gt; TRANSITION_TIME_STEP_10M_MAX)
    {
        return NRF_ERROR_INVALID_PARAM;
    }

    msg_pkt.present_on_off = p_params-&amp;gt;present_on_off;
    if (p_params-&amp;gt;remaining_time_ms &amp;gt; 0)
    {
        msg_pkt.target_on_off = p_params-&amp;gt;target_on_off;
        msg_pkt.remaining_time = model_transition_time_encode(p_params-&amp;gt;remaining_time_ms);
    }

    if(strlen(data) % maxDatalen)
      lpCnt=(strlen(data) / maxDatalen)+1;
    else
      lpCnt=(strlen(data) / maxDatalen);
    __LOG(LOG_SRC_APP, LOG_LEVEL_DBG1, &amp;quot;lpcnt is %d\n&amp;quot;,lpCnt);
    for(lpVar=0;lpVar&amp;lt;lpCnt;lpVar++)
    {
      txisongoing=1;
        access_message_tx_t reply =
        {
            .opcode = ACCESS_OPCODE_SIG(GENERIC_ONOFF_OPCODE_STATUS),
            .p_buffer = (const uint8_t *)&amp;amp;data[lpVar * maxDatalen],// &amp;amp;msg_pkt,
            .length =(lpVar==(lpCnt-1)) ? (strlen(data)- (lpVar * maxDatalen)) : maxDatalen ,//p_params-&amp;gt;remaining_time_ms &amp;gt; 0 ? GENERIC_ONOFF_STATUS_MAXLEN : GENERIC_ONOFF_STATUS_MINLEN,
            .force_segmented = true,//p_server-&amp;gt;settings.force_segmented,
            .transmic_size = p_server-&amp;gt;settings.transmic_size
        };
        
        /////// below structure is for reliable send//////////////
        access_reliable_t  reliable_send =
        {
            .model_handle=p_server-&amp;gt;model_handle,
            .message.opcode = ACCESS_OPCODE_SIG(GENERIC_ONOFF_OPCODE_STATUS),
            .message.p_buffer = (const uint8_t *)&amp;amp;data[lpVar * maxDatalen],// &amp;amp;msg_pkt,
            .message.length =(lpVar==(lpCnt-1)) ? (strlen(data)- (lpVar * maxDatalen)) : maxDatalen ,//p_params-&amp;gt;remaining_time_ms &amp;gt; 0 ? GENERIC_ONOFF_STATUS_MAXLEN : GENERIC_ONOFF_STATUS_MINLEN,
            .message.force_segmented = p_server-&amp;gt;settings.force_segmented,
            .message.transmic_size = p_server-&amp;gt;settings.transmic_size,
            .message.access_token = nrf_mesh_unique_token_get(),
            .reply_opcode.opcode=ACCESS_OPCODE_SIG(GENERIC_ONOFF_OPCODE_STATUS),
            .reply_opcode.company_id = ACCESS_COMPANY_ID_NONE,
            .timeout=SEC_TO_US(59),
            .status_cb=reliableAccessCb
        };
                  __LOG(LOG_SRC_APP, LOG_LEVEL_DBG1, &amp;quot;tx length is %d\n&amp;quot;,reply.length);
                 // __LOG(LOG_SRC_APP, LOG_LEVEL_DBG1, &amp;quot;tx length is %d\n&amp;quot;,reliable_send.message.length);
        if (p_message == NULL)
        {
            rstat=access_model_publish(p_server-&amp;gt;model_handle, &amp;amp;reply);
            if(rstat!=NRF_SUCCESS)
            {
               __LOG(LOG_SRC_APP, LOG_LEVEL_DBG1, &amp;quot;publish fail %lu\n&amp;quot;,rstat);
                return rstat;
            }
        }
        else
        {
            __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;access reply called \n&amp;quot;,rstat);
            rstat=access_model_reply(p_server-&amp;gt;model_handle, p_message, &amp;amp;reply);
            //rstat=access_model_reliable_publish(&amp;amp;reliable_send);
            if(rstat!=NRF_SUCCESS)
            {
              __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;reply fail %lu\n&amp;quot;,rstat);
                return rstat;
            }
        }

        //nrf_delay_ms(1000);
    }
    __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, &amp;quot;publish sucess\n&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;here i am using mesh sdk 4.1 light_switch server and client example and function is from server side.i am trying to do like when ever i press switch from client server get notification and send 16k data(something like master-slave).&lt;/p&gt;
&lt;p&gt;i found that if i back to back send two packet of 350 byte than first is succeed and latter is failed.so i debug that i have to wait for&amp;nbsp;NRF_MESH_EVT_TX_COMPLETE event in&amp;nbsp;static void mesh_event_cb(const nrf_mesh_evt_t * p_evt) which is in config_server.c.(as keeping delay in status_send function is not wrking if i put delay in that function,&lt;span&gt;NRF_MESH_EVT_TX_COMPLETE&amp;nbsp; event will not generate&lt;/span&gt;).so i am seting some flag from that event and try to send data from main loop using&amp;nbsp; something like,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//        if(tx_ack_receive==1)
//        {
//        
//          hal_led_pin_set(ONOFF_SERVER_0_LED, !hal_led_pin_get(ONOFF_SERVER_0_LED));
//          
//          app_onoff_status_publish(&amp;amp;m_onoff_server_0);
//          tx_ack_receive=0;
//        }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;but if i initiate data send from main than got error &amp;quot;error:app_error_weak.c, 105, Mesh assert at 0x0002C96C (:0)&amp;quot; after searching i found that it is due to some interrupt priority and try also some work around suggested on online platform but it didn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;so how to initiate next packet transmission once&amp;nbsp;&lt;span&gt;NRF_MESH_EVT_TX_COMPLETE&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; is received ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;as you can see in function i also try to send reliable message in status_send function but in that case even during first packet i got error&amp;nbsp;NRF_ERROR_INVALID_PARAM i try to debug also but not find clue.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send large payload(16k byte) using Bluetooth mesh</title><link>https://devzone.nordicsemi.com/thread/257003?ContentTypeID=1</link><pubDate>Thu, 25 Jun 2020 16:08:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e53ade5-de93-46cc-8d73-7d725c1ea2f8</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. You will need to split up the data into smaller packets. Sending packets of smaller size and reassemble after it has been received on the other end.&lt;/p&gt;
&lt;p&gt;You can consider using&amp;nbsp;Nordic Advertiser Extensions (Instaburst). It will increase your payload (498 bytes) but just note that Instaburst is a Nordic proprietary feature that does not adhere to the Bluetooth Mesh Specification. It will break compatibility with other Bluetooth Mesh implementations.&lt;/p&gt;
&lt;p&gt;You can read more about this in this &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33242/how-i-use-instaburst-feature-for-sending-large-amount-of-sensor-data-in-mesh-network/127844#127844" rel="noopener noreferrer" target="_blank"&gt;post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;2. Yes. any packet with size larger than 11 bytes (including header) will be split into segmented messages automatically. But the maximum possible segmented payload size is 380 so it will fail if you have a higher payload.&lt;/p&gt;
&lt;p&gt;3. Mesh is not optimal for sending/streaming a lot of data. In the Mesh documentation from our Infocenter:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;Bluetooth Mesh primarily targets simple control and monitoring applications, like light control or sensor data gathering. The packet format is optimized for small control packets, issuing single commands or reports, and is not intended for data streaming or other high-bandwidth applications.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/23983/how-do-i-calculate-throughput-for-a-ble-mesh" rel="noopener noreferrer" target="_blank"&gt;throughput &lt;/a&gt;in a Mesh network is highly dependent on several factors. How many nodes do you have in your network, are you sending reliable or unreliable messages, how many hops to you need to reach the receiver node etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For one hop we have seen&amp;nbsp;3.46kbps ( ~54 Bytes/s) with 20ms advertising, 100% scanning with 11 bytes payload,&amp;nbsp; Non-Acked, i.e. unreliable.&lt;/p&gt;
&lt;p&gt;4. Unfortunately, we don’t have an example for sending large payloads in a mesh network.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>