BLE5 capture environment to build - Based nRF52832

To be able to quickly build BLE5 packet capture environment, wrote this article, I hope to give a Bluetooth developers to bring some help. The following is a specific procedure. End of the article links needed to pay for the software.

First, install WireShark2.4.6

BLE Ethereal is based WireShark, other versions not verified, validated version 2.4.6 available. WinPcap must be installed. When you uninstall the original WireShark, WinPcap not deleted, so when you install the 2.4.6 version will not have to install WinPcap up. Software installation nothing to say until the next point on it.

Install wireshark

Second, the installation Python2.7

Here it must be installed Python2.7 version, measured Python3 not, have Python2.7, then there is no longer installed on the computer, but need to ensure python installation directory in the environment variable can be viewed in the console input "python -version" whether installed.

View python2.7 is installed correctly

 

 Third, the installation pyserial V3.4

If a computer with Internet access, you can enter the following command in the console: "python -m pip install pyserial", this network will automatically download pyserial. If not online, offline can be installed in accordance with the following steps.

Offline Installation: unzip pyserial-3.4.tar.gz, into the pyserial-3.4 folder in the console directory, in turn execute the command: "python setup.py build", "python setup.py install" to complete the installation. As shown below.

Offline installation pyserial

Fourth, set up WireShark

Open Wireshark, click Help-> Folder, and then click the directory Extcap path, the open Wireshark extcap directory, or by direct installation directory Wireshark open line, as shown below.

Open the folder wireshark of extcap

将nrfsniffer200beta312oct20181c2a221下的extcap文件夹中的内容复制到wireshark的extcap文件夹中。 

复制extcap文件夹内容

将nrfsniffer200beta312oct20181c2a221下的Profile_nRF_Sniffer_v2_001文件夹复制到wireshark的profiles文件夹下。 

复制Profile_nRF_Sniffer_v2_001文件夹

五、开始抓包 

到这里,环境已经搭建好了。接下来关闭Wireshark,插上nrf52832 Sniffer,这里需要安装CP210x驱动,因为这个sniffer实际上是通过USB转TTL芯片CP210x与wireshark通信的,插入sniffer后可以在设备管理器中查看是否驱动是否正常。确保驱动无误后打开Wireshark,点击下图中的nRF Sniffer即可开始抓包,如果没有出现“nRF sniffer COMx”,则可能是串口驱动没有安装正确,或者pyserial没有安装正确。

插入sniffer,打开wireshark

最后,切换协议到之前设置的BLE协议:在Wireshark中点击Edit->Configuration Profiles…,出来以下选项,选择Profile_nRF_Sniffer_V2_001,点击OK完成设置。

选择解析协议

Sniffer默认抓取的是所有的广播包,可以在下图中Device中选择感兴趣的从机MAC地址,这样Sniffer就会只抓取该设备的数据包了。 有时候主机连上从机后,抓包工具就抓不到包了,这可能是抓包工具没有抓到跳频map,导致跟丢(只是猜测)。这时候主机断开重连一次可能就能抓到了。

sniffer抓取周围BLE设备的广播包

 

六、本文涉及的软件工具

链接:https://pan.baidu.com/s/1-P-jAOLgrkN6dihlCCVHEQ    提取码:8rgy 

发布了1 篇原创文章 · 获赞 0 · 访问量 16

Guess you like

Origin blog.csdn.net/qq_27575841/article/details/104055886