<?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>nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21499/nrf51822-sniffer-confusing-wireshark-output</link><description>Hi all, 
 I&amp;#39;m trying to use the nRF51822 sniffer to troubleshoot my TI CC2650STK sensortag ble communication and the output is slightly confusing. The problem I am having with the sensortag is that the output I am getting from the sensor is always exactly</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Apr 2017 16:06:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21499/nrf51822-sniffer-confusing-wireshark-output" /><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84382?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2017 16:06:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:222de20c-287c-42a2-8f32-5e91a5f81101</guid><dc:creator>john</dc:creator><description>&lt;p&gt;Hi endnode,
This all makes sense now. I&amp;#39;m getting some pretty promising results for my setup (5 sensors running at 100Hz). Can&amp;#39;t thank you enough for your answers!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84380?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2017 08:03:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fc5f4be-4e9e-430e-96ac-b486e6573aa3</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi, I was again not 100% clear: Notify (and Indication) methods are available to GATT Server to send asynchronous messages BUT of course only during Connection interval. So still you cannot see anything &amp;quot;faster&amp;quot; then basic Connection interval (that&amp;#39;s why it is sometimes better to be GAP Central because then you can choose the interval, of course the other part of the link might decide to disconnect if parameters are too &amp;quot;aggressive&amp;quot;...)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84381?ContentTypeID=1</link><pubDate>Mon, 24 Apr 2017 06:59:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0723f95b-0262-415d-957e-243ec22af18e</guid><dc:creator>john</dc:creator><description>&lt;p&gt;Ok, I think I am getting some promising results with notifications now, thanks to your explanations!
One more question, if I may: you mentioned that the notification method pushes the values over as they come. Why does my chosen communication interval setting still matter with this method (I would have thought that the data would then be sent as soon as it is sampled)? Is it because the sensor will not &amp;quot;notify&amp;quot; until the communication interval time is not achieved?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84374?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 21:23:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccb7dcd6-bd90-437d-8d68-789e3b30e2b9</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;However if you want (or must) stick to your &amp;quot;pull&amp;quot; model then you should make sure that sensor data are always prepared in particular Value handle on sensor side so you can read them. See nice flow charts of &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___n_o___a_u_t_h___m_s_c.html"&gt;Read without Authorization&lt;/a&gt; and &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___a_u_t_h___m_s_c.html"&gt;Read with Authorization&lt;/a&gt; from Nordic Infocenter (authorization will waste one more connection event = interval). It can easily be the case that you are trying to read some value but sensor is only using Notify methods which don&amp;#39;t store actual payload in the Value but send them &amp;quot;over&amp;quot; it as they come.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84379?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 21:17:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be6c33bd-6720-4379-a5da-2b3e879831a1</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;As result your mobile (= GATT Client) will start seeing data packets and if both sides support multiple MTUs per connection event it might be up to (MTU_SIZE * MTU_NUMBER_PER_EVENT * (1 / CONNECTION_INTERVAL_IN_SECONDS)) Bytes per second of effective application data throughput. In case of your default MTU size (which means 20 bytes for application in each MTU) and 1s connection interval it can be 20-160Bps (1-8 MTUs per one connection event). Again this is just typical example, I would need to see more traces to confirm the roles and throughput capabilities.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84378?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 21:13:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4787a59-14a2-42b0-a2cd-3908c14234f6</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;... During this Tx/Rx activity (regardless number of exchanged packets) there is no time to interact with higher layers, stack acts on its own. Now in the end of this even if there were any data received (again it can be more than one (G)ATT MTU) they are returned to higher layers for processing. So if your sensor is GAP Peripheral (= advertising device) and GATT Server at the same time (usual configuration but you can be GAP Peripheral and GATT Client as well) it typically should use Handle Value Notification (G)ATT method on some custom Characteristic (subset of custom Service). Once there is phone (or something else) connecting as GAP Central, sensortag should wait until GATT Client discovers the service and enables Notifications (there is specific command for doing it) and then it can freely and asynchronously (= without any action from mobile) start pushing data through (G)ATT API.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84372?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 21:08:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acca344a-c6a3-498f-a8c9-5e13afc63b2e</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi John, I&amp;#39;m afraid there is still some misunderstanding;) Normally application on top of the stack (= sensor) should prepare data (in your case one or more 4-byte strings) and map them on top of GATT Characteristics (their Value handles and protocols agreed). Once you have data ready you push them to the stack through vendor specific GATT API (Client or Server depending on what role you run). If it means more packets then stack will get ready with more packets (depending how many buffers it has configured, typically during init). Then once connection interval occurs it tries to push as many &amp;quot;cached&amp;quot; packets as possible in Tx frames. There is normally at least one but depending on interval used and stack capabilities (on both sides of the link!!!) there can be more, the best devices are able of 6-8 per one connection event...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84371?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 18:52:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:458f49e1-914d-4f9d-85ef-35251a4e4059</guid><dc:creator>john</dc:creator><description>&lt;p&gt;I think I got it now. Basically, the only way for the Read with Response mode to work within one connection interval is to have it package the data and have it fully ready and send within the 150+-2 us interval, right? That will probably be somewhat challenging with the current TI stack that I have, notifications might indeed be a way to do it then!:)
Thank you !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84370?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 14:58:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46a72395-0991-46cf-a30d-e9ec02beeedf</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;You are right and there is one point I&amp;#39;ve missed in your screenshot originally: you (or your devices) are using Read with Response (and probably also Write with Response) (G)ATT methods instead of faster Write (without Response) and Notify (or simple Read). That costs you another connection interval for explicit response (basically just ACK without real value for data transfer). Would that clear your question? Otherwise I cannot see the data in your screenshot so I cannot verify how many bytes are in actual payload, if your sensortag at least sends multiple of 4-byte blocks within one (G)ATT MTU etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84368?ContentTypeID=1</link><pubDate>Fri, 21 Apr 2017 12:26:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0769fe60-7785-4540-a917-c7df3f65e9cd</guid><dc:creator>john</dc:creator><description>&lt;p&gt;Hi endnode,
To follow up on what you explained yesterday: I&amp;#39;ve looked deeper into the BLE stack from the TI and I&amp;#39;m still left somewhat confused why my setup is not working as intended:
The side of data that I am sampling is 4 Bytes. According to the TI setup, the size of one MTU for data is 20 (23-3) Bytes. So as far as I understand it should easily fit my data into one MTU. It appears that stack wise everything is lining up nicely and should be transmittable over one connection interval. Am I getting something wrong here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84376?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2017 23:49:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92973fcf-4be6-4af7-980b-7820784139b6</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Glad to help;) Thanks for accepting the right answer...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84375?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2017 23:46:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73bbc96f-af18-405e-b0de-832f2f666dab</guid><dc:creator>john</dc:creator><description>&lt;p&gt;Aha, that makes a lot of sense. Huge thank you for clearing that up!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84373?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2017 23:36:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58bdeee6-c5cb-45ea-a3f4-6bd2fe0ab564</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;... (called &amp;quot;MTUs&amp;quot; on ATT/GATT layer). So whatever you set on your toy from TI it&amp;#39;s not saying that it pushes some data to BLE stack continuously in order to be able to achieve more then 1 MTU exchange when Connection event happens. So if you expect more data or packets seen during each event it typically depends on 3 factors: application must be designed to do it, BLE stack underneath must support more then one PDU exchange during connection event and the same must apply to BLE stack (at least LL) on the other side. Also note that shortest Connection interval allowed by BT SIG Core specification for GAP compliant devices is 7.5ms so even if you would sample some data faster they would come only at this rate and also most of the devices don&amp;#39;t support multiple PDUs in one Connection event when it comes down to 7.5ms so amount of data will be limited by PDU size.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84377?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2017 23:30:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99d968b1-c2ff-430e-b87f-89e9df1f0ee1</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi again, regarding timing I had one comment in my first answer but then deleted it as it seemed irrelevant. However I was wrong as I can see so here it is: Nordic Sniffer is amazing tool BUT you need to understand that it costs ~$40 so need to have realistic expectations from it. All timing indication which goes below 10ms is rather indication then really accurate reflection of reality. If you read some presentation about how BT LE Link Layer works (or read BT SIG Core spec directly) you will see that &amp;quot;gaps&amp;quot; between Tx and Rx within one Connection event (= one or more Master-&amp;gt;Slave exchange pairs) are 150us. More over even if stack on your sensor would manage to utilize these 150us for some higher-layer activity (which it definitely doesn&amp;#39;t) it would mean that such &amp;quot;application&amp;quot; would need to be pushing sensor data in some agreed format to the stack in multiple basic &amp;quot;fragments&amp;quot;...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84369?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2017 23:08:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5888137-a7ae-4c7d-8ad0-60cee59965b2</guid><dc:creator>john</dc:creator><description>&lt;p&gt;Hi endnode,&lt;/p&gt;
&lt;p&gt;Thanks for your elaborate answer. Coming from a different field, my knowledge of BLE is indeed quite unstructured, so this is definitely the source of the misunderstanding. However, to follow up on your answer:&lt;/p&gt;
&lt;p&gt;As you said, I would have expected to have 2 PDUs per communication interval (master-slave &amp;amp; slave-master). I&amp;#39;ve configured my slave (CC2650STK sensortag by TI) to sample the measurement data at considerably higher frequencies than 1&lt;em&gt;ms&lt;/em&gt; communication interval seen in the snippet, so the data is definitely available for sending. Are you saying that my setup  essentially cannot package &lt;em&gt;raw&lt;/em&gt; data for sending within the ~5&lt;em&gt;ms&lt;/em&gt; interval that exists between the master-slave slave-master outputs, thus my GATT profile fails to send in within 1 communication interval?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 sniffer confusing wireshark output</title><link>https://devzone.nordicsemi.com/thread/84367?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2017 22:36:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3916354a-3cb8-4df0-a18b-d555a480d9f0</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure you do appreciate how BT LE Link layer works during connection. There are typically PDU pairs each interval (so normally there is one Master-&amp;gt;Slave and one Slave-&amp;gt;Master), under some circumstances there can be several of them (typically if one side of the link has several packets ready to go through and both sides of the link support it) or Slave answer can be missing (if there is empty PDU from Master, Slave has nothing to say and Slave Latency is set to more then 1). So your trace is actually complete and as expected.&lt;/p&gt;
&lt;p&gt;Finally to your expectations of how the exchange should flow. Data on higher layers (APP/GATT/ATT/L2CAP) must typically be ready before the connection interval starts to go through. During tiny window between Master-&amp;gt;Slave and Slave-&amp;gt;Master packets stack cannot manage to throw data up, wait for them being processed and receive new data for output. So if you communicate on higher layers and it&amp;#39;s not asynchronous full-duplex stream of data you will always be limited by connection interval between one complete message going there and response coming back.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>