Enhanced ShockBurst Sniffer
The Python scripts introduced in this document are used for the Enhanced ShockBurst: Monitor sample configured as Enhanced ShockBurst Sniffer.
Overview
There are two separate scripts you can use with the DK configured as an Enhanced ShockBurst sniffer:
main.pyprovides integration with the Wireshark extcap interface and the UART shell for real-time updates of sniffer parameters such as:Bitrate
Channel
Radio addresses
Pipe prefixes
Enabled pipes
capture_to_pcap.pyis a simple CLI utility to read packets from the DK and save them into pcap formatted file for further analysis.
Requirements
The script source files are located in the scripts/esb_sniffer directory.
Complete the following steps to install scripts requirements:
Install the Python requirements:
pip3 install -r nrf/scripts/esb_sniffer/requirements.txtInstall Wireshark.
Set up Wireshark
Complete the following steps to set up Wireshark:
Enter nrf/scripts/esb_sniffer directory.
Add a custom plugins to Wireshark:
mkdir -p $HOME/.local/lib/wireshark/{extcap,plugins} cp esb_dissector.lua $HOME/.local/lib/wireshark/plugins cp extcap/esb_extcap.py $HOME/.local/lib/wireshark/extcap
Copy the
esb_dissector.luafile into the%APPDATA%\Wireshark\pluginsdirectory.Enable the dissector for Enhanced ShockBurst:
Open Wireshark.
Go to Edit -> Preferences -> Protocols -> DLT_USER -> Edit.
Click the Create new entry icon (bottom left).
Select
DLT=147for DLT column andesbfor Payload dissector column.Click Ok.
Restart Wireshark.
After completing these steps, a new Enhanced ShockBurst sniffer interface appears in Wireshark.
main.py
This script works on Linux only.
Complete the following steps to use this script:
Start the script:
python3 main.pyStart Wireshark and select the Enhanced ShockBurst sniffer interface.
Observe the packets being received in Wireshark in real time.
Type
qorquitto stop the application.
capture_to_pcap.py
This script is not designed to work with a live Wireshark capture. You can capture packets into a file and open it in Wireshark later.
Complete the following steps to use this script:
Start the script with the output filename as an argument:
python3 capture_to_pcap.py output.pcapType
qorquitto stop the application.
Dependencies
The scripts use the pynrfjprog and pyserial libraries to communicate with the DK, and Wireshark as tool for visualizing Enhanced ShockBurst packets.