Heres my ble initialization code:
Code: Select all
err = nimble_port_init();
if (err != ESP_OK) {
ESP_LOGE("BLE", "nimble_port_init() failed with error: %d", err);
return;
}
ble_hs_cfg.reset_cb = bleprph_on_reset;
ble_hs_cfg.sync_cb = bleprph_on_sync;
ble_hs_cfg.gatts_register_cb = gatt_svr_register_cb;
ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
ble_hs_cfg.sm_io_cap = BLE_SM_IO_CAP_NO_IO;
ble_hs_cfg.sm_sc = 0;
rc = bleuart_gatt_svr_init();
rc = ble_svc_gap_device_name_set(nameble);
assert(rc == 0);
nimble_port_freertos_init(ble_host_task);
delay(100);
Heres a log I've saved from a disconnect:
Code: Select all
I (21643) BOOT: OTA initialized
I (48003) BLE: RX 15 bytes
I (48303) BOOT: Incoming 562048 bytes from the app, in 2342 packets
I (48993) BLE: RX 15 bytes
I (49303) BLE_app: tx 1 bytes
I (50393) BLE_app: >> BLE_GAP_EVENT_SUBSCRIBE
I (50393) BLE_app: subscribe event; conn_handle=0 attr_handle=8 reason=2 prevn=1 curn=0 previ=0 curi=0
I (50403) BLE_app:
I (50403) BLE_app: >> BLE_GAP_EVENT_DISCONNECT
I (50413) BLE_app: disconnect; reason=520
The code was initially written in ESP IDF 4.4.4 and later migrated to 5.2.2
The mobile application was developed using the flutter_reactive_ble library.
The IOS devices used were: iPhone 11 and iPhone 8 plus
Various android devices were used, none having the same problem as the iPhones.
Has anyone experienced similar problems?