Skip to content

Bonded clients do not work when switching from 1.4.2 to 2.0.0 or vice versa #740

Open
@KlausMu

Description

@KlausMu

I am using NimBLE with an ESP32. It seems the way bonded clients are stored in NVS changed from NimBLE 1.4.2 to 2.0.0.

Going from 1.4.2 to 2.0.0
In 2.0.0, I can connect to an already bonded peer (which was bonded in 1.4.2). Even direct advertisement works (see #651)
But when sending data, the result is

D NimBLECharacteristic: >> sendValue
D NimBLECharacteristic: << sendValue: No clients subscribed.
D NimBLECharacteristic: >> sendValue
D NimBLECharacteristic: << sendValue: No clients subscribed.

Normally, in version 1.4.2, when sending data, there is something like

D NimBLECharacteristic: >> setValue: length=8, data=0000510000000000, characteristic UUID=0x2a4d
D NimBLECharacteristic: << setValue
D NimBLECharacteristic: >> notify: length: 8
D NimBLECharacteristicCallbacks: onNotify: default
D NimBLEServer: >> handleGapEvent:
D NimBLECharacteristicCallbacks: onStatus: default
D NimBLECharacteristic: << notify
D NimBLECharacteristic: >> setValue: length=8, data=0000000000000000, characteristic UUID=0x2a4d
D NimBLECharacteristic: << setValue
D NimBLECharacteristic: >> notify: length: 8
D NimBLECharacteristicCallbacks: onNotify: default
D NimBLEServer: >> handleGapEvent:
D NimBLECharacteristicCallbacks: onStatus: default
D NimBLECharacteristic: << notify

As a result, I have to delete all bonds in 2.0.0 and to repair them. From that on, everything works as expected.

Going from 2.0.0 to 1.4.2
When going back from 2.0.0 to 1.4.2, the software crashes at

void NimBLEDevice::init(const std::string &deviceName) {
  ble_store_config_init();

If there was no bonded peer in 2.0.0, going back to 1.4.2 works without problem.

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