🦈
Bluefruit LE Sniffer + WiresharkでBluetoothパケットを見るための準備
Bluefruit LE Sniffer + Wiresharkのセットアップに若干躓いたのでメモ
Snifferのドライバ
デバイスマネージャポートかほかのデバイスに下記画像のような感じでUART Bridge Controllerが表示されているはず。

ドライバがおそらくないので、ダウンロードしてくる。
にVirtual COM Port driverが要ると書いてあるので、リンク先でダウンロードする。
今回はCP210x VCP Windowsをダウンロードした。
ドライバを解凍したら、「ドライバーの更新」から手動でslabvcp.infがあるフォルダ(デフォルトであれば、CP210x_VCP_Windowsのはず)を指定する。

Wireshark周辺の設定
nRF-Sniffer
製品ページに
まず、開発機(Windows PC)に、Wiresharkとスニッファーブリッジソフトウェア(nRF-Sniffer)をダウンロードしておきます。と書いてある。
nRF-Snifferのリンク先は404になっているので、自分で探す。 これが正解っぽい。
ダウンロード・解凍したら、
- Wiresharkの
extcapフォルダの中に、nRF-Snifferのextcapフォルダの中身をコピーする - Wiresharkの
profilesフォルダの中に、nRF-SnifferのProfile_nRF_Sniffer_Bluetooth_LEフォルダごとコピーする
Python(pyserial)
Python環境が必要。筆者環境はPython 3.11.0。
pyserialも必要なのでインストールする。
pip install pyserial
動作確認のためにextcapへ移動してターミナルを起動し、下記コマンドを打つ。
python nrf_sniffer_ble.py --extcap-interfaces
実行結果(例)
PS C:\Program Files\Wireshark\extcap> python nrf_sniffer_ble.py --extcap-interfaces
extcap {version=4.1.1}{display=nRF Sniffer for Bluetooth LE}{help=https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE}
interface {value=COM5-None}{display=nRF Sniffer for Bluetooth LE COM5}
control {number=0}{type=selector}{display=Device}{tooltip=Device list}
control {number=1}{type=selector}{display=Key}{tooltip=}
control {number=2}{type=string}{display=Value}{tooltip=6 digit passkey or 16 or 32 bytes encryption key in hexadecimal starting with '0x', big endian format.If the entered key is shorter than 16 or 32 bytes, it will be zero-padded in front'}{validation=\b^(([0-9]{6})|(0x[0-9a-fA-F]{1,64})|([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2}) (public|random))$\b}
control {number=3}{type=string}{display=Adv Hop}{default=37,38,39}{tooltip=Advertising channel hop sequence. Change the order in which the sniffer switches advertising channels. Valid channels are 37, 38 and 39 separated by comma.}{validation=^\s*((37|38|39)\s*,\s*){0,2}(37|38|39){1}\s*$}{required=true}
control {number=7}{type=button}{display=Clear}{tooltop=Clear or remove device from Device list}
control {number=4}{type=button}{role=help}{display=Help}{tooltip=Access user guide (launches browser)}
control {number=5}{type=button}{role=restore}{display=Defaults}{tooltip=Resets the user interface and clears the log file}
control {number=6}{type=button}{role=logger}{display=Log}{tooltip=Log per interface}
value {control=0}{value= }{display=All advertising devices}{default=true}
value {control=0}{value=[00,00,00,00,00,00,0]}{display=Follow IRK}
value {control=1}{value=0}{display=Legacy Passkey}{default=true}
value {control=1}{value=1}{display=Legacy OOB data}
value {control=1}{value=2}{display=Legacy LTK}
value {control=1}{value=3}{display=SC LTK}
value {control=1}{value=4}{display=SC Private Key}
value {control=1}{value=5}{display=IRK}
value {control=1}{value=6}{display=Add LE address}
value {control=1}{value=7}{display=Follow LE address}
Wireshark起動

右下のプロファイルがDefaultになっていると何も出ないので、プロファイルをクリックしてBluetoothを選択する

nRF Sniffer for Bluetooth LE COM{N}があるのでクリックする。

Bluetoothパケットがキャプチャーできる🚀
参考・ダウンロード先
Discussion