NimBLE-Arduino: CRIT NimBLEDevice: "Resetting state; reason=19, " failed to configure restored IRK

Using Android IDE, custom board w/EPS32, 1.0.6 core. Connecting via an iPhone app.

The first time Bluetooth connects to iPhone, it works without issue:

D NimBLECharacteristic: "<< notify"
D NimBLECharacteristic: ">> setValue: length=1, data=63, characteristic UUID=6e400003-b5a3-f393-e0a9-e50e24dcca9e"
D NimBLECharacteristic: "<< setValue"
D NimBLECharacteristic: ">> notify: length: 1"
D NimBLECharacteristicCallbacks: "onNotify: default"
D NimBLEServer: ">> handleGapEvent: "
D NimBLECharacteristicCallbacks: "onStatus: default"
D NimBLECharacteristic: "<< notify"
D NimBLEServer: ">> handleGapEvent: "
I NimBLEServer: "subscribe event; attr_handle=12, subscribed: false"
I NimBLECharacteristic: "New subscribe value for conn: 0 val: 0"
D NimBLECharacteristicCallbacks: "onSubscribe: default"
D NimBLEServer: ">> handleGapEvent: "
I NimBLEServer: "subscribe event; attr_handle=8, subscribed: false"
D NimBLEServer: ">> handleGapEvent: "

I then disconnect BLE from iPhone app:

D NimBLEServerCallbacks: "onDisconnect(): Default"
D NimBLEAdvertising: ">> Advertising start: customAdvData: 0, customScanResponseData: 0"
W NimBLEAdvertising: "Advertising already active"
D NimBLEServer: ">> handleGapEvent: "

I then try to reconnect to BLE, spinning icon, never connects, and I get this:

D NimBLEAdvertising: ">> Advertising start: customAdvData: 0, customScanResponseData: 0"
D NimBLEAdvertising: "<< Advertising start"
D NimBLEServerCallbacks: "onConnect(): Default"
D NimBLEServer: ">> handleGapEvent: "
CRIT NimBLEServer: "Disconnect - host reset, rc=19"
CRIT NimBLEDevice: "Resetting state; reason=19, "
D NimBLEServerCallbacks: "onDisconnect(): Default"
D NimBLEAdvertising: ">> Advertising start: customAdvData: 0, customScanResponseData: 0"
E NimBLEAdvertising: "Host reset, wait for sync."
D NimBLEServer: ">> handleGapEvent: "
D NimBLEServer: "Advertising Complete"
failed to configure restored IRK
failed to configure restored IRK
failed to configure restored IRK
I NimBLEDevice: "NimBle host synced."
D NimBLEAdvertising: "Host re-synced"
D NimBLEAdvertising: ">> Advertising start: customAdvData: 0, customScanResponseData: 0"
D NimBLEAdvertising: "<< Advertising start"

Any idea on what is going on here?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

I found the fix to it.

In nimconfig.h, changed to these settings:

 #define CONFIG_BT_NIMBLE_MAX_CONNECTIONS 7
 #define CONFIG_BT_NIMBLE_MAX_BONDS 7

Even though I was allowing 9 connections, it refused to connect because it wouldn’t save additional bonds. So also had to increase max bonds.

As it’s impossible to have more possible simultaneous encrypted connections than possible saved bonds, perhaps the library should use CONFIG_BT_NIMBLE_MAX_CONNECTIONS as MIN_BONDS?