zmk: Cannot connect to ZMK keyboard over Bluetooth on Pop_OS! 22.04 + Intel AX200 controller
Hi all,
For some reason (I believe after updating from Pop_OS! 20.10 to 22.04), I am no longer able to connect to either of my ZMK firmware keyboards over Bluetooth. I’ve collected all the logs I can think of below:
Bluetoothctl output:
Failed to pair: org.bluez.Error.AuthenticationFailed
dmesg output:
[ 9738.118236] Bluetooth: hci0: unexpected SMP command 0x0b from e1:ed:df:d8:a0:25
[ 9738.232020] Bluetooth: hci0: Opcode 0x 401 failed: -16
systemctl journal output:
src/device.c:load_gatt_db() No cache for E1:ED:DF:D8:A0:25
USB logging output:
[00:03:08.153,594] <dbg> zmk: zmk_endpoints_send_report: usage page 0x07
[00:03:19.176,818] <dbg> zmk: connected: Connected thread: 0x20004d90
[00:03:19.176,910] <dbg> zmk: connected: Connected 44:AF:28:56:A6:C0 (public)
[00:03:19.178,405] <dbg> zmk: update_advertising: advertising from 0 to 2
[00:03:19.213,256] <inf> bas: BAS Notifications enabled
[00:03:19.300,628] <err> zmk: Security failed: 44:AF:28:56:A6:C0 (public) level 1 err 4
[00:03:19.390,991] <inf> bas: BAS Notifications disabled
[00:03:19.393,676] <dbg> zmk: disconnected: Disconnected from 44:AF:28:56:A6:C0 (public) (reason 0x05)
[00:03:19.393,707] <dbg> zmk: update_advertising: advertising from 2 to 2
The Bluetooth controller is the built-in controller in the Intel AX200 chipset. I’ve tested all things I can think of, including manually installing the latest linux-firmware, reinstalling Pop_OS! from scratch, etc.
The connection does work properly on Windows and on another Linux laptop, plus my Android phone.
https://paste.sethforprivacy.com/?d908b857102a6e0d#6Csv3EbvFSz7HeSGTNCzdJupZkze4ZxAmoqVs3fVa5Wr
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 85 (38 by maintainers)
Commits related to this issue
- Try to fix bt connection on linux https://github.com/zmkfirmware/zmk/issues/1487 Signed-off-by: Wenxuan Zhang <wenxuangm@gmail.com> — committed to wfxr/zmk-config by wfxr 7 months ago
- Fix bluetooth issues with my intel wireless/bluetooth card Watch the issue https://github.com/zmkfirmware/zmk/issues/1487 for updates to this issue. — committed to rbelem/zmk-config by rbelem 6 months ago
- BTE Intel 2023 Connection Error FIx Trying to get keeb to connect to work laptop based on issues shown in: https://github.com/zmkfirmware/zmk/issues/1487 — committed to SauceInThePot/ZMK by chadcwong 5 months ago
There is now an aggregate setting called
CONFIG_ZMK_BLE_EXPERIMENTAL_CONN
which you can set to have a combination of the settings I shared earlier applied. Here is a copy of the call for testers that @petejohanson sent out on Discord:Still no luck. And it is extremely problematic when the keyboard disconnects while typing as the last key stays stuck repeating itself for n times until it reconnects again.
As a note, perhaps the issue title should be changed. I guess a lot of people are having the very same issue with indeed different distros and/or configurations.
Hello!
I would also like to report that
CONFIG_BT_CTLR_PHY_2M=n
fixed my issue. However, it has caused one side effect in that the right half now takes much longer to connect to the left. Its not super long, but it is a noticeable wait.Config: Pop-OS Intel AX210 Bluetooth nice!nano controllers
I have tried
and everything worked!
So, I decided to try only
CONFIG_BT_CTLR_PHY_2M=n
again just to be sure. And it also works! Connection is stable for now. Both to the laptop and between halfs.Just for reference, I did:
settings_reset.uf2
I will monitor this thread, so if you need to test some other configuration let me know.
Same issue, when upgraded to
kernel 6.6.2. I tried clearing all profiles and reflashing, all I get is a connect and an immediate disconnect:Edit: so the kernel is fine, the issue is related to the arch package linux-firmware-20231110.74158e7a-1. I have no idea who is to blame here.
@sadekbaroudi : Glad I could help! I must admit that since I have written that comment, the problem haven’t occur any more. And now I have even one additional Linux installation. Maybe the problem caused by the more frequent flashes of the firmware, or also bad handling from my side… Anyway, it seems CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y helped also for me.
Thank you so much, can confirm the above config changes also work for me
Yes, you need to either use separate left, right conf files, or put that file under config/ directory directly: https://zmk.dev/docs/config#config-file-locations
A monitored about a week and it worked correctly.
@hal3e I don’t know what is happening, but in the morning my keyboard connects, but not type anything. I flashed again and it’s now working again. I will monitor…
Yes. and I thought it was ok because it connected however no key-presses were being received. Also, while I had the left side connected over USB the right side could not connect to the left side.
I will try the combination @wAISw mentioned and report back.
Hi! I’m on fresh fedora linux got this problem. I have DAO keyboard. I solve my problem with adding
https://github.com/wAISw/dao-zmk-config/commit/d30aaca69b86eedb5fb48f49b1bfe500ff6ad269
You also could try setting
CONFIG_BT_CTLR_PHY_2M=n
and see if that helps at all.Another user reporting issues had a
dmesg
output indicating it was unhappy with the SMP security request packet… I do wonder if maybe using https://github.com/zmkfirmware/zmk/pull/2046 and enablingCONFIG_BT_GATT_AUTO_SEC_REQ=y
will help.Finally, pairing with bluetuith instead of bluetoothctl resolved the issue in my case. https://github.com/darkhz/bluetuith
A friend of mine more familiar with ZMK suggested clearing all Bluetooth profiles on the keyboard (not just the one I was trying to use) and after doing so the issue is resolved.
If I can provide any additional logs to help track down this bug, please let me know – I will leave this issue open for a bit in case that would be helpful!