NimBLE-Arduino: Connection failing with status=574 on ESP32-WROOM-32E

Hi,

I am experiencing a strange issue where I am unable to connect to a device with my ESP32-WROOM-32E that I am able to connect to with a ESP-WROOM-32 board. Both have the exact same arduino sketch uploaded, but the below is the output log from when I attempt to connect using the 32E.

D NimBLEScan: "discovery complete; reason=0"
D NimBLEClient: ">> connect(fa:b4:7c:f8:ba:a1)"
D NimBLEClient: "Got Client event "
I NimBLEClient: "Connected event"
lld_pdu_get_tx_flush_nb HCI packet count mismatch (1, 2)
D NimBLEClient: "Got Client event "
E NimBLEClient: "Connection failed; status=574 "
D NimBLEScan: ">> stop()"
D NimBLEScan: "<< stop()"
D NimBLEClient: ">> disconnect()"
D NimBLEClient: "Not connected to any peers"
D NimBLEClient: "<< disconnect()"

My BLE setup is:

  BLEDevice::init("");
  BLEScan* pBLEScan = BLEDevice::getScan();
  pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
  pBLEScan->setInterval(45);
  pBLEScan->setWindow(15);
  BLEDevice::setSecurityAuth(true, true, true);
  BLEDevice::setPower(ESP_PWR_LVL_P9);
  pBLEScan->setActiveScan(true);
  pBLEScan->start(5);

And my connection code is:

 pClient = NimBLEDevice::createClient();
 pClient->setClientCallbacks(&clientCB);
 pClient->setConnectionParams(32, 160, 0, 500);
 pClient->setConnectTimeout(5);
 pClient->connect(advDevice);

Is there a bug with the 32E that may be causing this? Or specific settings for this module?

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

I found that esp32 needs setOwnAddrType to be set for the gopro to connect successfully. Otherwise gopro “forgets” esp32 after disconnection.

I don’t know the exact settings yet. If you reset the gopro network settings and setOwnAddrType(BLE_OWN_ADDR_RANDOM); then the ESP32 at least can connect and power on the gopro.

I discovered this a few hours ago, so I keep experimenting.