Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KlausMu opened this issue Nov 2, 2024 · 1 comment

Comments

@KlausMu
Copy link

KlausMu commented Nov 2, 2024

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.

@h2zero
Copy link
Owner

h2zero commented Nov 3, 2024

It appears this may be a result of upstream changes in the way the data is stored in NVS, I haven't identified the changes yet but it may just have to be another part of the breaking changes coming with 2.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants