Installing nRF Sniffer for 802.15.4¶
The nRF Sniffer for 802.15.4 consists of firmware that is programmed onto a nRF52840 MDK USB Dongle and a capture plugin for Wireshark that records and analyzes the detected data.
Programming the nRF Sniffer firmware¶
You must connect a nRF52840 MDK USB Dongle running the nRF Sniffer firmware to your computer to be able to use the nRF Sniffer for 802.15.4.
The nRF Sniffer firmware in .uf2
-format is located in firmware/nrf802154_sniffer/
.
Download the latest firmware and complete the following steps to flash the firmware:
-
Push and hold the button and plug your dongle into the USB port of your computer. Release the button after your dongle is connected. The RGB LED turns green.
-
It will mount as a Mass Storage Device called UF2BOOT.
-
Drag and drop
nrf802154_sniffer_<version>.uf2
onto the UF2BOOT volume. The RGB LED blinks red fast during flashing. -
Re-plug the dongle and the nRF Sniffer will start running.
Button Changed after programmed
The button will be configured as RESET functionality after programmed with the sniffer firmware. The next time you want to enter UF2 Bootloader mode, just double-click the button after plugged the dongle. If you want to change the button to GPIO functionality, try the button sample in NCS guide.
Installing Wireshark¶
To install Wireshark for your operating system, complete the following steps:
- Go to the Wireshark download page.
- Click the release package for your operating system from the Stable Release list. The download starts automatically.
- Install the package.
- Download the Wireshark standard package or the latest stable PPA for Ubuntu Linux distribution from the Wireshark download page.
- Install the package on your computer.
- Answer
yes
when the installer asks you if non-superusers should be able to capture packets. This ensures that packet capture is available to all users in the wireshark system group. - Add the correct user to the wireshark user group. For example, type
sudo usermod -a -G wireshark $USER
. - Add the correct user to the dialout user group. For example, type
sudo usermod -a -G dialout $USER
. - Restart your computer to apply the new user group settings.
Installing the nRF Sniffer capture plugin in Wireshark¶
The nRF Sniffer for 802.15.4 software sends commands to the nRF Sniffer hardware through the serial port and reads the captured frames. The software can be installed as an external capture plugin in Wireshark. You need to install the plugin only if you plan to use the nRF Sniffer as a Wireshark capture interface.
To install the nRF Sniffer capture plugin, complete the following steps:
-
Install the Python requirements:
- Open a command window in the
tools/nrf802154_sniffer/
folder. -
Install the Python dependencies listed in
requirements.txt
by doing one of the following: -
Close the command window.
- Open a command window in the
-
Copy the Sniffer capture plugin into Wireshark's folder for external capture plugins:
- Open Wireshark.
-
Go to Help > About Wireshark (on Windows or Linux) or Wireshark > About Wireshark (on macOS).
-
Select the Folders tab.
-
Double-click the location for the Personal Extcap path to open this folder.
-
Copy the following files from the
tools/nrf802154_sniffer/nrf802154_sniffer
folder into this folder:nrf802154_sniffer.py
nrf802154_sniffer.bat
nrf802154_sniffer.py
nrf802154_sniffer.sh
-
Make sure that the nRF Sniffer files run correctly:
- Open a command window in Wireshark's folder for personal external capture plugins.
-
Run the Sniffer tool to list available interfaces.
You should see a series of strings, similar to what is shown in the following:
-
Refresh the interfaces in Wireshark by selecting Capture > Refresh Interfaces or pressing F5.
You should see that nRF Sniffer for 802.15.4 is displayed as one of the interfaces on the start screen.