OpenAnnePro / qmk_firmware

This has since been merged back to mainline QMK. Please use qmk/qmk_firmware
https://qmk.fm
GNU General Public License v2.0
196 stars 64 forks source link

[Bug] Bluetooth not working on Apple devices #50

Open jakallergis opened 2 years ago

jakallergis commented 2 years ago

Describe the Bug

I don't know if this is specific to apple devices or bluetooth in general, I didn't test on Windows/Linux or android devices.

I am using the flow as described in the documentation and everything works just fine. However, when I try to connect via bluetooth it doesn't work unless I forget the keyboard from the device's bluetooth connections list, then press FN2+[1-4] and then press connect on the apple device when I see it show up in the list. I can even continue and connect the rest of the bluetooth devices and switch between them just fine, but if I switch the keyboard off and on again, then it immediately connects (or at least that's what it looks like on the apple device) but you cannot type anything. You have to forget the device, restart the keyboard, and connect from scratch.

I thought that it might be something with the BLE firmware that doesn't change (I think) when you flash this firmware. Like, maybe the version of the installed BLE firmware has some incompatibilities with the version developers where using when creating the QMK port. So I tried this flow multiple times by first flashing a different firmware upgrade from the ObinsKit app.

So what I did was this:

👆 and I did this with every single firmware version available for flashing in the ObinsKit app

Thank you in advance

System Information

Additional Context

Please note that this is not a fault of the keyboard, or at least it doesn't make sense for it to be, because this works perfectly fine with ObinsKit.

Tried to dig into the project a little bit and try to locate the problem in the code, but I couldn't find anything specific. However, seeing the code around the BLE module, it seems like the FN2+[1-4] keys start a broadcast but then it's not clear how and when it goes into pairing mode. For example, in the stock firmware, if you press FN2+1 for a few seconds it will go into pairing mode for that BLE slot. How would that be done with this project? Although, even if that feature is indeed missing I don't think that's the main issue here. It looks more like a problem with persisting the state of the BLE module

Codetector1374 commented 2 years ago

I understand this bug exists for a while now, but really don't know where to go about fixing it. The main problem comes from that the BT firmware is closed source and the chip itself doesn't have a whole lot of technical documentation either. So reversing the firmware is going to be non trivial as well. Generally we don't understand how the BT chip actually works so we implemented the protocol by guessing / cross verifying with what the official firmware does.