-
Notifications
You must be signed in to change notification settings - Fork 51
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
ESP32/nimble forgets BLE pairing connection to Android client (nasty 'fix' attached) #16
Comments
cc @bfriedkin - just in case you also encounter this. |
Thank you for keeping me in the loop. I haven't seen what you describe (most of my testing has been on iPhone), but it is good to know about this nonetheless. Regards, |
@geeksville Can you please share for which Android device did you test ? If possible can you please share any simple steps to follow which can help me reproduce the issue ? From your description, it looks to be kind of very interesting scenario. The reason |
Hi Prasad,
I suspect it might be related to my particular use case. For our device we
frequently have the esp32 enter light-sleep (after a few minutes with no
comms needed to phone). So to prepare for that we fully (?) teardown the
Nimble BLE stack - so that BLE is off. And then when the device comes back
we start nimble back up. On some devices (the oldest ones?) this problem
started to happen. Alas, I'm moving to Taiwan soon and my computers are
now mostly packed away. Once my mini lab is going again (Approx Oct 5th)
I'll happily try to collect the information you requested (and try to
isolate the problem a bit more).
…On Tue, Sep 22, 2020 at 9:21 AM Prasad Alatkar ***@***.***> wrote:
@geeksville <https://github.com/geeksville> Can you please share for
which Android device did you test ? If possible can you please share any
simple steps to follow which can help me reproduce the issue ? From your
description, it looks to be kind of very interesting scenario. The reason
ble_hs_is_on_resolv_list returns BLE_HS_EINVAL because
ble_hs_resolv_list_add is called for peer already existing in Resolving
list i.e. IRK already present with our device. However if I am right with
my first cut analysis regarding the issue then we may have to look for
better fix than commenting out that section of code :) Can you please
provide me debug logs for the issue with attached NimBLE submodule patch :
NimBLE_forgets_bonded_peers_check_IRK_changed.txt
<https://github.com/espressif/esp-nimble/files/5262732/NimBLE_forgets_bonded_peers_check_IRK_changed.txt>
? You may need to apply the patch at
$IDF_PATH/components/bt/host/nimble/nimble. You may need to enable debug
logs from menuconfig i.e. make menuconfig --> Component Config --> Log
output --> Default log verbosity to Debug.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABXB2JJAKNJZSXRAQOVJFTSHDFHNANCNFSM4RDJFSFQ>
.
|
Thanks @geeksville , meanwhile I will try to catch the issue myself. |
Hi @geeksville I tried to reproduce the issue with some forced setup. Though I was able to get the error prints ( |
Hi, Just deleting all peers with ble_store_util_delete_peer() did not resolve the problem! Hope this helps, |
Hi @sicanins apologies for very delayed response, as I understand from your reply keeping these error messages as it is (i.e. ignoring them) do no harm, that is what I had mentioned in above reply too. @geeksville , Can you please take a look at my above reply ? If you still face the issue, please try to provide some logs as mentioned earlier. Thanks. |
@prasad-alatkar I have found this issue as well. Steps to reproduce:
@geeksville's patch does indeed correct this issue, which seems to be caused by a mismatch of addresses after the above procedure. |
It has been several months. Has this been fixed yet? |
Hi,
I recently noticed one of my nodes was discarding formerly working ble bonded connections to my Android phone. This failure occurred after the following error message/clue was emitted in the logs "failed to configure restored IRK". Searching for that string and then adding some debugging led me to the following lines in ble_hs_resolv_list_add() as the culprit.
Note: for my application I teardown and then restart the BLE stack fairly often, because my device enters light-sleep and I want to turn off bluetooth during that period. This code and the nimble fixes in espressif/esp-idf#5530 had been working quite nicely for over a month with a couple thousand shipped devices on my open-source project (www.meshtastic.org). This failure started to occur for only one of my personal test devices.
Not knowing much at all about the innards of this stack my nasty hack in this case is to replace
"if there is already an entry found for addr X, fail" with "if there is already an entry found for addr X, replace it"
The text was updated successfully, but these errors were encountered: