-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Device is not persisting configured number of bonds #296
Comments
Just an idea, maybe adding a callback to check store status could provide some insight? Does it make any difference if you change max bonds/ccds to a higher value like 16? |
You may have had an old bond still stored, try erasing the flash and start again. |
Supposing this is the case, I would expect that the stale bonds get deleted first. When I start repairing the other devices I can see one of the other devices becomes unpaired. I can keep doing this and cycling through only 3 devices being paired. |
I have max bonds/ccds set to 8 now, no difference. Still only able to maintain 3 pairs. I tried checking out your store status branch. After working around a compile error (the storage for the default store status callbacks is not allocated leading to linker error), I noticed that when attempting to repair a device for which the encryption key was lost, the store status callback with the |
Interesting, thanks for testing. I've seen my esp32's go beyond 3 bonds, strange that you are having an issue with it. FWIW here's where the event is originating Also forgot some documentation in my PR, but the callback should return either 0 or 1.
|
Doing some more testing.. I was able to pair all 4 after erasing the flash. I'm not sure why that step was necessary though or if I will run into this issue again at some later time. I question the logic for deciding when/how keys in NVS get replaced.
Yeah no errors were getting emitted, at least at my configured WARN level or higher. That explains that problem then, I was returning 0 so that probably just resulted in an infinite loop/undefined behavior. |
Stupid question: you had already tried calling |
No, I have not. TBH I didn't know that function even existed. Unfortunately now that I have erased the flash, I'm no longer able to currently reproduce the problem. I think I will close this issue and reopen if the issue comes up again at some later time. |
Not sure if this is the right place to post this issue.. but I have a device with which I am bonding multiple devices. I have enabled
CONFIG_BT_NIMBLE_NVS_PERSIST
and configuredCONFIG_BT_NIMBLE_MAX_BONDS
to 5, but it appears that when bonding a 4th device the ESP32 loses the encryption key of one of the other 3 devices and I must repair it. So it appears I can only maintain 3 encryption keys in NVS. Any idea what I could be doing wrong or is this a bug?The text was updated successfully, but these errors were encountered: