-
Notifications
You must be signed in to change notification settings - Fork 68
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
BLE reconnect loop #1056
Comments
Oh, that confirms that I'm not alone seeing this. When I tried playing with Bluetooth on my UHK 80 and Linux systems, I often end up in a state where Linux desktop notifications pop up: "UHK 80 connected", "UHK 80 disconnected", "UHK 80 connected", "UHK 80 disconnected" etc. and it never ends until I plug in the UHK via USB, or sometimes I need to "forget" the pairing on the Linux system. I haven't figured out a reproducible sequence, but I have real difficulty pairing the UHK. I need to use commandline and issue a few times a random sequence of these commands:
Sometimes along this process, finally the pop-up appears prompting me to enter the six-digit pairing code. Often this does not pop up and the UHK pairing starts but then fails. It seems very random. Sometimes after having done the "trust" command, it pairs. But then later after turning something off and on again, it enters the connect/disconnect loop with the neverending recurring notification pop-ups. That's the best description I currently have. |
Yes, I forgot about the incessant "UHK 80 connected" notifications I've also experienced. |
GPT says 5 means authentication failure. UHK acts as a peripheral in this interaction, so it should be the PC that stops obsessively trying to connect when it knows it cannot authenticate, shouldn't it? (UHK isn't trying anything. It just advertises its features and responds to whoever tries to connect to it.) The only thing I see that should be done about that is that UHK should not switch from USB HID to BLE HID until a connection is fully formed and secured. |
Would this stop the incessant notifications on Linux?
It probably should, but the world is a mess, and the UHK must handle these situations gracefully, even if the root cause is not our fault. |
Maybe. Also another story is why the authentication fails. Let's wait until the connection manager is merged. It fixes a couple of bluetooth bugs that may easily by the culprit... |
That is indeed the main culprit. It is super hard for me to get the UHK 80 to consistently pair. Once it is really paired, it works. But recent firmware upgrade blew it again, and I ended up in the reconnect loop. I suspect that somehow the keys of UHK and Host don't match anymore, and host is trying to keep connecting to a connection that doesn't match up on the UHK. But I may be wrong. I had something similar with my ZMK keyboard, but after deleting BLE keys on the keyboard (on ZMK you can just configure a key to delete all BLE keys), they keyboard would pair again. Couldn't get that done on the UHK. |
I seldom test BLE, but I paired my UHK 80 to my Linux PC yesterday, disconnected the BLE connection, and kept using USB. I think I didn't delete the bond. Before going to bed, I put my PC to sleep, and when I woke it up today, my UHK 80 seemingly didn't work and was disconnected according to the OLED display.
I looked into the Zephyr log and saw the following repeating:
I'm unsure about the best solution but feel free to make suggestions. Maybe the firmware should simply stop trying to connect after a certain number of failures within a timeframe per host connection. I'm on master.
The text was updated successfully, but these errors were encountered: