Bluetooth connection issue diagnostics CN - Jim-tech/IoT-Developer-Boot-Camp GitHub Wiki
English | Chinese
开发过程中有时遇到蓝牙连接失败, 为了避免或改善这种情况, 需要定位连接失败的原因是哪一方 ( master / slave) 造成的或停在连接过程的哪一步. Simplicity Studio 有个很有用的工具 Network Analyzer, 使得无线数据包可以被WSTK捕获并进行详细解码. 捕获的数据由 EFR32xG22 设备 RF 层提供. 在某些情况下, EFR32xG22 设备 RF 层可能没有正常捕捉到数据, 这直接导致 Network Analyzer 无法获取数据. 这里介绍另一个强大的工具 Ellisys Bluetooth Tracker, 可以用来对 BLE 或 Wi-Fi 通信的并发捕获和分析, 同时也支持各种的有线接口. 可以在这两个工具上捕获的数据基础上分析 BLE 的行为. 前些时间收到客户反馈, 客户做完静电测试与老化测试后, 特定的一些EFR32xG22有时遇到蓝牙连接失败, 客户把坏片送来检验, 我们将坏片换到 BRD4182 radio 板上去复现问题。下面讨论根据这两个工具如何诊断和定位问题.
- 1 WSTK with EFR32xG22 radio boards(BRD4182A坏片板)
- 1 智能手机, 这里用 HUAWEI BTV-W09, Android 7.0
- 1 Ellisys Bluetooth Tracker
BRD4182A radio 板支持三种无线协议, Bluetooth LE/Mesh, Zigbee and Proprietary. 这里用的是 Bluetooth LE.



Simplicity Studio 是一个免费的基于 Eclipse 的集成开发环境 (IDE), Silicon Labs 在此基础提供了一系列的非常有用的工具. 开发人员可以使用 Simplicity Studio 来开发, 调试并分析其应用程序. 这里用它的 Network Analyzer 抓包.
Ellisys Bluetooth Analyzer 支持空中数据并发捕获, 用于与 Network Analyzer所捕获的数据进行比较.
对 EFR32xG22 烧录测试软件. 启动 Network Analyzer 与 Ellisys Bluetooth Analyzer. 操作智能手机应用 EFR connect 连接和断开. 重复测试几次, 然后停止并保存数据. 如何捕捉数据, 这里将不深入细节, 参阅这些链接了解更多信息 Network Analyzer, Ellisys Bluetooth Analyzer.
抓到数据后,Ellisys Bluetooth Analyzer会保存成.btt 文件,Network Analyzer 会保存成 .isd 文件.
太多数据包了, 设置过滤条件, 方便分析.










这里同样需要过滤一些空中数据.





同样以第一个connection indication 包设为时间轴 0 点, 这样能得到与Ellisys Bluetooth Analyzer匹配的时间轴.


智能手机侧已经发送了connection indication包, 但是坏片 EFR32xG22设备无法捕捉到并做响应, 所以这个问题是由坏片 EFR32xG22设备侧造成的, 它没能收到 connection indication包. 通过在第一个connection indication包上设置时间参考点, 很容易比较Network Analyzer 与 Ellisys Bluetooth Analyzer捕获的空气数据, 这样有助于定位问题是由哪边, 哪一步引起的.