Spinel Extcap provides a more user-friendly way to use OpenThread Sniffer. Spinel Extcap is primarily targeted for integrating OpenThread Sniffer with Wireshark, and is suitable for use with the Wireshark GUI.
For a complete guide to installation and usage, see Packet Sniffing using Extcap on openthread.io.
The tool has been tested on the following platforms:
Platforms | Version |
---|---|
Ubuntu | 14.04 Trusty |
macOS | 10.11 El Capitan |
Windows 10 | 1803 |
Language | Version |
---|---|
Python | 3.6.8 |
Software | Version |
---|---|
Wireshark | 3.0.6 |
To find the correct installation path of the extcap utility on any system, open Wireshark:
"Help" -> "About Wireshark" -> "Folders" -> "Extcap path"
Copy the path. It is refered to as <extcap_path>
in the following sections.
$ git clone https://github.com/openthread/pyspinel
$ cd pyspinel
$ sudo python3 setup.py install --extcap-path=<extcap_path>
$ pip3 install pyspinel --install-option="--extcap-path=<extcap_path>"
1. Install pyspinel package
$ pip3 install pyspinel
2. Install extcap script on Wireshark
Copy the provided extcap_ot.py
to the extcap directory.
For Windows, also copy the provided extcap_ot.bat
to the extcap directory.
For Linux and macOS, verify that the extcap_ot.py
file has the execute (x) permission. If not, add it using:
$ chmod +x extcap_ot.py
extcap_ot.py - extcap interface for integrating OpenThread Sniffer with Wireshark
extcap_ot.py [--arguments]
-h, --help
Show this help message and exit
--extcap-interfaces
Provide a list of interfaces to capture from.
--extcap-interface <EXTCAP_INTERFACE>
Provide the interface to capture from.
--extcap-dlts
Provide a list of dlts for the given interface
--extcap-config
Provide a list of configurations for the given interface.
--fifo <FIFO>
Use together with capture to provide the fifo to dump data to.
--channel <CHANNEL>
IEEE 802.15.4 capture channel [11-26].
--baudrate <BAUDRATE>
Set the serial port baud rate.
--tap
Use to specify DLTs as IEEE 802.15.4 TAP (only for Wireshark3.0 and later).
- Wireshark configuration - Protocols
- Wireshark configuration - FCS Format
The Wireshark welcome window is displayed when Wireshark is first launched. OpenThread Sniffer will be enumerated in the interface list section of Wireshark welcome window.
There are three ways to start sniffing:
-
If this is your first time using an interface, click on Interface Options to set channel and baudrate, then click Start Capture. The parameters will be saved after the start of the capture, and you will not need to set it again the next time you use the interface (unless you need to change the channel).
-
Double click on the hardware interface.
-
Select the hardware interface and then click Start Capture to start sniffing.
Select all hardware interfaces in the Wireshark welcome window and click the Wireshark icon on the top left to start sniffing.
These fields are useful when capturing from multiple interfaces:
Interface name (frame.interface_name) — Interface Identifier used by Wireshark to identify the capture interfaces
Channel (wpan-tap.ch_num) — IEEE 802.15.4 capture channel [11-26]
-
If you have multiple Python interpreters installed, ensure that only the Python3 interpreter is being used by the extcap script. Python2 is no longer supported.
-
See if the hardware has been enumerated on USB and the drivers are loaded.
-
Check that the HEX file for the hardware has been flashed.
-
Reset the hardware by unplugging the hardware, waiting 5 seconds, and plugging it back in.
-
Restart Wireshark. If it still doesn’t appear, verify the python script located in the extcap folder is able to run.
For Linux and macOS:
- Verify that the execute (x) permission is present for the
extcap_ot.py
file.$ ls -l extcap_ot.py
- If the execute permission is missing:
$ chmod +x extcap_ot.py
- List the interfaces:
$ ./extcap_ot.py --extcap-interfaces
For Windows:
- List the interfaces:
C:\> extcap_ot.bat --extcap-interfaces
- If this exits with a python error, verify that
python.exe
can be run from the command line:C:\> py -3 --version
- Verify that the execute (x) permission is present for the
During the Wireshark installation on Ubuntu the user will be prompted to choose one of the following options:
- Create the
wireshark
user group and allow all members of that group to capture packets. - Only allow the root user to capture packets.
Note: Using Wireshark as the root user is strongly discouraged.
To change the settings after the installation, run the following command:
$ sudo dpkg-reconfigure wireshark-common
If Wireshark was configured to restrict the capture to members of the wireshark
group, add the correct user to the group:
$ sudo usermod -a -G wireshark [user]
Add the correct user to the dialout
group:
$ sudo usermod -a -G dialout [user]
Log out and log in again to apply the new user group settings.
Known issue of some old versions of Wireshark. Please upgrade to Wireshark 3.0.6 or later.