espressif / esp-idf

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

NimBLE iOS connection error 574 (IDFGH-11817) #12911

Open Massimiliano-solutiontech opened 10 months ago

Massimiliano-solutiontech commented 10 months ago

Answers checklist.

IDF version.

v5.1.2

Espressif SoC revision.

ESP32-C6

Operating System used.

macOS

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32-C6-DevKitM-1

Power Supply used.

USB

What is the expected behavior?

iOS to immediately connect to the ESP32-C6 as Android does

What is the actual behavior?

ESP32-C6 keeps disconnecting with error 574 and after a while (20 to 40 seconds) successfully connects

Steps to reproduce.

  1. Flash the bleprph example
  2. Connect to the ESP using an app (I tested with nRF Connect and LightBlue)

Debug Logs.

I (24925) NimBLE: disconnect; reason=574 
I (24925) NimBLE: handle=1 our_ota_addr_type=0 our_ota_addr=
I (24925) NimBLE:  our_id_addr_type=0 our_id_addr=
I (24935) NimBLE:  peer_ota_addr_type=0 peer_ota_addr=
I (24935) NimBLE:  peer_id_addr_type=0 peer_id_addr=
I (24945) NimBLE:  conn_itvl=24 conn_latency=0 supervision_timeout=72 encrypted=0 authenticated=0 bonded=0

I (24955) NimBLE: 
I (24955) NimBLE: connection established; status=0 
I (24965) NimBLE: handle=1 our_ota_addr_type=0 our_ota_addr=
I (24965) NimBLE:  our_id_addr_type=0 our_id_addr=
I (24975) NimBLE:  peer_ota_addr_type=0 peer_ota_addr=
I (24975) NimBLE:  peer_id_addr_type=0 peer_id_addr=
I (24985) NimBLE:  conn_itvl=24 conn_latency=0 supervision_timeout=72 encrypted=0 authenticated=0 bonded=0

I (24995) NimBLE: 
I (24995) NimBLE: advertise complete; reason=0
I (25005) ext_bleprph_advertise: rc = 0
I (25005) NimBLE: GAP procedure initiated: extended advertise; instance=0

I (25115) NimBLE: disconnect; reason=574 
I (25125) NimBLE: handle=1 our_ota_addr_type=0 our_ota_addr=
I (25125) NimBLE:  our_id_addr_type=0 our_id_addr=
I (25125) NimBLE:  peer_ota_addr_type=0 peer_ota_addr=
I (25135) NimBLE:  peer_id_addr_type=0 peer_id_addr=
I (25135) NimBLE:  conn_itvl=24 conn_latency=0 supervision_timeout=72 encrypted=0 authenticated=0 bonded=0

I (25145) NimBLE: 
I (25365) NimBLE: connection established; status=0 
I (25365) NimBLE: handle=1 our_ota_addr_type=0 our_ota_addr=
I (25365) NimBLE:  our_id_addr_type=0 our_id_addr=
I (25365) NimBLE:  peer_ota_addr_type=0 peer_ota_addr=
I (25375) NimBLE:  peer_id_addr_type=0 peer_id_addr=
I (25375) NimBLE:  conn_itvl=24 conn_latency=0 supervision_timeout=72 encrypted=0 authenticated=0 bonded=0

I (25385) NimBLE: 
I (25395) NimBLE: advertise complete; reason=0
I (25395) ext_bleprph_advertise: rc = 0
I (25405) NimBLE: GAP procedure initiated: extended advertise; instance=0

I (25545) NimBLE: disconnect; reason=574 
I (25545) NimBLE: handle=1 our_ota_addr_type=0 our_ota_addr=
I (25545) NimBLE:  our_id_addr_type=0 our_id_addr=
I (25545) NimBLE:  peer_ota_addr_type=0 peer_ota_addr=
I (25555) NimBLE:  peer_id_addr_type=0 peer_id_addr=
I (25555) NimBLE:  conn_itvl=24 conn_latency=0 supervision_timeout=72 encrypted=0 authenticated=0 bonded=0

...

I (44165) NimBLE: disconnect; reason=574 
I (44175) NimBLE: handle=1 our_ota_addr_type=0 our_ota_addr=
I (44175) NimBLE:  our_id_addr_type=0 our_id_addr=
I (44185) NimBLE:  peer_ota_addr_type=0 peer_ota_addr=
I (44185) NimBLE:  peer_id_addr_type=0 peer_id_addr=
I (44195) NimBLE:  conn_itvl=24 conn_latency=0 supervision_timeout=72 encrypted=0 authenticated=0 bonded=0

I (44205) NimBLE: 
I (44245) NimBLE: mtu update event; conn_handle=2 cid=4 mtu=514
I (44635) NimBLE: subscribe event; conn_handle=2 attr_handle=8 reason=1 prevn=0 curn=0 previ=0 curi=1
I (45235) NimBLE: Descriptor read; conn_handle=2 attr_handle=14

More Information.

With Android it connects immediately

Massimiliano-solutiontech commented 10 months ago

The issue still persists with v5.2-beta2

cmorganBE commented 9 months ago

I'm seeing similar behavior here with extended advertisements on esp32-s3 with a very close copy of bleprph example. Sometimes it will retry and join, other times it looks like the stack is locked up and the device stops showing up in lightblue.

luomanruo commented 9 months ago

Hi, I conducted tests under the following conditions and did not encounter the same issue. Could you provide more information, such as the version of iOS phone: Iphone 13 mini ios version: 16.3.1 IDF branch: v5.1.2 and v5.2-beta2 example: bleprph app: nRF Connect and LightBlue

luomanruo commented 8 months ago

This issue can be reproduced under the following conditions: ios version: 17.1.2 app: nRF Connect and LightBlue It is likely introduced by the iOS version upgrade.

Massimiliano-solutiontech commented 8 months ago

I have problems with:

Massimiliano-solutiontech commented 7 months ago

@luomanruo now I have problems even with Android:

Debug log ```log I (13034) NimBLE: GAP procedure initiated: extended advertise; instance=0 D (13035) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0039 len=6 D (13035) NimBLE: 0x39 D (13035) NimBLE: 0x20 D (13035) NimBLE: 0x06 D (13035) NimBLE: 0x01 D (13035) NimBLE: 0x01 D (13035) NimBLE: 0x00 D (13035) NimBLE: 0x00 D (13035) NimBLE: 0x00 D (13035) NimBLE: 0x00 D (13036) NimBLE: D (13293) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (13293) NimBLE: subevent: 0x4 D (13293) NimBLE: D (13293) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x5 D (13293) NimBLE: D (13293) NimBLE: Reattempt connection; reason = 0x3e, status = 0,reattempt count = 0 I (13294) NimBLE: disconnect; reason=574 D (13321) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (13321) NimBLE: subevent: 0xa D (13321) NimBLE: D (13322) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (13322) NimBLE: subevent: 0x14 D (13322) NimBLE: D (13322) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (13322) NimBLE: subevent: 0x12 D (13322) NimBLE: I (13322) NimBLE: connection established; status=0 D (13322) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2 D (13323) NimBLE: 0x16 D (13323) NimBLE: 0x20 D (13323) NimBLE: 0x02 D (13323) NimBLE: 0x01 D (13323) NimBLE: 0x00 D (13323) NimBLE: I (13324) NimBLE: advertise complete; reason=0 D (13324) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0036 len=25 D (13324) NimBLE: 0x36 D (13324) NimBLE: 0x20 D (13324) NimBLE: 0x19 D (13324) NimBLE: 0x00 D (13324) NimBLE: 0x01 D (13324) NimBLE: 0x00 D (13324) NimBLE: 0x30 D (13325) NimBLE: 0x00 D (13325) NimBLE: 0x00 D (13325) NimBLE: 0x30 D (13325) NimBLE: 0x00 D (13325) NimBLE: 0x00 D (13325) NimBLE: 0x07 D (13325) NimBLE: 0x00 D (13325) NimBLE: 0x00 D (13325) NimBLE: 0x00 D (13325) NimBLE: 0x00 D (13325) NimBLE: 0x00 D (13326) NimBLE: 0x00 D (13326) NimBLE: 0x00 D (13326) NimBLE: 0x00 D (13326) NimBLE: 0x00 D (13326) NimBLE: 0x00 D (13326) NimBLE: 0x01 D (13326) NimBLE: 0x00 D (13326) NimBLE: 0x02 D (13326) NimBLE: 0x01 D (13326) NimBLE: 0x00 D (13326) NimBLE: D (13327) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0037 len=56 D (13327) NimBLE: 0x37 D (13327) NimBLE: 0x20 D (13327) NimBLE: 0x38 D (13327) NimBLE: 0x00 D (13327) NimBLE: 0x03 D (13328) NimBLE: 0x00 D (13328) NimBLE: 0x34 D (13328) NimBLE: 0x0c D (13328) NimBLE: 0x09 D (13328) NimBLE: 0x49 D (13328) NimBLE: 0x4e D (13328) NimBLE: 0x2d D (13328) NimBLE: 0x54 D (13328) NimBLE: 0x45 D (13328) NimBLE: 0x53 D (13328) NimBLE: 0x54 D (13328) NimBLE: 0x2d D (13329) NimBLE: 0x31 D (13329) NimBLE: 0x2e D (13329) NimBLE: 0x36 D (13329) NimBLE: 0x11 D (13329) NimBLE: 0x07 D (13329) NimBLE: 0x36 D (13329) NimBLE: 0x3a D (13329) NimBLE: 0x33 D (13329) NimBLE: 0x36 D (13329) NimBLE: 0xa2 D (13329) NimBLE: 0x71 D (13330) NimBLE: 0xcb D (13330) NimBLE: 0x88 D (13330) NimBLE: 0x58 D (13330) NimBLE: 0x47 D (13330) NimBLE: 0x96 D (13330) NimBLE: 0xa0 D (13330) NimBLE: 0x55 D (13330) NimBLE: 0xf3 D (13330) NimBLE: 0x90 D (13330) NimBLE: 0xd4 D (13330) NimBLE: 0x14 D (13331) NimBLE: 0xff D (13331) NimBLE: 0x51 D (13331) NimBLE: 0x0c D (13331) NimBLE: 0xa8 D (13331) NimBLE: 0xad D (13331) NimBLE: 0x16 D (13331) NimBLE: 0xd7 D (13331) NimBLE: 0x0e D (13331) NimBLE: 0x27 D (13331) NimBLE: 0x45 D (13331) NimBLE: 0x57 D (13332) NimBLE: 0xb1 D (13332) NimBLE: 0x58 D (13332) NimBLE: 0xdf D (13332) NimBLE: 0x73 D (13332) NimBLE: 0x13 D (13332) NimBLE: 0x34 D (13332) NimBLE: 0xbf D (13332) NimBLE: 0x4a D (13332) NimBLE: 0x06 D (13332) NimBLE: I (13333) NimBLE: GAP procedure initiated: extended advertise; instance=0 D (13333) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0039 len=6 D (13333) NimBLE: 0x39 D (13333) NimBLE: 0x20 D (13333) NimBLE: 0x06 D (13333) NimBLE: 0x01 D (13333) NimBLE: 0x01 D (13334) NimBLE: 0x00 D (13334) NimBLE: 0x00 D (13334) NimBLE: 0x00 D (13334) NimBLE: 0x00 D (13334) NimBLE: D (13591) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (13591) NimBLE: subevent: 0x4 D (13592) NimBLE: D (13592) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x5 D (13592) NimBLE: D (13592) NimBLE: Reattempt connection; reason = 0x3e, status = 0,reattempt count = 0 I (13592) NimBLE: disconnect; reason=574 D (13687) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (13687) NimBLE: subevent: 0xa D (13687) NimBLE: D (13688) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (13688) NimBLE: subevent: 0x14 D (13688) NimBLE: D (13688) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (13688) NimBLE: subevent: 0x12 D (13688) NimBLE: I (13688) NimBLE: connection established; status=0 D (13689) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2 D (13689) NimBLE: 0x16 D (13689) NimBLE: 0x20 D (13689) NimBLE: 0x02 D (13689) NimBLE: 0x01 D (13689) NimBLE: 0x00 D (13689) NimBLE: I (13690) NimBLE: advertise complete; reason=0 D (13690) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0036 len=25 D (13690) NimBLE: 0x36 D (13690) NimBLE: 0x20 D (13690) NimBLE: 0x19 D (13690) NimBLE: 0x00 D (13690) NimBLE: 0x01 D (13691) NimBLE: 0x00 D (13691) NimBLE: 0x30 D (13691) NimBLE: 0x00 D (13691) NimBLE: 0x00 D (13691) NimBLE: 0x30 D (13691) NimBLE: 0x00 D (13691) NimBLE: 0x00 D (13691) NimBLE: 0x07 D (13691) NimBLE: 0x00 D (13691) NimBLE: 0x00 D (13691) NimBLE: 0x00 D (13691) NimBLE: 0x00 D (13692) NimBLE: 0x00 D (13692) NimBLE: 0x00 D (13692) NimBLE: 0x00 D (13692) NimBLE: 0x00 D (13692) NimBLE: 0x00 D (13692) NimBLE: 0x00 D (13692) NimBLE: 0x01 D (13692) NimBLE: 0x00 D (13692) NimBLE: 0x02 D (13692) NimBLE: 0x01 D (13692) NimBLE: 0x00 D (13693) NimBLE: D (13693) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0037 len=56 D (13693) NimBLE: 0x37 D (13693) NimBLE: 0x20 D (13693) NimBLE: 0x38 D (13693) NimBLE: 0x00 D (13693) NimBLE: 0x03 D (13694) NimBLE: 0x00 D (13694) NimBLE: 0x34 D (13694) NimBLE: 0x0c D (13694) NimBLE: 0x09 D (13694) NimBLE: 0x49 D (13694) NimBLE: 0x4e D (13694) NimBLE: 0x2d D (13694) NimBLE: 0x54 D (13694) NimBLE: 0x45 D (13694) NimBLE: 0x53 D (13694) NimBLE: 0x54 D (13695) NimBLE: 0x2d D (13695) NimBLE: 0x31 D (13695) NimBLE: 0x2e D (13695) NimBLE: 0x36 D (13695) NimBLE: 0x11 D (13695) NimBLE: 0x07 D (13695) NimBLE: 0x36 D (13695) NimBLE: 0x3a D (13695) NimBLE: 0x33 D (13695) NimBLE: 0x36 D (13695) NimBLE: 0xa2 D (13696) NimBLE: 0x71 D (13696) NimBLE: 0xcb D (13696) NimBLE: 0x88 D (13696) NimBLE: 0x58 D (13696) NimBLE: 0x47 D (13696) NimBLE: 0x96 D (13696) NimBLE: 0xa0 D (13696) NimBLE: 0x55 D (13696) NimBLE: 0xf3 D (13696) NimBLE: 0x90 D (13696) NimBLE: 0xd4 D (13697) NimBLE: 0x14 D (13697) NimBLE: 0xff D (13697) NimBLE: 0x51 D (13697) NimBLE: 0x0c D (13697) NimBLE: 0xa8 D (13697) NimBLE: 0xad D (13697) NimBLE: 0x16 D (13697) NimBLE: 0xd7 D (13697) NimBLE: 0x0e D (13697) NimBLE: 0x27 D (13697) NimBLE: 0x45 D (13698) NimBLE: 0x57 D (13698) NimBLE: 0xb1 D (13698) NimBLE: 0x58 D (13698) NimBLE: 0xdf D (13698) NimBLE: 0x73 D (13698) NimBLE: 0x13 D (13698) NimBLE: 0x34 D (13698) NimBLE: 0xbf D (13698) NimBLE: 0x4a D (13698) NimBLE: 0x06 D (13698) NimBLE: I (13699) NimBLE: GAP procedure initiated: extended advertise; instance=0 D (13699) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0039 len=6 D (13699) NimBLE: 0x39 D (13699) NimBLE: 0x20 D (13699) NimBLE: 0x06 D (13699) NimBLE: 0x01 D (13700) NimBLE: 0x01 D (13700) NimBLE: 0x00 D (13700) NimBLE: 0x00 D (13700) NimBLE: 0x00 D (13700) NimBLE: 0x00 D (13700) NimBLE: D (13957) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (13958) NimBLE: subevent: 0x4 D (13958) NimBLE: D (13958) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x5 D (13958) NimBLE: D (13958) NimBLE: Reattempt connection; reason = 0x3e, status = 0,reattempt count = 0 I (13958) NimBLE: disconnect; reason=574 D (14099) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (14099) NimBLE: subevent: 0xa D (14099) NimBLE: D (14099) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (14099) NimBLE: subevent: 0x14 D (14099) NimBLE: D (14099) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (14099) NimBLE: subevent: 0x12 D (14100) NimBLE: I (14100) NimBLE: connection established; status=0 D (14100) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2 D (14100) NimBLE: 0x16 D (14100) NimBLE: 0x20 D (14100) NimBLE: 0x02 D (14100) NimBLE: 0x01 D (14101) NimBLE: 0x00 D (14101) NimBLE: I (14101) NimBLE: advertise complete; reason=0 D (14101) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0036 len=25 D (14101) NimBLE: 0x36 D (14102) NimBLE: 0x20 D (14102) NimBLE: 0x19 D (14102) NimBLE: 0x00 D (14102) NimBLE: 0x01 D (14102) NimBLE: 0x00 D (14102) NimBLE: 0x30 D (14102) NimBLE: 0x00 D (14102) NimBLE: 0x00 D (14102) NimBLE: 0x30 D (14102) NimBLE: 0x00 D (14102) NimBLE: 0x00 D (14103) NimBLE: 0x07 D (14103) NimBLE: 0x00 D (14103) NimBLE: 0x00 D (14103) NimBLE: 0x00 D (14103) NimBLE: 0x00 D (14103) NimBLE: 0x00 D (14103) NimBLE: 0x00 D (14103) NimBLE: 0x00 D (14103) NimBLE: 0x00 D (14103) NimBLE: 0x00 D (14103) NimBLE: 0x00 D (14104) NimBLE: 0x01 D (14104) NimBLE: 0x00 D (14104) NimBLE: 0x02 D (14104) NimBLE: 0x01 D (14104) NimBLE: 0x00 D (14104) NimBLE: D (14104) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0037 len=56 D (14105) NimBLE: 0x37 D (14105) NimBLE: 0x20 D (14105) NimBLE: 0x38 D (14105) NimBLE: 0x00 D (14105) NimBLE: 0x03 D (14105) NimBLE: 0x00 D (14105) NimBLE: 0x34 D (14105) NimBLE: 0x0c D (14105) NimBLE: 0x09 D (14105) NimBLE: 0x49 D (14105) NimBLE: 0x4e D (14106) NimBLE: 0x2d D (14106) NimBLE: 0x54 D (14106) NimBLE: 0x45 D (14106) NimBLE: 0x53 D (14106) NimBLE: 0x54 D (14106) NimBLE: 0x2d D (14106) NimBLE: 0x31 D (14106) NimBLE: 0x2e D (14106) NimBLE: 0x36 D (14106) NimBLE: 0x11 D (14106) NimBLE: 0x07 D (14107) NimBLE: 0x36 D (14107) NimBLE: 0x3a D (14107) NimBLE: 0x33 D (14107) NimBLE: 0x36 D (14107) NimBLE: 0xa2 D (14107) NimBLE: 0x71 D (14107) NimBLE: 0xcb D (14107) NimBLE: 0x88 D (14107) NimBLE: 0x58 D (14107) NimBLE: 0x47 D (14107) NimBLE: 0x96 D (14108) NimBLE: 0xa0 D (14108) NimBLE: 0x55 D (14108) NimBLE: 0xf3 D (14108) NimBLE: 0x90 D (14108) NimBLE: 0xd4 D (14108) NimBLE: 0x14 D (14108) NimBLE: 0xff D (14108) NimBLE: 0x51 D (14108) NimBLE: 0x0c D (14108) NimBLE: 0xa8 D (14108) NimBLE: 0xad D (14109) NimBLE: 0x16 D (14109) NimBLE: 0xd7 D (14109) NimBLE: 0x0e D (14109) NimBLE: 0x27 D (14109) NimBLE: 0x45 D (14109) NimBLE: 0x57 D (14109) NimBLE: 0xb1 D (14109) NimBLE: 0x58 D (14109) NimBLE: 0xdf D (14109) NimBLE: 0x73 D (14109) NimBLE: 0x13 D (14110) NimBLE: 0x34 D (14110) NimBLE: 0xbf D (14110) NimBLE: 0x4a D (14110) NimBLE: 0x06 D (14110) NimBLE: I (14110) NimBLE: GAP procedure initiated: extended advertise; instance=0 D (14110) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0039 len=6 D (14111) NimBLE: 0x39 D (14111) NimBLE: 0x20 D (14111) NimBLE: 0x06 D (14111) NimBLE: 0x01 D (14111) NimBLE: 0x01 D (14111) NimBLE: 0x00 D (14111) NimBLE: 0x00 D (14111) NimBLE: 0x00 D (14111) NimBLE: 0x00 D (14111) NimBLE: D (14369) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (14369) NimBLE: subevent: 0x4 D (14369) NimBLE: D (14369) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x5 D (14369) NimBLE: D (14369) NimBLE: Reattempt connection; reason = 0x3e, status = 0,reattempt count = 0 I (14370) NimBLE: disconnect; reason=574 D (15299) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (15299) NimBLE: subevent: 0xa D (15299) NimBLE: D (15299) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (15299) NimBLE: subevent: 0x14 D (15299) NimBLE: D (15299) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (15300) NimBLE: subevent: 0x12 D (15300) NimBLE: I (15300) NimBLE: connection established; status=0 D (15300) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2 D (15300) NimBLE: 0x16 D (15300) NimBLE: 0x20 D (15301) NimBLE: 0x02 D (15301) NimBLE: 0x01 D (15301) NimBLE: 0x00 D (15301) NimBLE: I (15301) NimBLE: advertise complete; reason=0 D (15301) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0036 len=25 D (15302) NimBLE: 0x36 D (15302) NimBLE: 0x20 D (15302) NimBLE: 0x19 D (15302) NimBLE: 0x00 D (15302) NimBLE: 0x01 D (15302) NimBLE: 0x00 D (15302) NimBLE: 0x30 D (15302) NimBLE: 0x00 D (15302) NimBLE: 0x00 D (15302) NimBLE: 0x30 D (15302) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x07 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15303) NimBLE: 0x00 D (15304) NimBLE: 0x01 D (15304) NimBLE: 0x00 D (15304) NimBLE: 0x02 D (15304) NimBLE: 0x01 D (15304) NimBLE: 0x00 D (15304) NimBLE: D (15304) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0037 len=56 D (15305) NimBLE: 0x37 D (15305) NimBLE: 0x20 D (15305) NimBLE: 0x38 D (15305) NimBLE: 0x00 D (15305) NimBLE: 0x03 D (15305) NimBLE: 0x00 D (15305) NimBLE: 0x34 D (15305) NimBLE: 0x0c D (15305) NimBLE: 0x09 D (15305) NimBLE: 0x49 D (15305) NimBLE: 0x4e D (15306) NimBLE: 0x2d D (15306) NimBLE: 0x54 D (15306) NimBLE: 0x45 D (15306) NimBLE: 0x53 D (15306) NimBLE: 0x54 D (15306) NimBLE: 0x2d D (15306) NimBLE: 0x31 D (15306) NimBLE: 0x2e D (15306) NimBLE: 0x36 D (15306) NimBLE: 0x11 D (15306) NimBLE: 0x07 D (15307) NimBLE: 0x36 D (15307) NimBLE: 0x3a D (15307) NimBLE: 0x33 D (15307) NimBLE: 0x36 D (15307) NimBLE: 0xa2 D (15307) NimBLE: 0x71 D (15307) NimBLE: 0xcb D (15307) NimBLE: 0x88 D (15307) NimBLE: 0x58 D (15307) NimBLE: 0x47 D (15307) NimBLE: 0x96 D (15308) NimBLE: 0xa0 D (15308) NimBLE: 0x55 D (15308) NimBLE: 0xf3 D (15308) NimBLE: 0x90 D (15308) NimBLE: 0xd4 D (15308) NimBLE: 0x14 D (15308) NimBLE: 0xff D (15308) NimBLE: 0x51 D (15308) NimBLE: 0x0c D (15308) NimBLE: 0xa8 D (15308) NimBLE: 0xad D (15309) NimBLE: 0x16 D (15309) NimBLE: 0xd7 D (15309) NimBLE: 0x0e D (15309) NimBLE: 0x27 D (15309) NimBLE: 0x45 D (15309) NimBLE: 0x57 D (15309) NimBLE: 0xb1 D (15309) NimBLE: 0x58 D (15309) NimBLE: 0xdf D (15309) NimBLE: 0x73 D (15309) NimBLE: 0x13 D (15310) NimBLE: 0x34 D (15310) NimBLE: 0xbf D (15310) NimBLE: 0x4a D (15310) NimBLE: 0x06 D (15310) NimBLE: I (15310) NimBLE: GAP procedure initiated: extended advertise; instance=0 D (15310) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0039 len=6 D (15311) NimBLE: 0x39 D (15311) NimBLE: 0x20 D (15311) NimBLE: 0x06 D (15311) NimBLE: 0x01 D (15311) NimBLE: 0x01 D (15311) NimBLE: 0x00 D (15311) NimBLE: 0x00 D (15311) NimBLE: 0x00 D (15311) NimBLE: 0x00 D (15311) NimBLE: D (15569) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (15569) NimBLE: subevent: 0x4 D (15569) NimBLE: D (15569) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x5 D (15569) NimBLE: D (15569) NimBLE: Reattempt connection; reason = 0x3e, status = 0,reattempt count = 0 I (15570) NimBLE: disconnect; reason=574 D (15755) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (15755) NimBLE: subevent: 0xa D (15755) NimBLE: D (15755) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (15755) NimBLE: subevent: 0x14 D (15756) NimBLE: D (15756) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (15756) NimBLE: subevent: 0x12 D (15756) NimBLE: I (15756) NimBLE: connection established; status=0 D (15756) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2 D (15757) NimBLE: 0x16 D (15757) NimBLE: 0x20 D (15757) NimBLE: 0x02 D (15757) NimBLE: 0x01 D (15757) NimBLE: 0x00 D (15757) NimBLE: I (15757) NimBLE: advertise complete; reason=0 D (15758) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0036 len=25 D (15758) NimBLE: 0x36 D (15758) NimBLE: 0x20 D (15758) NimBLE: 0x19 D (15758) NimBLE: 0x00 D (15758) NimBLE: 0x01 D (15758) NimBLE: 0x00 D (15758) NimBLE: 0x30 D (15758) NimBLE: 0x00 D (15759) NimBLE: 0x00 D (15759) NimBLE: 0x30 D (15759) NimBLE: 0x00 D (15759) NimBLE: 0x00 D (15759) NimBLE: 0x07 D (15759) NimBLE: 0x00 D (15759) NimBLE: 0x00 D (15759) NimBLE: 0x00 D (15759) NimBLE: 0x00 D (15759) NimBLE: 0x00 D (15759) NimBLE: 0x00 D (15759) NimBLE: 0x00 D (15760) NimBLE: 0x00 D (15760) NimBLE: 0x00 D (15760) NimBLE: 0x00 D (15760) NimBLE: 0x01 D (15760) NimBLE: 0x00 D (15760) NimBLE: 0x02 D (15760) NimBLE: 0x01 D (15760) NimBLE: 0x00 D (15760) NimBLE: D (15761) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0037 len=56 D (15761) NimBLE: 0x37 D (15761) NimBLE: 0x20 D (15761) NimBLE: 0x38 D (15761) NimBLE: 0x00 D (15761) NimBLE: 0x03 D (15761) NimBLE: 0x00 D (15761) NimBLE: 0x34 D (15761) NimBLE: 0x0c D (15762) NimBLE: 0x09 D (15762) NimBLE: 0x49 D (15762) NimBLE: 0x4e D (15762) NimBLE: 0x2d D (15762) NimBLE: 0x54 D (15762) NimBLE: 0x45 D (15762) NimBLE: 0x53 D (15762) NimBLE: 0x54 D (15762) NimBLE: 0x2d D (15762) NimBLE: 0x31 D (15762) NimBLE: 0x2e D (15762) NimBLE: 0x36 D (15763) NimBLE: 0x11 D (15763) NimBLE: 0x07 D (15763) NimBLE: 0x36 D (15763) NimBLE: 0x3a D (15763) NimBLE: 0x33 D (15763) NimBLE: 0x36 D (15763) NimBLE: 0xa2 D (15763) NimBLE: 0x71 D (15763) NimBLE: 0xcb D (15763) NimBLE: 0x88 D (15763) NimBLE: 0x58 D (15764) NimBLE: 0x47 D (15764) NimBLE: 0x96 D (15764) NimBLE: 0xa0 D (15764) NimBLE: 0x55 D (15764) NimBLE: 0xf3 D (15764) NimBLE: 0x90 D (15764) NimBLE: 0xd4 D (15764) NimBLE: 0x14 D (15764) NimBLE: 0xff D (15764) NimBLE: 0x51 D (15764) NimBLE: 0x0c D (15765) NimBLE: 0xa8 D (15765) NimBLE: 0xad D (15765) NimBLE: 0x16 D (15765) NimBLE: 0xd7 D (15765) NimBLE: 0x0e D (15765) NimBLE: 0x27 D (15765) NimBLE: 0x45 D (15765) NimBLE: 0x57 D (15765) NimBLE: 0xb1 D (15765) NimBLE: 0x58 D (15765) NimBLE: 0xdf D (15766) NimBLE: 0x73 D (15766) NimBLE: 0x13 D (15766) NimBLE: 0x34 D (15766) NimBLE: 0xbf D (15766) NimBLE: 0x4a D (15766) NimBLE: 0x06 D (15766) NimBLE: I (15766) NimBLE: GAP procedure initiated: extended advertise; instance=0 D (15767) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0039 len=6 D (15767) NimBLE: 0x39 D (15767) NimBLE: 0x20 D (15767) NimBLE: 0x06 D (15767) NimBLE: 0x01 D (15767) NimBLE: 0x01 D (15767) NimBLE: 0x00 D (15767) NimBLE: 0x00 D (15767) NimBLE: 0x00 D (15768) NimBLE: 0x00 D (15768) NimBLE: D (16025) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (16025) NimBLE: subevent: 0x4 D (16025) NimBLE: D (16026) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x5 D (16026) NimBLE: D (16026) NimBLE: Reattempt connection; reason = 0x3e, status = 0,reattempt count = 0 I (16026) NimBLE: disconnect; reason=574 D (16076) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (16076) NimBLE: subevent: 0xa D (16076) NimBLE: D (16076) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (16076) NimBLE: subevent: 0x14 D (16077) NimBLE: D (16077) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (16077) NimBLE: subevent: 0x12 D (16077) NimBLE: I (16077) NimBLE: connection established; status=0 D (16077) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2 D (16078) NimBLE: 0x16 D (16078) NimBLE: 0x20 D (16078) NimBLE: 0x02 D (16078) NimBLE: 0x01 D (16078) NimBLE: 0x00 D (16078) NimBLE: I (16078) NimBLE: advertise complete; reason=0 D (16079) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0036 len=25 D (16079) NimBLE: 0x36 D (16079) NimBLE: 0x20 D (16079) NimBLE: 0x19 D (16079) NimBLE: 0x00 D (16079) NimBLE: 0x01 D (16079) NimBLE: 0x00 D (16079) NimBLE: 0x30 D (16079) NimBLE: 0x00 D (16080) NimBLE: 0x00 D (16080) NimBLE: 0x30 D (16080) NimBLE: 0x00 D (16080) NimBLE: 0x00 D (16080) NimBLE: 0x07 D (16080) NimBLE: 0x00 D (16080) NimBLE: 0x00 D (16080) NimBLE: 0x00 D (16080) NimBLE: 0x00 D (16080) NimBLE: 0x00 D (16080) NimBLE: 0x00 D (16080) NimBLE: 0x00 D (16081) NimBLE: 0x00 D (16081) NimBLE: 0x00 D (16081) NimBLE: 0x00 D (16081) NimBLE: 0x01 D (16081) NimBLE: 0x00 D (16081) NimBLE: 0x02 D (16081) NimBLE: 0x01 D (16081) NimBLE: 0x00 D (16081) NimBLE: D (16082) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0037 len=56 D (16082) NimBLE: 0x37 D (16082) NimBLE: 0x20 D (16082) NimBLE: 0x38 D (16082) NimBLE: 0x00 D (16082) NimBLE: 0x03 D (16082) NimBLE: 0x00 D (16082) NimBLE: 0x34 D (16082) NimBLE: 0x0c D (16083) NimBLE: 0x09 D (16083) NimBLE: 0x49 D (16083) NimBLE: 0x4e D (16083) NimBLE: 0x2d D (16083) NimBLE: 0x54 D (16083) NimBLE: 0x45 D (16083) NimBLE: 0x53 D (16083) NimBLE: 0x54 D (16083) NimBLE: 0x2d D (16083) NimBLE: 0x31 D (16083) NimBLE: 0x2e D (16083) NimBLE: 0x36 D (16084) NimBLE: 0x11 D (16084) NimBLE: 0x07 D (16084) NimBLE: 0x36 D (16084) NimBLE: 0x3a D (16084) NimBLE: 0x33 D (16084) NimBLE: 0x36 D (16084) NimBLE: 0xa2 D (16084) NimBLE: 0x71 D (16084) NimBLE: 0xcb D (16084) NimBLE: 0x88 D (16084) NimBLE: 0x58 D (16085) NimBLE: 0x47 D (16085) NimBLE: 0x96 D (16085) NimBLE: 0xa0 D (16085) NimBLE: 0x55 D (16085) NimBLE: 0xf3 D (16085) NimBLE: 0x90 D (16085) NimBLE: 0xd4 D (16085) NimBLE: 0x14 D (16085) NimBLE: 0xff D (16085) NimBLE: 0x51 D (16085) NimBLE: 0x0c D (16086) NimBLE: 0xa8 D (16086) NimBLE: 0xad D (16086) NimBLE: 0x16 D (16086) NimBLE: 0xd7 D (16086) NimBLE: 0x0e D (16086) NimBLE: 0x27 D (16086) NimBLE: 0x45 D (16086) NimBLE: 0x57 D (16086) NimBLE: 0xb1 D (16086) NimBLE: 0x58 D (16086) NimBLE: 0xdf D (16087) NimBLE: 0x73 D (16087) NimBLE: 0x13 D (16087) NimBLE: 0x34 D (16087) NimBLE: 0xbf D (16087) NimBLE: 0x4a D (16087) NimBLE: 0x06 D (16087) NimBLE: I (16087) NimBLE: GAP procedure initiated: extended advertise; instance=0 D (16088) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0039 len=6 D (16088) NimBLE: 0x39 D (16088) NimBLE: 0x20 D (16088) NimBLE: 0x06 D (16088) NimBLE: 0x01 D (16088) NimBLE: 0x01 D (16088) NimBLE: 0x00 D (16088) NimBLE: 0x00 D (16088) NimBLE: 0x00 D (16089) NimBLE: 0x00 D (16089) NimBLE: D (16346) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (16346) NimBLE: subevent: 0x4 D (16346) NimBLE: D (16347) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x5 D (16347) NimBLE: D (16347) NimBLE: Reattempt connection; reason = 0x3e, status = 0,reattempt count = 0 I (16347) NimBLE: disconnect; reason=574 D (16381) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (16381) NimBLE: subevent: 0xa D (16381) NimBLE: D (16381) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (16381) NimBLE: subevent: 0x14 D (16381) NimBLE: D (16382) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (16382) NimBLE: subevent: 0x12 D (16382) NimBLE: I (16382) NimBLE: connection established; status=0 D (16382) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2 D (16382) NimBLE: 0x16 D (16382) NimBLE: 0x20 D (16383) NimBLE: 0x02 D (16383) NimBLE: 0x01 D (16383) NimBLE: 0x00 D (16383) NimBLE: I (16383) NimBLE: advertise complete; reason=0 D (16383) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0036 len=25 D (16384) NimBLE: 0x36 D (16384) NimBLE: 0x20 D (16384) NimBLE: 0x19 D (16384) NimBLE: 0x00 D (16384) NimBLE: 0x01 D (16384) NimBLE: 0x00 D (16384) NimBLE: 0x30 D (16384) NimBLE: 0x00 D (16384) NimBLE: 0x00 D (16384) NimBLE: 0x30 D (16385) NimBLE: 0x00 D (16385) NimBLE: 0x00 D (16385) NimBLE: 0x07 D (16385) NimBLE: 0x00 D (16385) NimBLE: 0x00 D (16385) NimBLE: 0x00 D (16385) NimBLE: 0x00 D (16385) NimBLE: 0x00 D (16385) NimBLE: 0x00 D (16385) NimBLE: 0x00 D (16385) NimBLE: 0x00 D (16386) NimBLE: 0x00 D (16386) NimBLE: 0x00 D (16386) NimBLE: 0x01 D (16386) NimBLE: 0x00 D (16386) NimBLE: 0x02 D (16386) NimBLE: 0x01 D (16386) NimBLE: 0x00 D (16386) NimBLE: D (16386) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0037 len=56 D (16387) NimBLE: 0x37 D (16387) NimBLE: 0x20 D (16387) NimBLE: 0x38 D (16387) NimBLE: 0x00 D (16387) NimBLE: 0x03 D (16387) NimBLE: 0x00 D (16387) NimBLE: 0x34 D (16387) NimBLE: 0x0c D (16387) NimBLE: 0x09 D (16387) NimBLE: 0x49 D (16388) NimBLE: 0x4e D (16388) NimBLE: 0x2d D (16388) NimBLE: 0x54 D (16388) NimBLE: 0x45 D (16388) NimBLE: 0x53 D (16388) NimBLE: 0x54 D (16388) NimBLE: 0x2d D (16388) NimBLE: 0x31 D (16388) NimBLE: 0x2e D (16388) NimBLE: 0x36 D (16388) NimBLE: 0x11 D (16389) NimBLE: 0x07 D (16389) NimBLE: 0x36 D (16389) NimBLE: 0x3a D (16389) NimBLE: 0x33 D (16389) NimBLE: 0x36 D (16389) NimBLE: 0xa2 D (16389) NimBLE: 0x71 D (16389) NimBLE: 0xcb D (16389) NimBLE: 0x88 D (16389) NimBLE: 0x58 D (16389) NimBLE: 0x47 D (16390) NimBLE: 0x96 D (16390) NimBLE: 0xa0 D (16390) NimBLE: 0x55 D (16390) NimBLE: 0xf3 D (16390) NimBLE: 0x90 D (16390) NimBLE: 0xd4 D (16390) NimBLE: 0x14 D (16390) NimBLE: 0xff D (16390) NimBLE: 0x51 D (16390) NimBLE: 0x0c D (16390) NimBLE: 0xa8 D (16391) NimBLE: 0xad D (16391) NimBLE: 0x16 D (16391) NimBLE: 0xd7 D (16391) NimBLE: 0x0e D (16391) NimBLE: 0x27 D (16391) NimBLE: 0x45 D (16391) NimBLE: 0x57 D (16391) NimBLE: 0xb1 D (16391) NimBLE: 0x58 D (16391) NimBLE: 0xdf D (16391) NimBLE: 0x73 D (16392) NimBLE: 0x13 D (16392) NimBLE: 0x34 D (16392) NimBLE: 0xbf D (16392) NimBLE: 0x4a D (16392) NimBLE: 0x06 D (16392) NimBLE: I (16392) NimBLE: GAP procedure initiated: extended advertise; instance=0 D (16393) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0039 len=6 D (16393) NimBLE: 0x39 D (16393) NimBLE: 0x20 D (16393) NimBLE: 0x06 D (16393) NimBLE: 0x01 D (16393) NimBLE: 0x01 D (16393) NimBLE: 0x00 D (16393) NimBLE: 0x00 D (16393) NimBLE: 0x00 D (16393) NimBLE: 0x00 D (16394) NimBLE: D (16651) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x3e D (16651) NimBLE: subevent: 0x4 D (16651) NimBLE: D (16651) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x5 D (16652) NimBLE: D (16652) NimBLE: Reattempt connection; reason = 0x3e, status = 0,reattempt count = 0 I (16652) NimBLE: disconnect; reason=574 ```
Massimiliano-solutiontech commented 7 months ago

@luomanruo v5.2.1 doesn't solve the issue

Massimiliano-solutiontech commented 7 months ago

@luomanruo by disabling the extended advertising the connection is successful

zhaoweiliang2021 commented 7 months ago

@Massimiliano-solutiontech Hi, We have reproduced this issue under the following conditions: iOS version: 17.3.1 Application: nRF Connect Apk.

We captured the air interface information and found that the problem was actually a problem with the 17.3.1 iOS version. The reason is that the iPhone did not continue TX LL data within the 28.75-32.5ms time range after sending the AUX_CONNECT_REQ PDU, and did not send data packets in the subsequent interval, which caused the slave disconnected with 0x3e reason. We checked the correctness and sending time of the aux_conn_rsp pdu responded by the ESP32C6 chip, and its behavior complies with the Bluetooth Spec requirements. So we believe this is an issue on this version of iOS. image

zhaoweiliang2021 commented 7 months ago

@Massimiliano-solutiontech Since there are currently no Motorola G14 (Android 13) phone for retesting, the cause of this problem cannot be known for the time being. We have not reproduced it using other mobile phones, so I would like to ask if you can provide the air interface information of this problem? According to the debug log you provided, the reason for the failure is still 0x3e.

Massimiliano-solutiontech commented 7 months ago

@zhaoweiliang2021 what kind of tool are you using? Since I haven’t anything to debug Bluetooth I have to buy it

Thanks

Massimiliano-solutiontech commented 7 months ago

@zhaoweiliang2021 since it’s a timing problem, at least on iOS, can I adjust that range (28.75-32.5ms) in esp-idf?

zhaoweiliang2021 commented 7 months ago

@Massimiliano-solutiontech The device I used is an Ellisys Vanguard Bluetooth Protocol Analyzer. There are other devices on the market that can capture over-the-air packet information, such as the Frontline X240 Wireless Protocol Analyzer, Frontline Sodera, and other Bluetooth protocol analyzers. You can decide whether to buy based on the function description.

zhaoweiliang2021 commented 7 months ago

@Massimiliano-solutiontech Hi, This time range is determined by aux_connect_req, which is determined by the iPhone, so we cannot adjust it in esp-idf and need to wait for the new ios version to fix it.

Massimiliano-solutiontech commented 7 months ago

@zhaoweiliang2021 thanks I'll look into those tools. As of now there is a workaround? The phones with these issue are increasing. The only reason why I'm using Bluetooth 5.0 is for the EXT ADV the 31 bytes of the 4.1 are too small for my purposes (I need to advertise the service UUID, name (variable min 10 max 15), VID and another UUID as PID)

Massimiliano-solutiontech commented 7 months ago

@zhaoweiliang2021, I will attend the Embedded World Fair from April 9th through April 11th. Can we arrange a one-on-one session with you or some of your colleagues?

Thanks.

zhaoweiliang2021 commented 7 months ago

@Massimiliano-solutiontech According to the application description and later expansion, using 5.0 adv is indeed the best solution, but some old mobile phones do not support 5.0 adv, or new versions of mobile phones may have some compatibility issues. For your application scenario, a workaround solution is provided for your reference: On the basis of using 5.0 adv, add an additional legacy adv, and put the address information of the legacy adv in the 5.0 adv data. Based on the scanned address information, the mobile phone establishes a connection with the legacy adv of the corresponding address if the filtering conditions are met. If the connection is successful, stop 5.0 adv.

zhaoweiliang2021 commented 7 months ago

@Massimiliano-solutiontech Kindly reach out to sales@espressif.com via email. Our sales team will get in touch with you as soon as possible.

Massimiliano-solutiontech commented 7 months ago

@zhaoweiliang2021 thanks for the fast reply and the comprehensive support that you are giving to me, I wrote an email to the sales (let's wait). I took a look on the tools that you suggested and are quite expensive to just address a bug, what about the HackRF One R9? Also I wrote a sample iOS app and I can successfully connect to the ESP32-C6 using the EXT ADV (I don't know why though) but the nRF Connect still not working Regarding the Motorola G14 even with a custom app I can't connect to it

On the basis of using 5.0 adv, add an additional legacy adv, and put the address information of the legacy adv in the 5.0 adv data. Based on the scanned address information, the mobile phone establishes a connection with the legacy adv of the corresponding address if the filtering conditions are met. If the connection is successful, stop 5.0 adv.

I don't know how to do that, can you provide me a code example starting from the bleprh example?

lisir233 commented 7 months ago

Hi, @Massimiliano-solutiontech please refer to this patch for modification, in this patch I added an additional legacy adv, and put the address information of the legacy adv in the 5.0 adv data. bleprph_multi_adv.patch.If you have any questions, feel free to leave a comment!

Massimiliano-solutiontech commented 6 months ago

@lisir233 by doing so I'm limited to 31 bytes of adv data. I don't understand if this whole issue is related to Apple and some Android vendors or to the esp Bluetooth stack. I need to solve this as soon as possibile, I have IoT products that can't be configured

lisir233 commented 6 months ago

Hi, @Massimiliano-solutiontech Analyzing the packet capture data, we believe this is an IOS 17.1.2 issue. We have also reproduced this issue when connecting to IOS devices using other BLE chips, so all we can do is try to turn on an additional legacy adv to bypass this issue.Can you tell more details about the application? For example, is it necessary to send more than 31 bytes of ADV data in the application scenario?

Massimiliano-solutiontech commented 6 months ago

@lisir233 thanks for the quick reply, I'm also facing issues with iOS 16.7. Yes I need more than 31 bytes, currently I'm advertising:

  1. device name (10 to 11 chars)
  2. 128 bit service uuid
  3. manufacturer data
    1. device family 128 bit uuid
    2. 1 byte representing the firmware version code
    3. 2 bytes for the Bluetooth vendor id
lisir233 commented 6 months ago

Thank you for your answer, in the above provided example, we can put the broadcast data in the 5.0 ADV, the 5.0 ADV can put up to 1650 bytes of data, the 4.2 legacy ADV is only used to establish a connection with the Iphone.

Massimiliano-solutiontech commented 6 months ago

@lisir233 I tried to put more data in connectable_legacy_adv_pattern but then an assert is failing. Where I’m supposed to put that data?

Massimiliano-solutiontech commented 5 months ago

Hi @lisir233 can you give me the hint to solve the issue of the above comment? Thanks

lisir233 commented 5 months ago

HI, @Massimiliano-solutiontech due to the limitations of the Bluetooth specification, legacy ADV packets can only carry a maximum of 32 bytes of data, if you need to include more than 31 bytes of data in a broadcast packet, please use the 5.0 ADV, which can be configured in the nimble stack using the API ble_gap_ext_adv_configure interface. With the above multi-broadcast example, we can finally realize the following effect: ESP32 initiates both an extended ADV and a legacy ADV . The extended ADV is used to carry the data and the legacy ADV is used to establish a connection.

zhaoweiliang2021 commented 5 months ago

@Massimiliano-solutiontech Hi, Thank you for providing the motorola G14 phone for us to reproduce the issue. motorola G14(android 13)

We captured the air interface information and found that the problem is a Bluetooth issue on the Motorola G14 phone. The reason is that after sending the AUX_CONNECT_REQ PDU, the iPhone did not continue to send TX LL data within the 17.5ms to 22.5ms time range and did not send data packets in the subsequent interval, causing the slave to disconnect with reason 0x3e. We checked the correctness and sending time of the aux_conn_rsp pdu responded by the ESP32C6 chip, and its behavior complies with the Bluetooth Spec requirements. Therefore, we believe this is an issue with the Motorola phone. The solution for the BLE 5.0 connection issue on the Motorola G14 phone is the same as the solution provided earlier for the iOS (17.3) connection issue.

Massimiliano-solutiontech commented 5 months ago

@zhaoweiliang2021 It’s a pleasure to help you, the community, and Espressif to make even better products. Thanks also for the detailed explanation. I understand that it’s not a problem with the ESP-IDF Bluetooth stack, but right now I have several customers facing this issue. Is it possible to create a patch with an option to make the ESP more tolerant of timing issues? Is it also possible to contact vendors like Motorola, Lenovo, Apple, and Samsung to inform them of the issue with their stack?

It’s very important for us to resolve this, as we sell worldwide more than 60k products per year, all powered by your chips

(we can continue this discussion via email if you prefer)

Thanks for understanding

zhaoweiliang2021 commented 5 months ago

@Massimiliano-solutiontech Does the example my colleague provided earlier work for you? We believe it is the quickest way to bypass this issue. If it does not meet your needs, could you provide more specific requirements for the patch you want? This will help us review and evaluate it further.

Massimiliano-solutiontech commented 4 months ago

@zhaoweiliang2021 unfortunately not, I need to put more than 32 bytes in the adv data. I would like to know if it’s possibile to have a patch in which the esp-idf Bluetooth stack doesn’t respect the correct timings (so the phones with bad Bluetooth implementation can connect too). Of course it must be an opt-in option. I don’t have such experience with Bluetooth so please suggest me what’s the best way to solve this

zhaoweiliang2021 commented 4 months ago

@Massimiliano-solutiontech Hi,

  1. "I would like to know if it’s possibile to have a patch in which the esp-idf Bluetooth stack doesn’t respect the correct timings (so the phones with bad Bluetooth implementation can connect too). " Since the phone acts as the central role and has the initiative, the chip cannot affect the behavior of the phone by modifying its own behavior, so we cannot provide the patch you want.

  2. I don’t have such experience with Bluetooth so please suggest me what’s the best way to solve this For your use case, the previously provided patch demonstrates how to place data into a 5.0 advertisement while still using legacy advertising for the connection. This indirect method aims to resolve the phone connection issue. Does the provided patch still not meet your requirements? If so, could you further explain the reasons?