<?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>Notification packets missing periodically</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50762/notification-packets-missing-periodically</link><description>Hello, I am working on the modified versions of hrs and hrs_c examples, on two NRF52832 with s132. I modified the apps so that when they connect the peripheral reads from a sensor (enabled data read using GPIO) and streams data in packets of 35 bytes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Aug 2019 13:06:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50762/notification-packets-missing-periodically" /><item><title>RE: Notification packets missing periodically</title><link>https://devzone.nordicsemi.com/thread/206126?ContentTypeID=1</link><pubDate>Mon, 26 Aug 2019 13:06:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41bd77e6-d23c-40dd-8e92-5653efdea8c5</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Catalina,&lt;/p&gt;
&lt;p&gt;Good to hear that! I am sorry for my late answer to your last question. Have a nice day and good luck with your project.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification packets missing periodically</title><link>https://devzone.nordicsemi.com/thread/205715?ContentTypeID=1</link><pubDate>Thu, 22 Aug 2019 22:40:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79487246-785e-47eb-90c0-00aca88ef9dd</guid><dc:creator>Catytu</dc:creator><description>&lt;p&gt;I figured it out. There was a physical problem with the sensor I was using, the BLE implementation was working perfectly fine.&lt;/p&gt;
&lt;p&gt;Thank you for your time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification packets missing periodically</title><link>https://devzone.nordicsemi.com/thread/204837?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2019 14:55:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ff376d9-3d84-4adc-8e0d-509448c4b82b</guid><dc:creator>Catytu</dc:creator><description>&lt;p&gt;Oh of course, I&amp;#39;m sorry for the simple mistake. That did fix the last byte issue, but there is still something in the peripheral side that is jamming the data readout periodically. I haven&amp;#39;t been able to figure out what process the peripheral is doing, or if its reaching the maximum number of packets, which is causing it to stop transmitting data for about 300 ms every 3.5 seconds. It will always return hvx 0 when ble_hrs_heart_rate_measurement_send is called.&lt;/p&gt;
&lt;p&gt;Sending a 36 byte packet every 20ms doesn&amp;#39;t seem like too much data to me...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification packets missing periodically</title><link>https://devzone.nordicsemi.com/thread/204138?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2019 15:24:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3500032e-b359-4947-8eb8-1b19c3449900</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Catalina,&lt;/p&gt;
&lt;p&gt;You are writing data outside the array, index 35 is not a valid index for array with size 35. You declared ble_data_pckt in:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint8_t ble_data_pckt[35] = {0};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and you are writing data to ble_data_packet[35] in main:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; ble_data_pckt[35] = (*(adsData+2));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://www.tutorialspoint.com/cprogramming/c_arrays"&gt;https://www.tutorialspoint.com/cprogramming/c_arrays&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In ble_hrs_heart_rate_measurement_send you also have hardcoded the length to be 35 which you will need to change as well. In general is not good approach to hardcode values.&lt;/p&gt;
&lt;p&gt;My advice is to test your peripheral implementation together with the nRF Connect app (either for desktop or mobile app) as a central and enable notifications to debug your peripheral implementation without having to worry about bugs in the central side and check if the notification values you are getting are as expected.&lt;/p&gt;
&lt;p&gt;When you are sure the peripheral is sending the correct data it will be easier to debug the central side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification packets missing periodically</title><link>https://devzone.nordicsemi.com/thread/203630?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 14:03:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a2d30aa-d8b2-4f33-8da1-5a292fc523e5</guid><dc:creator>Catytu</dc:creator><description>&lt;p&gt;Hi Msromero,&lt;/p&gt;
&lt;p&gt;I did adjust the ATT_MTU to 38 in both the peripheral and central, since I am sending 35 bytes every time. I am using SDK 14.2.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification packets missing periodically</title><link>https://devzone.nordicsemi.com/thread/203588?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 12:42:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddcb1df3-1c01-4602-9e96-768da26a7e75</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Catalina,&lt;/p&gt;
&lt;p&gt;Could you check what the maximum ATT_MTU size for your project is? And which version of the SDK you are using? The default ATT_MTU max size is 247 in SDK v15.5.0 but it may be lower in older SDK versions.&lt;/p&gt;
&lt;p&gt;In sdk_config.h:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// &amp;lt;o&amp;gt; NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. 
#ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
#endif&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification packets missing periodically</title><link>https://devzone.nordicsemi.com/thread/203394?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 16:33:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3231db4-c394-4d51-836f-37999aed9e51</guid><dc:creator>Catytu</dc:creator><description>&lt;p&gt;I tried printing the values using NRF_LOG_INFO and I do get zero in the central but actual values in the peripheral 99% of the time. When I sent two packets of 20 bytes I did not see this problem. I&amp;#39;m currently implementing the sniffer.&lt;/p&gt;
&lt;p&gt;I have implemented the print to check for errors during ble_hrs_heart_rate_measurement_send() and they always return 0. It may be that packets are being lost (doesn&amp;#39;t seem like it) or that the peripheral is not executing the data readout continuously., although I don&amp;#39;t see why it wouldn&amp;#39;t. &lt;/p&gt;
&lt;p&gt;Please note that I don&amp;#39;t mind a lower latency as long as all the data gets sampled at 250Hz and sent through safely.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notification packets missing periodically</title><link>https://devzone.nordicsemi.com/thread/203377?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 15:02:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bfd478d-4ac2-4797-8eae-f9c1e2f30efb</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Catalina,&lt;/p&gt;
&lt;p&gt;The easiest way to check if the last two bytes of your packet are actually being sent is using the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrftools%2Fstruct%2Fnrftools_nrfsniffer.html&amp;amp;cp=6_4"&gt;nRF Sniffer&lt;/a&gt;. You can also try to print the values of the buffers hvx_params.p_len and hvx_param.p_data using NRF_LOG_INFO for debugging purposes.&lt;/p&gt;
&lt;p&gt;Secondly, you should check for error codes after calling ble_hrs_heart_rate_measurement_send(). The local attribute value may be updated even if an outgoing packet is not being sent to the peer due to an error during execution, see &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v6.1.0%2Fgroup___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga313fe43c2e93267da668572e885945db"&gt;sd_ble_gatts_hvx&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I suspect you may have too many notifications queued, you should check if the function call will return NRF_ERROR_RESOURCES, and then call the function again before moving forward.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;do {
  err_code = ble_hrs_heart_rate_measurement_send(&amp;amp;m_hrs, heart_rate);
  NRF_LOG_INFO(&amp;quot;ble_hrs_heart_rate_measurement_send retuned: %d&amp;quot;,err_code); 
} while ((err_code == NRF_ERROR_RESOURCES));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>