zmkfirmware / zmk

ZMK Firmware Repository
https://zmk.dev/
MIT License
2.71k stars 2.76k forks source link

Bluetooth security failing on windows machine #805

Open aureumleonis opened 3 years ago

aureumleonis commented 3 years ago

I've been using a split/nice!nano handwired built for a few months already with no issues on my personal PC. On the other hand, The keyboard pairs correctly with the my work laptop but doesn't send any keypresses. Both of these are windows 10 machines. I finally took the initiative to enable debugging and saw this happen constantly (a couple of times per second)

[00:25:58.514,068] <err> zmk: Security failed: <redacted> (public) level 1 err 2
[00:25:58.639,770] <dbg> zmk.split_central_disconnected: Disconnected: <redacted> (public) (reason 19)
[00:25:58.639,831] <dbg> zmk.disconnected: Disconnected from <redacted> (public) (reason 0x13)
[00:25:58.639,862] <dbg> zmk.update_advertising: advertising from 2 to 2
[00:25:58.678,680] <dbg> zmk.split_central_connected: Connected: <redacted> (public)
[00:25:58.678,680] <dbg> zmk.split_central_process_connection: Current security for connection: 1
[00:25:58.679,901] <dbg> zmk.split_central_process_connection: New connection params: Interval: 48, Latency: 0, PHY: 1
[00:25:58.679,992] <dbg> zmk.connected: Connected thread: 0x20002e40
[00:25:58.679,992] <dbg> zmk.connected: Connected <redacted> (public)
[00:25:58.680,023] <dbg> zmk.update_advertising: advertising from 0 to 2

I may have the beginning/end of the log wrong but this is still the part that repeats. Does anybody know what the problem could be? Is there anything else I can I do to find more data about the problem?

maslomeister commented 4 months ago

Zephyr 3.5 Corne, NRF52840, Win 11 23H2, Generic bluetooth adapter 5.3 (tried 2 different ones)

I am able to pair my keyboard fine and use it, but whenever I reboot my PC, the keyboard shows up as "not connected" and doesn't want to connect at all. "Forget this device.", clearing BT profile and re-pairing is the only thing that works. After I enabled debug and rebooted, the keyboard periodically sent the same error as in this issue. The keyboard reconnects just fine on MB pro 14.1.1 and another win 10 22H2 with same generic ble adapter 5.3.

BambooRaptor commented 3 months ago

Same here. My keyboard (running ZMK from July 2023) would not pair with my new Windows 11 laptop. I Rebuilt with 3.5 just now and it paired to the same win 11 laptop w/o any problems. I did not have to reset keyboard settings, roll back Bluetooth drivers or anything else besides update to ZMK 3.5

How did you rebuild with 3.5? Did you change something in the build.yml file? As far as I can tell, 3.5 is on the main branch now, and so should be the default choice when building, but I'm still facing this issue...

lesshonor commented 3 months ago

Since it's a long thread and this hasn't been mentioned in a while; might be worth trying CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y if you're having issues.

BambooRaptor commented 3 months ago

Since it's a long thread and this hasn't been mentioned in a while; might be worth trying CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y if you're having issues.

It worked! Thank you!!

MatchstickWorks commented 2 months ago

Since it's a long thread and this hasn't been mentioned in a while; might be worth trying CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y if you're having issues.

I tried this on my setup and it's not working. I believe I'm at the latest ZMK build (unsure how to check that against my config). I'm not using an intel driver for bluetooth, either. So I'm feeling a little stuck.

Works on my android phone, and my wife's macbook, but not her work Intel Windows PC ("Try connecting your device again"), nor my own AMD W10 PC, or my work Intel W10 PC.

Any additional thoughts?

rayanpiro commented 2 months ago

Since it's a long thread and this hasn't been mentioned in a while; might be worth trying CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y if you're having issues.

Working for me too with Zephyr 3.5.0 and Corne keyboard with NRF52840 and USB 5.3 dongle on Win11.

MatchstickWorks commented 2 months ago

Since it's a long thread and this hasn't been mentioned in a while; might be worth trying CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y if you're having issues.

I tried this on my setup and it's not working. I believe I'm at the latest ZMK build (unsure how to check that against my config). I'm not using an intel driver for bluetooth, either. So I'm feeling a little stuck.

Works on my android phone, and my wife's macbook, but not her work Intel Windows PC ("Try connecting your device again"), nor my own AMD W10 PC, or my work Intel W10 PC.

Any additional thoughts?

Solution I had was that one of the dongles I was using was below BT4.2, so it was never going to connect. The other is that my small macropad wasn't set up to clear profiles and I didn't understand that it didn't clear profiles when you flash the firmware. So I added a setup to be able to switch and clear profiles on the board itself.

FearlessSpiff commented 6 days ago

So cool. CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y also worked for me. Was a bit surprised, that I had to enter a PIN on the keyboard, but it worked!