您的安装选项取决于您使用 Pyspinel 的方式。
Extcap 是 Wireshark 的一个插件,支持将 Pyspinel 二进制文件用作捕获接口。Extcap 使用 Wireshark 减少了嗅探线程数据包所需的设置和配置,因为它不需要写入捕获文件。使用此选项,系统会在 Wireshark 中管理和保存配置,例如设置 Thread 通道并从 GUI 选择 RCP 或 NCP 设备路径。
您也可以在不使用 extcap 插件的情况下使用 Wireshark。此选项可让您通过命令行访问 Pyspinel 标志,从而使用各种配置运行嗅探器。您可以每次运行嗅探器时设置这些标志,例如 --channel 15 --uart /dev/ttyACM0
。
安装 Pyspinel 和不带 extcap 的依赖项
- 安装依赖项:
sudo apt install python3-pip
pip3 install --user pyserial ipaddress
- 克隆 Pyspinel 代码库:
git clone https://github.com/openthread/pyspinel
- 安装 Pyspinel:
cd pyspinel
sudo python3 setup.py install
或者,通过安装 pyspinel
软件包来设置环境。请注意,此软件包使用的是 Pyspinel v1.0.0a3 版本,而不是最新的 Pyspinel 主版本。
pip3 install --user pyspinel
如需在没有 extcap 插件的情况下使用 Pyspinel,请参阅使用 Pyspinel 进行数据包嗅探。
使用 extcap 安装 Pyspinel 和依赖项
- 安装依赖项:
sudo apt install python3-pip
pip3 install --user pyserial ipaddress
- 克隆 Pyspinel 代码库:
git clone https://github.com/openthread/pyspinel
- 打开 Wireshark。转到帮助,然后点按关于 Wireshark,然后选择文件夹标签页。Extcap path 条目列出了 extcap 位置。记下此位置。
- 使用 Wireshark 的 extcap 路径安装 Pyspinel:
cd pyspinel
sudo python3 setup.py install --extcap-path=extcap-path
或者,通过安装 pyspinel 软件包来设置环境:
pip3 install pyspinel --install-option="--extcap-path=extcap-path"
如需将 Pyspinel 与 extcap 插件搭配使用,请参阅使用 Extcap 进行数据包嗅探。