安裝選項取決於 Pyspinel 的使用方式。
Extcap 是 Wireshark 的外掛程式,可讓 Wireshark 使用 Pyspinel 二進位檔做為擷取介面。Extcap 不必寫入擷取檔案,因此可減少使用 Wireshark 監聽 Thread 封包所需的設定。使用這個選項時,設定會在 Wireshark 中管理及儲存,例如設定 Thread 頻道,以及從 GUI 選取 RCP 或 NCP 裝置路徑。
您也可以在不使用 extcap 外掛程式的情況下使用 Wireshark。這個選項可讓您透過指令列存取 Pyspinel 旗標,以便使用各種設定執行探測器。每次執行探測器時,都可以設定這些旗標,例如 --channel 15 --uart /dev/ttyACM0。
安裝 Pyspinel 和依附元件 (不含 extcap)
- 安裝依附元件:
sudo apt install python3-pippip3 install --user pyserial ipaddress - 複製 Pyspinel 存放區:
git clone https://github.com/openthread/pyspinel - 安裝 Pyspinel:
cd pyspinelsudo python3 setup.py install
或者,您也可以安裝 pyspinel 套件來設定環境。請注意,這個套件使用的是 Pyspinel v1.0.0a3 版本,而非最新的 Pyspinel main。
pip3 install --user pyspinel
如要在不使用 extcap 外掛程式的情況下使用 Pyspinel,請參閱「使用 Pyspinel 封包側錄」。
使用 extcap 安裝 Pyspinel 和依附元件
- 安裝依附元件:
sudo apt install python3-pippip3 install --user pyserial ipaddress - 複製 Pyspinel 存放區:
git clone https://github.com/openthread/pyspinel - 開啟 Wireshark。依序前往「Help」(說明)、「About Wireshark」(關於 Wireshark),然後選取「Folders」(資料夾) 分頁標籤。「Extcap path」項目會列出 extcap 位置。請記下這個位置。
- 使用 Wireshark 的 extcap 路徑安裝 Pyspinel:
cd pyspinelsudo python3 setup.py install --extcap-path=extcap-path
或者,您也可以安裝 pyspinel 套件來設定環境:
pip3 install pyspinel --install-option="--extcap-path=extcap-path"
如要搭配 extcap 外掛程式使用 Pyspinel,請參閱「使用 Extcap 封包側錄」。