Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

NRF 802154 Thread / BT LE - capture packages without PCAP

Hi community,

For debugging / a project in very early stage I need to sniff Thread packages and (later on) Bluetooth (LE) and ZigBee packages.

I would like to use the kindly provided and good Python SDK but want to evaluate captured packages within Python (not within Wireshark from a PCAP). One of the reasons is the need to store some data in a MariaDB database.

Is it possible to handle captured Thread (and BT [LE] + ZigBee) packages within Python? If not, is someone aware of an alternative for this scenario?

Thanks in advance,

Mart.

Parents Reply Children
  • Hi Marte,

    Thanks for your reply. I have been looking in the documentation you refer to, but (if I understood right) this function can only start and stop sniffing, and when sniffing, it can only write to the PCAP given. So the packages it self can not be handled by the Python script for analysing/writing to a database.

    Or am I wrong and this is possible but I am overseeing something?

    Best regards,

    Mart

  • Hi Mart,

    My mistake, you are correct that the documentation only explains how to use the script for pcap files. 

    We do not have anything ready to use for getting the sniffer log as something other than pcap, but you do have some options. One is to export the pcap file to a different file type in Wireshark by going to File > Export Packet Dissection, and then selecting file type. Another option is to convert the pcap file in your Python script using tshark or similar. For this you can look into pyshark (https://github.com/KimiNewt/pyshark/), which is a Python wrapper for tshark. I would suggest trying to integrate the nRF Sniffer Python module into your script as described in the documentation, and then after you stop the sniffer and is done capturing, you use pyshark to process the pcap file.

    Best regards,

    Marte

  • Hi Marte,

    Thanks!

    I will implement the Pyshark solution. As for future releases of the SDK it would be nice if there would be an option to handle packets captured within Python. I can imagine more customers have use for this Slight smile.

    Best regards,

    Mart

Related