SimpleBLEPeripheral 与dongle自动断开连接后再也无法重连
TI的工程师,你好
我使用CC2640作为从机和dongle配对连接后,一段时间以后会出现自动断开的情况(CONNECTION_TIMEOUT),之后dongle在也无法连接CC2640(CONNECTION_FAILED_TO_BE_ESTABLISHED)。这可能是由于什么原因导致的?
log及sniffer抓图如下:
自动断开时的log:
[10:43:19:006] : 'Get Bonded Devices List' request sent
[10:43:19:006] : 'Command Status' event received
[10:43:19:006] : Status: BLE_STATUS_OK
[10:43:19:006] : 'Get Bonded Devices List Response' event received
[10:43:19:022] : 'Command Complete' event received
[10:43:19:022] : Status: BLE_STATUS_OK
[10:43:19:022] : 'Get Whitelist' request sent
[10:43:19:022] : 'Command Status' event received
[10:43:19:022] : Status: BLE_STATUS_OK
[10:43:19:022] : 'Get Whitelist Response' event received
[10:43:19:022] : 'Command Complete' event received
[10:43:19:022] : Status: BLE_STATUS_OK
[10:43:19:022] : 'Get Bonded Devices List' request sent
[10:43:19:022] : 'Command Status' event received
[10:43:19:022] : Status: BLE_STATUS_OK
[10:43:19:022] : 'Get Bonded Devices List Response' event received
[10:43:19:022] : 'Command Complete' event received
[10:43:19:022] : Status: BLE_STATUS_OK
Info: gpm.M1115: Pairing with 1902g_BF_xxx [A0:E6:F8:4F:CD:A8] completed successfully.
[10:49:05:143] : 'Connection Terminated Notification' event received
[10:49:05:143] : Reason: CONNECTION_TIMEOUT
无法连接的log:
[11:09:18:143] : 'Resolve and Set Peer Device BD Address' request sent
[11:09:18:143] : BD Address Type: PUBLIC_ADDRESS
[11:09:18:143] : BD Address: A8:CD:4F:F8:E6:A0:00:00
[11:09:18:146] : 'Command Status' event received
[11:09:18:146] : Status: BLE_STATUS_OK
[11:09:18:150] : 'Resolve and Set Peer Device BD Address Response' event received
[11:09:18:150] : Status: 0x01
[11:09:18:150] : 'Command Complete' event received
[11:09:18:150] : Status: BLE_STATUS_OK
[11:09:18:150] : 'Establish Connection' request sent
[11:09:18:150] : BD Address Type: PUBLIC_ADDRESS
[11:09:18:150] : BD Address: A8:CD:4F:F8:E6:A0:00:00
[11:09:18:153] : 'Command Status' event received
[11:09:18:153] : Status: BLE_STATUS_OK
[11:09:18:235] : 'Establish Connection Response' event received
[11:09:19:022] : 'Current Connection Parameters' event received
[11:09:19:022] : HCI Status: 0x00
[11:09:19:022] : Connection Interval: 7.50 ms
[11:09:19:022] : Slave Latency: 0
[11:09:19:022] : Supervision Timeout: 2000 ms
[11:09:19:022] : 'Command Complete' event received
[11:09:19:022] : Status: BLE_STATUS_OK
[11:09:19:022] : 'Connection Terminated Notification' event received
[11:09:19:022] : Reason: CONNECTION_FAILED_TO_BE_ESTABLISHED
[11:09:19:022] : 'Get local device security keys' request sent
[11:09:19:069] : 'Command Status' event received
[11:09:19:069] : Status: BLE_STATUS_OK
[11:09:19:069] : 'Get local device security keys response' event received
[11:09:19:069] : Key flags: INITIATOR_ENCRYPTION_INFORMATION, INITIATOR_IDENTITY_INFORMATION, INITIATOR_SIGNATURE_KEY, RESPONDER_ENCRYPTION_INFORMATION, RESPONDER_IDENTITY_INFORMATION, RESPONDER_SIGNATURE_KEY
[11:09:19:069] : Long Term Key (LTK): [D6:93:E8:A4:23:55:48:99:1D:77:61:E6:63:2B:10:8E]
[11:09:19:069] : Encrypted Diversifier (Ediv) and Random Number: [99:1F:26:1E:F6:09:97:2E:AD:7E]
[11:09:19:069] : Identity Resolving Key (IRK): [0A:2D:F4:65:E3:BD:7B:49:1E:B4:C0:95:95:13:46:73]
[11:09:19:069] : Identification Address: [0x00A050021E14, PUBLIC_ADDRESS]
[11:09:19:069] : Connection Signature Resolving Key (CSRK): [90:D5:06:95:92:ED:91:D7:A8:9E:2C:DC:4A:93:5B:F9]
[11:09:19:070] : 'Command Complete' event received
[11:09:19:070] : Status: BLE_STATUS_OK
Derrick Cheng,
能把完整的空中log附件上来吗?
包括自动断开的,还有连接失败的。
谢谢回复,
上次抓到的log没有保存,在抓到后我会及时上传。
另,sniffer 经常抓不到想要的数据是什么原因呢? 比如filter配置为PTZ=L2CAP-S PTZ=Control 但即使有连接还是没有抓到任何包
Y,
连接不上的过程抓不到任何包,不知道是因为sniffer的原因还是别的,
dongle 提示信息是:
CONNECTION_FAILED_TO_BE_ESTABLISHED
这个问题之前也有人提过,https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/377682
- The RF performance on one or both devices is not good, so the slave either never receives the connection request, or the master never receives any packets from the slave during the first 6 connection events. The RF Performance could be bad due to a failed CRC, collision or maybe the devices are just out of range. dongle 显示RSSI -34db,可以排除
- There could be a timing issue in either device. If the link layer clock on either device is not running at 32.768kHz (within the tolerance set using the HCI_Ext_SetSCACmd function; default is +/-50ppm) then the timing will be off and the slave might not be listening at the correct time to receive the master's packets. PM2会用到32.768K的晶振?
- If the slave device is advertising with the whitelist filter policy set to GAP_FILTER_POLICY_WHITE_CONor GAP_FILTER_POLICY_WHITE then the slave will ignore the connection from the master and continue advertising normally, and the master will get the 0x3E error since it does not receive any packets from the slave during the first 6 connection events. 白名单没有配置,使用默认值
另外 ,这么两个现象:
1. 连接不上的情况大多发生在使用串口下载firmware以后(rom bootloader)
2. 重启很多次以后有改善,可以正常连接
接上贴,
以下是联系很多次尝试连接后dongle的log:
[13:36:58:217] : 'Stop Scan' request sent
[13:36:58:219] : 'Command Status' event received
[13:36:58:219] : Status: BLE_STATUS_OK
[13:36:58:219] : 'Scan Stopped Notification' event received
[13:36:58:223] : 'Command Complete' event received
[13:36:58:223] : Status: BLE_STATUS_OK
[13:36:59:005] : 'Resolve and Set Peer Device BD Address' request sent
[13:36:59:005] : BD Address Type: PUBLIC_ADDRESS
[13:36:59:005] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:36:59:007] : 'Command Status' event received
[13:36:59:007] : Status: BLE_STATUS_OK
[13:36:59:009] : 'Resolve and Set Peer Device BD Address Response' event received
[13:36:59:009] : Status: 0x01
[13:36:59:009] : 'Command Complete' event received
[13:36:59:009] : Status: BLE_STATUS_OK
[13:36:59:009] : 'Establish Connection' request sent
[13:36:59:009] : BD Address Type: PUBLIC_ADDRESS
[13:36:59:009] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:36:59:012] : 'Command Status' event received
[13:36:59:012] : Status: BLE_STATUS_OK
[13:36:59:034] : 'Establish Connection Response' event received
[13:36:59:825] : 'Current Connection Parameters' event received
[13:36:59:825] : HCI Status: 0x00
[13:36:59:825] : Connection Interval: 8.75 ms
[13:36:59:825] : Slave Latency: 0
[13:36:59:825] : Supervision Timeout: 100 ms
[13:36:59:825] : 'Command Complete' event received
[13:36:59:825] : Status: BLE_STATUS_OK
[13:36:59:826] : 'Get local device security keys' request sent
[13:36:59:826] : 'Connection Terminated Notification' event received
[13:36:59:826] : Reason: CONNECTION_FAILED_TO_BE_ESTABLISHED
[13:36:59:880] : 'Command Status' event received
[13:36:59:880] : Status: BLE_STATUS_OK
[13:36:59:880] : 'Get local device security keys response' event received
[13:36:59:880] : Key flags: INITIATOR_ENCRYPTION_INFORMATION, INITIATOR_IDENTITY_INFORMATION, INITIATOR_SIGNATURE_KEY, RESPONDER_ENCRYPTION_INFORMATION, RESPONDER_IDENTITY_INFORMATION, RESPONDER_SIGNATURE_KEY
[13:36:59:880] : Long Term Key (LTK): [D6:93:E8:A4:23:55:48:99:1D:77:61:E6:63:2B:10:8E]
[13:36:59:880] : Encrypted Diversifier (Ediv) and Random Number: [99:1F:26:1E:F6:09:97:2E:AD:7E]
[13:36:59:880] : Identity Resolving Key (IRK): [0A:2D:F4:65:E3:BD:7B:49:1E:B4:C0:95:95:13:46:73]
[13:36:59:880] : Identification Address: [0x00A050021E14, PUBLIC_ADDRESS]
[13:36:59:880] : Connection Signature Resolving Key (CSRK): [90:D5:06:95:92:ED:91:D7:A8:9E:2C:DC:4A:93:5B:F9]
[13:36:59:880] : 'Command Complete' event received
[13:36:59:880] : Status: BLE_STATUS_OK
[13:37:05:461] : 'Resolve and Set Peer Device BD Address' request sent
[13:37:05:461] : BD Address Type: PUBLIC_ADDRESS
[13:37:05:461] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:37:05:463] : 'Command Status' event received
[13:37:05:463] : Status: BLE_STATUS_OK
[13:37:05:466] : 'Resolve and Set Peer Device BD Address Response' event received
[13:37:05:466] : Status: 0x01
[13:37:05:466] : 'Command Complete' event received
[13:37:05:466] : Status: BLE_STATUS_OK
[13:37:05:466] : 'Establish Connection' request sent
[13:37:05:466] : BD Address Type: PUBLIC_ADDRESS
[13:37:05:466] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:37:05:471] : 'Command Status' event received
[13:37:05:471] : Status: BLE_STATUS_OK
[13:37:05:615] : 'Establish Connection Response' event received
[13:37:06:166] : 'Current Connection Parameters' event received
[13:37:06:166] : HCI Status: 0x00
[13:37:06:166] : Connection Interval: 8.75 ms
[13:37:06:166] : Slave Latency: 0
[13:37:06:166] : Supervision Timeout: 100 ms
[13:37:06:167] : 'Command Complete' event received
[13:37:06:167] : Status: BLE_STATUS_OK
[13:37:06:168] : 'Get local device security keys' request sent
[13:37:06:168] : 'Connection Terminated Notification' event received
[13:37:06:168] : Reason: CONNECTION_FAILED_TO_BE_ESTABLISHED
[13:37:06:233] : 'Command Status' event received
[13:37:06:233] : Status: BLE_STATUS_OK
[13:37:06:233] : 'Get local device security keys response' event received
[13:37:06:233] : Key flags: INITIATOR_ENCRYPTION_INFORMATION, INITIATOR_IDENTITY_INFORMATION, INITIATOR_SIGNATURE_KEY, RESPONDER_ENCRYPTION_INFORMATION, RESPONDER_IDENTITY_INFORMATION, RESPONDER_SIGNATURE_KEY
[13:37:06:233] : Long Term Key (LTK): [D6:93:E8:A4:23:55:48:99:1D:77:61:E6:63:2B:10:8E]
[13:37:06:233] : Encrypted Diversifier (Ediv) and Random Number: [99:1F:26:1E:F6:09:97:2E:AD:7E]
[13:37:06:233] : Identity Resolving Key (IRK): [0A:2D:F4:65:E3:BD:7B:49:1E:B4:C0:95:95:13:46:73]
[13:37:06:233] : Identification Address: [0x00A050021E14, PUBLIC_ADDRESS]
[13:37:06:233] : Connection Signature Resolving Key (CSRK): [90:D5:06:95:92:ED:91:D7:A8:9E:2C:DC:4A:93:5B:F9]
[13:37:06:233] : 'Command Complete' event received
[13:37:06:233] : Status: BLE_STATUS_OK
[13:37:34:485] : 'Resolve and Set Peer Device BD Address' request sent
[13:37:34:485] : BD Address Type: PUBLIC_ADDRESS
[13:37:34:485] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:37:34:488] : 'Command Status' event received
[13:37:34:488] : Status: BLE_STATUS_OK
[13:37:34:489] : 'Resolve and Set Peer Device BD Address Response' event received
[13:37:34:489] : Status: 0x01
[13:37:34:490] : 'Command Complete' event received
[13:37:34:490] : Status: BLE_STATUS_OK
[13:37:34:490] : 'Establish Connection' request sent
[13:37:34:490] : BD Address Type: PUBLIC_ADDRESS
[13:37:34:490] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:37:34:493] : 'Command Status' event received
[13:37:34:493] : Status: BLE_STATUS_OK
[13:37:34:572] : 'Establish Connection Response' event received
[13:37:34:951] : 'Current Connection Parameters' event received
[13:37:34:951] : HCI Status: 0x00
[13:37:34:951] : Connection Interval: 8.75 ms
[13:37:34:951] : Slave Latency: 0
[13:37:34:951] : Supervision Timeout: 100 ms
[13:37:34:951] : 'Command Complete' event received
[13:37:34:951] : Status: BLE_STATUS_OK
[13:37:34:952] : 'Get local device security keys' request sent
[13:37:34:952] : 'Connection Terminated Notification' event received
[13:37:34:952] : Reason: CONNECTION_TIMEOUT
[13:37:35:001] : 'Command Status' event received
[13:37:35:001] : Status: BLE_STATUS_OK
[13:37:35:002] : 'Get local device security keys response' event received
[13:37:35:002] : Key flags: INITIATOR_ENCRYPTION_INFORMATION, INITIATOR_IDENTITY_INFORMATION, INITIATOR_SIGNATURE_KEY, RESPONDER_ENCRYPTION_INFORMATION, RESPONDER_IDENTITY_INFORMATION, RESPONDER_SIGNATURE_KEY
[13:37:35:002] : Long Term Key (LTK): [D6:93:E8:A4:23:55:48:99:1D:77:61:E6:63:2B:10:8E]
[13:37:35:002] : Encrypted Diversifier (Ediv) and Random Number: [99:1F:26:1E:F6:09:97:2E:AD:7E]
[13:37:35:002] : Identity Resolving Key (IRK): [0A:2D:F4:65:E3:BD:7B:49:1E:B4:C0:95:95:13:46:73]
[13:37:35:002] : Identification Address: [0x00A050021E14, PUBLIC_ADDRESS]
[13:37:35:002] : Connection Signature Resolving Key (CSRK): [90:D5:06:95:92:ED:91:D7:A8:9E:2C:DC:4A:93:5B:F9]
[13:37:35:002] : 'Command Complete' event received
[13:37:35:002] : Status: BLE_STATUS_OK
1768.连接不了.psd
sniffer抓到的log,对应dongle的log如下:
[13:39:27:956] : 'Stop Scan' request sent
[13:39:27:959] : 'Command Status' event received
[13:39:27:959] : Status: BLE_STATUS_OK
[13:39:27:959] : 'Scan Stopped Notification' event received
[13:39:28:054] : 'Resolve and Set Peer Device BD Address' request sent
[13:39:28:054] : BD Address Type: PUBLIC_ADDRESS
[13:39:28:054] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:39:28:054] : 'Command Complete' event received
[13:39:28:054] : Status: BLE_STATUS_OK
[13:39:28:057] : 'Command Status' event received
[13:39:28:057] : Status: BLE_STATUS_OK
[13:39:28:058] : 'Resolve and Set Peer Device BD Address Response' event received
[13:39:28:058] : Status: 0x01
[13:39:28:058] : 'Command Complete' event received
[13:39:28:058] : Status: BLE_STATUS_OK
[13:39:28:058] : 'Establish Connection' request sent
[13:39:28:058] : BD Address Type: PUBLIC_ADDRESS
[13:39:28:058] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:39:28:063] : 'Command Status' event received
[13:39:28:063] : Status: BLE_STATUS_OK
[13:39:28:065] : 'Establish Connection Response' event received
[13:39:28:478] : 'Current Connection Parameters' event received
[13:39:28:478] : HCI Status: 0x00
[13:39:28:478] : Connection Interval: 8.75 ms
[13:39:28:478] : Slave Latency: 0
[13:39:28:478] : Supervision Timeout: 100 ms
[13:39:28:478] : 'Command Complete' event received
[13:39:28:478] : Status: BLE_STATUS_OK
[13:39:28:478] : 'Get local device security keys' request sent
[13:39:28:478] : 'Connection Terminated Notification' event received
[13:39:28:478] : Reason: CONNECTION_TIMEOUT
[13:39:28:520] : 'Command Status' event received
[13:39:28:520] : Status: BLE_STATUS_OK
[13:39:28:520] : 'Get local device security keys response' event received
[13:39:28:520] : Key flags: INITIATOR_ENCRYPTION_INFORMATION, INITIATOR_IDENTITY_INFORMATION, INITIATOR_SIGNATURE_KEY, RESPONDER_ENCRYPTION_INFORMATION, RESPONDER_IDENTITY_INFORMATION, RESPONDER_SIGNATURE_KEY
[13:39:28:520] : Long Term Key (LTK): [D6:93:E8:A4:23:55:48:99:1D:77:61:E6:63:2B:10:8E]
[13:39:28:520] : Encrypted Diversifier (Ediv) and Random Number: [99:1F:26:1E:F6:09:97:2E:AD:7E]
[13:39:28:520] : Identity Resolving Key (IRK): [0A:2D:F4:65:E3:BD:7B:49:1E:B4:C0:95:95:13:46:73]
[13:39:28:520] : Identification Address: [0x00A050021E14, PUBLIC_ADDRESS]
[13:39:28:520] : Connection Signature Resolving Key (CSRK): [90:D5:06:95:92:ED:91:D7:A8:9E:2C:DC:4A:93:5B:F9]
[13:39:28:520] : 'Command Complete' event received
[13:39:28:520] : Status: BLE_STATUS_OK
之后再尝试连接sniffer就抓不到信息了,dongle提示信息变成了 CONNECTION_FAILED_TO_BE_ESTABLISHED
[13:45:28:338] : 'Resolve and Set Peer Device BD Address' request sent
[13:45:28:338] : BD Address Type: PUBLIC_ADDRESS
[13:45:28:338] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:45:28:341] : 'Command Status' event received
[13:45:28:341] : Status: BLE_STATUS_OK
[13:45:28:342] : 'Resolve and Set Peer Device BD Address Response' event received
[13:45:28:342] : Status: 0x01
[13:45:28:343] : 'Command Complete' event received
[13:45:28:343] : Status: BLE_STATUS_OK
[13:45:28:343] : 'Establish Connection' request sent
[13:45:28:343] : BD Address Type: PUBLIC_ADDRESS
[13:45:28:343] : BD Address: 32:83:55:F8:E6:A0:00:00
[13:45:28:346] : 'Command Status' event received
[13:45:28:346] : Status: BLE_STATUS_OK
[13:45:28:360] : 'Establish Connection Response' event received
[13:45:29:011] : 'Current Connection Parameters' event received
[13:45:29:011] : HCI Status: 0x00
[13:45:29:011] : Connection Interval: 8.75 ms
[13:45:29:011] : Slave Latency: 0
[13:45:29:011] : Supervision Timeout: 100 ms
[13:45:29:012] : 'Command Complete' event received
[13:45:29:012] : Status: BLE_STATUS_OK
[13:45:29:012] : 'Get local device security keys' request sent
[13:45:29:012] : 'Connection Terminated Notification' event received
[13:45:29:012] : Reason: CONNECTION_FAILED_TO_BE_ESTABLISHED
[13:45:29:072] : 'Command Status' event received
[13:45:29:072] : Status: BLE_STATUS_OK
[13:45:29:073] : 'Get local device security keys response' event received
[13:45:29:073] : Key flags: INITIATOR_ENCRYPTION_INFORMATION, INITIATOR_IDENTITY_INFORMATION, INITIATOR_SIGNATURE_KEY, RESPONDER_ENCRYPTION_INFORMATION, RESPONDER_IDENTITY_INFORMATION, RESPONDER_SIGNATURE_KEY
[13:45:29:073] : Long Term Key (LTK): [D6:93:E8:A4:23:55:48:99:1D:77:61:E6:63:2B:10:8E]
[13:45:29:073] : Encrypted Diversifier (Ediv) and Random Number: [99:1F:26:1E:F6:09:97:2E:AD:7E]
[13:45:29:073] : Identity Resolving Key (IRK): [0A:2D:F4:65:E3:BD:7B:49:1E:B4:C0:95:95:13:46:73]
[13:45:29:073] : Identification Address: [0x00A050021E14, PUBLIC_ADDRESS]
[13:45:29:073] : Connection Signature Resolving Key (CSRK): [90:D5:06:95:92:ED:91:D7:A8:9E:2C:DC:4A:93:5B:F9]
[13:45:29:073] : 'Command Complete' event received
[13:45:29:073] : Status: BLE_STATUS_OK
Hi Y,
6320.对比.psd
这个log包含连不上和正常连接两个部分,可以用作对比
SimpleBLEPeripheral 相关文章:
- 蓝牙从机事件处理函数 SimpleBLEPeripheral_ProcessEvent的疑问
- 我的cc2540 用simpleBLEperipheral 刷完之后怎么只有 generic access service 这一个,没有其它的服务呢?
- SimpleBLEPeripheral中的Characteristic 1 2 3 4 5的模式都是定死的吗?
- SimpleBLEPeripheral_bond实验例程
- 关于从机SimpleBLEPeripheral例程中的SBP_PERIODIC_EVT
- 关于蓝牙协议栈1.3.2中SimpleBLECentral和SimpleBLEPeripheral函数的详解