<?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>Missing packages while sniffing with nRF52DK using SnifferAPI script on Raspberry PI4</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99565/missing-packages-while-sniffing-with-nrf52dk-using-snifferapi-script-on-raspberry-pi4</link><description>Hi, 
 I am using the nrf_sniffer_ble.py script on Raspberry PI connected with nrf52 DK to sniff the data between the nrf dongle and another device. While analyzing captured file I concluded that I am missing a lot of packages. When capturing with Wireshark</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 24 May 2023 07:02:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99565/missing-packages-while-sniffing-with-nrf52dk-using-snifferapi-script-on-raspberry-pi4" /><item><title>RE: Missing packages while sniffing with nRF52DK using SnifferAPI script on Raspberry PI4</title><link>https://devzone.nordicsemi.com/thread/427089?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 07:02:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:050a6afe-e169-483a-a3b9-d78700d5c418</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you doing anything differently when it captures packages after disconnect compared to when it does not?&lt;/p&gt;
&lt;p&gt;When you are sniffing a connection in Wireshark and one of the devices disconnect, the sniffer will go back to following. In the Sniffer API there is a property for whether the device you are sniffing is in a connection or not, inConnection. You can use this to check the connection status of the device, and to go back to following if it is no longer connected.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Missing packages while sniffing with nRF52DK using SnifferAPI script on Raspberry PI4</title><link>https://devzone.nordicsemi.com/thread/425305?ContentTypeID=1</link><pubDate>Fri, 12 May 2023 11:34:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ee5bfb9-1f4c-495f-a2bf-170bbde98b66</guid><dc:creator>dzs</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sorry, I am not sure if I expressed myself clearly in the previous answer. When I said disconnect, I meant to disconnect two communicating devices one from another, not disconnecting from the network.&lt;/p&gt;
&lt;p&gt;However, I am not handling disconnecting two devices since sometimes it captures packages after disconnecting, but usually, it doesn&amp;#39;t.&amp;nbsp;So, I thought it&amp;#39;s&amp;nbsp;already been handled. Also, I tried it in Wireshark, and it worked okay.&lt;/p&gt;
&lt;p&gt;Regards.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Missing packages while sniffing with nRF52DK using SnifferAPI script on Raspberry PI4</title><link>https://devzone.nordicsemi.com/thread/425234?ContentTypeID=1</link><pubDate>Fri, 12 May 2023 07:33:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c2a4b7d-a07f-46c5-b2c0-a7f07c239469</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What do you do when devices disconnect? Do you handle it in some way such that the sniffer can go back to capturing advertising packets?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Missing packages while sniffing with nRF52DK using SnifferAPI script on Raspberry PI4</title><link>https://devzone.nordicsemi.com/thread/425116?ContentTypeID=1</link><pubDate>Thu, 11 May 2023 13:06:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f89a74b3-71dc-4230-8a5a-a8c7601a2cfa</guid><dc:creator>dzs</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for the answer. Now I am able to capture more packages, as well as connection and data packages, but it only works for the first connection between the nrf dongle and the device. It doesn&amp;#39;t capture any package after disconnecting devices for the first time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have modified the nrf_sniffer_ble.py script based on the example_linux.py and handle_control_command function.&lt;/p&gt;
&lt;p&gt;Do you have any idea what is happening there?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Missing packages while sniffing with nRF52DK using SnifferAPI script on Raspberry PI4</title><link>https://devzone.nordicsemi.com/thread/424889?ContentTypeID=1</link><pubDate>Wed, 10 May 2023 13:32:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f793a3b0-7724-4228-9af6-e48ce4e30542</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The nrf_sniffer_ble.py script is a Wireshark extcap wrapper. The script itself cannot follow a device. Instead, it expects a command from the Wireshark drop down menu, as you can see in handle_control_command():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="python"&gt;def handle_control_command(sniffer, arg, typ, payload):
    &amp;quot;&amp;quot;&amp;quot;Handle command from control channel&amp;quot;&amp;quot;&amp;quot;
    global last_used_key_type

    if arg == CTRL_ARG_DEVICE:
        if payload == b&amp;#39; &amp;#39;:
            scan_for_devices(sniffer)
        else:
            values = payload
            values = values.replace(b&amp;#39;[&amp;#39;, b&amp;#39;&amp;#39;)
            values = values.replace(b&amp;#39;]&amp;#39;, b&amp;#39;&amp;#39;)
            device_address = values.split(b&amp;#39;,&amp;#39;)

            logging.info(&amp;#39;follow_device: {}&amp;#39;.format(device_address))
            for i in range(6):
                device_address[i] = int(device_address[i])

            device_address[6] = 1 if device_address[6] == b&amp;#39; 1&amp;#39; else 0

            device = Devices.Device(address=device_address, name=&amp;#39;&amp;quot;&amp;quot;&amp;#39;, RSSI=0)

            follow_device(sniffer, device)
            
...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you want to use a script instead of Wireshark, then you need to write your own script and add following of a device there. I suggest taking a look at the &amp;#39;Sniffer Api Guide.pdf&amp;#39; in the doc directory and the example scripts in the same directory.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>