Skip to content

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:

  1. 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.

  2. It will mount as a Mass Storage Device called UF2BOOT.

  3. Drag and drop nrf802154_sniffer_<version>.uf2 onto the UF2BOOT volume. The RGB LED blinks red fast during flashing.

  4. 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:

  1. Go to the Wireshark download page.
  2. Click the release package for your operating system from the Stable Release list. The download starts automatically.
  3. Install the package.
  1. Download the Wireshark standard package or the latest stable PPA for Ubuntu Linux distribution from the Wireshark download page.
  2. Install the package on your computer.
  3. 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.
  4. Add the correct user to the wireshark user group. For example, type sudo usermod -a -G wireshark $USER.
  5. Add the correct user to the dialout user group. For example, type sudo usermod -a -G dialout $USER.
  6. 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:

  1. Install the Python requirements:

    1. Open a command window in the tools/nrf802154_sniffer/ folder.
    2. Install the Python dependencies listed in requirements.txt by doing one of the following:

       py -3 -m pip install -r requirements.txt
      
      python -m pip install -r requirements.txt
      
      python3 -m pip install -r requirements.txt
      
    3. Close the command window.

  2. Copy the Sniffer capture plugin into Wireshark's folder for external capture plugins:

    1. Open Wireshark.
    2. Go to Help > About Wireshark (on Windows or Linux) or Wireshark > About Wireshark (on macOS).

      About Wireshark

    3. Select the Folders tab.

    4. Double-click the location for the Personal Extcap path to open this folder.

      Personal Extcap path

    5. 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
  3. Make sure that the nRF Sniffer files run correctly:

    1. Open a command window in Wireshark's folder for personal external capture plugins.
    2. Run the Sniffer tool to list available interfaces.

      nrf802154_sniffer.bat --extcap-interfaces
      
      ./nrf802154_sniffer.sh --extcap-interfaces
      

      You should see a series of strings, similar to what is shown in the following:

      extcap {version=0.7.2}{help=https://github.com/NordicSemiconductor/nRF-Sniffer-for-802.15.4}{display=nRF Sniffer for 802.15.4}
      control {number=6}{type=button}{role=logger}{display=Log}{tooltip=Show capture log}
      
  4. 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.

    nRF Sniffer for 802.15.4 in Wireshark