Skip to content

Wi-Fi + BLE resulting in BLE disconnections from iOS after some amount of time (but not a Linux computer) #313

@cmorganBE

Description

@cmorganBE

esp32s3, esp-idf v5.3, esp-nimble-cpp 63a3301 (Add missing const in NimblEConnInfo).

I'm not suggesting this is an esp-nimble-cpp issue but I'm also not sure what to do next in terms of how to gather the next piece of information.

What I'm seeing:

  • Wi-Fi connected
  • Connect with BLE (iOS + lightblue), pair and bond
  • Retrieve some characteristics, works fine
  • Sit for a minute or two
  • BLE disconnected

It's possible to reconnect as soon as the disconnection occurs, the same thing happens after this reconnection, after a few minutes.

If I connect with a Linux PC I can transfer megabytes of data without disconnection (and with Wi-Fi connected), so it looks like this is something related to iOS but I'm wondering if its a timeout setting or something on the connection that can be configured.

Tried to look at 'NimBLE' output via 'log_level NimBLE debug', and I see this when the disconnection occurs:

no new log output here until BLE disconnects, then the below happens

D (2006502) NimBLE: ble_hs_event_rx_hci_ev; opcode=0x5 
D (2006502) NimBLE: 

I (2006502) BLE: Client disconnected
I (2006502) NimBLE: GAP procedure initiated: advertise; 
I (2006502) NimBLE: disc_mode=2
I (2006502) NimBLE:  adv_channel_map=0 own_addr_type=0 adv_filter_policy=2 adv_itvl_min=0 adv_itvl_max=0
I (2006502) NimBLE: 

D (2006502) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0006 len=15

D (2006502) NimBLE: 0x06 
D (2006502) NimBLE: 0x20 
D (2006502) NimBLE: 0x0f 
D (2006502) NimBLE: 0x30 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x60 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x00 
D (2006502) NimBLE: 0x07 
D (2006502) NimBLE: 0x02 
D (2006502) NimBLE: 

D (2006502) NimBLE: ble_hs_hci_cmd_send: ogf=0x08 ocf=0x000a len=1

D (2006502) NimBLE: 0x0a 
D (2006502) NimBLE: 0x20 
D (2006502) NimBLE: 0x01 
D (2006502) NimBLE: 0x01 
D (2006502) NimBLE: 

I (2006512) EESystem: BLE lastState (3) != state (0)
I (2006512) EESystem: BleRestricted

Thoughts on how to gather the data to debug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions