espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.62k stars 7.28k forks source link

BLE cannot connect to virtual device broadcast by Android app nRFConnect. (IDFGH-7404) #8982

Closed Zmmfly closed 1 year ago

Zmmfly commented 2 years ago

Environment

Problem Description

//Detailed problem description goes here. WiFi SoftAP is turned on, BLE is also turned on at the same time, scanning is normal. The connection to the actual device is normal, and the connection to the virtual device broadcast by nRFConnect reports a connection timeout error, and the nRF sniffer does not find the connection initiation packet.

Expected Behavior

The nRF sniffer should see connection initiation packets and the connection is fine.

Actual Behavior

There is no connection to initiate a data packet, and the GAP event reports a connection timeout error (BLE_HS_ETIMEOUT).

Steps to reproduce

  1. Broadcast the virtual device from nRFConnect
  2. Enable WiFi SoftAP and Bluetooth scanning on ESP32 at the same time
  3. Attempt to connect to the virtual device broadcast by nRFConnect
  4. GAP event will report connection timeout error

Code to reproduce this issue

Sorry, these are private codes.

Debug Logs

D (16:46:05.955) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x000c len=2

D (16:46:05.966) NimBLE: 0x0c 
D (16:46:05.967) NimBLE: 0x20 
D (16:46:05.968) NimBLE: 0x02 
D (16:46:05.968) NimBLE: 0x00 
D (16:46:05.979) NimBLE: 0x00 
D (16:46:05.980) NimBLE:

I (16:46:05.981) NimBLE: GAP procedure initiated: connect; 
I (16:46:05.992) NimBLE: peer_addr_type=0 peer_addr=
I (16:46:05.993) NimBLE: 51:a2:0d:1b:3a:fa
I (16:46:05.994) NimBLE:  scan_itvl=16 scan_window=16 itvl_min=6 itvl_max=6 latency=0 supervision_timeout=15 min_ce_len=0 max_ce_len=0 own_addr_type=0
I (16:46:06.017) NimBLE: 

D (16:46:06.017) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x000d len=25

D (16:46:06.019) NimBLE: 0x0d 
D (16:46:06.029) NimBLE: 0x20 
D (16:46:06.030) NimBLE: 0x19 
D (16:46:06.031) NimBLE: 0x10 
D (16:46:06.031) NimBLE: 0x00 
D (16:46:06.042) NimBLE: 0x10 
D (16:46:06.043) NimBLE: 0x00 
D (16:46:06.043) NimBLE: 0x00 
D (16:46:06.044) NimBLE: 0x00 
D (16:46:06.055) NimBLE: 0xfa 
D (16:46:06.055) NimBLE: 0x3a 
D (16:46:06.056) NimBLE: 0x1b 
D (16:46:06.056) NimBLE: 0x0d 
D (16:46:06.067) NimBLE: 0xa2 
D (16:46:06.068) NimBLE: 0x51 
D (16:46:06.068) NimBLE: 0x00 
D (16:46:06.069) NimBLE: 0x06 
D (16:46:06.080) NimBLE: 0x00 
D (16:46:06.080) NimBLE: 0x06 
D (16:46:06.081) NimBLE: 0x00 
D (16:46:06.082) NimBLE: 0x00 
D (16:46:06.082) NimBLE: 0x00 
D (16:46:06.093) NimBLE: 0x0f 
D (16:46:06.094) NimBLE: 0x00 
D (16:46:06.094) NimBLE: 0x00 
D (16:46:06.095) NimBLE: 0x00 
D (16:46:06.106) NimBLE: 0x00 
D (16:46:06.106) NimBLE: 0x00 
D (16:46:06.107) NimBLE: 

D (16:46:11.108) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x000e len=0

D (16:46:11.110) NimBLE: 0x0e 
D (16:46:11.110) NimBLE: 0x20 
D (16:46:11.111) NimBLE: 0x00 
D (16:46:11.122) NimBLE: 

E (16:46:11.123) ******::*******: 116, err: connect failed
E (16:46:11.125) ******::*******: 117, err: 13
E (16:46:11.136) ble.mon: begin failed
W (16:46:11.136) Timer: Timer not stopped
I (16:46:11.138) NimBLE: GAP procedure initiated: discovery; 
I (16:46:11.149) NimBLE: own_addr_type=0 filter_policy=0 passive=0 limited=0 filter_duplicates=0

ble_conn_req_miss

Other items if possible

Some parameters

Zmmfly commented 2 years ago

In the current test, there is no problem connecting to the physical device, and the connection to the virtual device broadcasted by the mobile phone App nRF connect will not send a connection packet, why?

Zmmfly commented 2 years ago

I'm so sorry, I reopened this issue because it's very inconvenient to debug without being able to connect to a virtual device.