Skip to content
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

[BUG] Bluetooth connection lost when sending mod-morphs to M1 Mac #2252

Open
sallygal1 opened this issue Apr 5, 2024 · 3 comments
Open

[BUG] Bluetooth connection lost when sending mod-morphs to M1 Mac #2252

sallygal1 opened this issue Apr 5, 2024 · 3 comments

Comments

@sallygal1
Copy link

My keyboard spontaneously loses connection when sending a mod-morph to my M1 Mac.

I'm using this library to send unicode mod-morphs to the Mac via bluetooth. Every so often when sending the mod-morph, the keyboard loses the bluetooth connection. My keyboard runs on batteries. I've enabled USB debugging (connection set to bluetooth) but the issue did not occur for 2 days (power via USB/battery charging on main half).

The only log entry I can see on the Mac is:

Couldn't find active session 0x00000003289033H7! (status=65535)

After that I have to open the Mac's bluetooth menu, Forget the device, then I'm able to reconnect again. It'll continue working for a while, then it happens again. This only happens when the keyboard runs on the batteries. It seems to me there is either some weird race condition or some lock up of the chip (nice!nano v2.0) due to the mod morph.

I'm having some troubles sourcing the issues and I'm out of ideas what to try next.

@sallygal1 sallygal1 changed the title Bluetooth connection lost when sending mod-morphs to M1 Mac [BUG] Bluetooth connection lost when sending mod-morphs to M1 Mac Apr 5, 2024
@caksoylar
Copy link
Contributor

caksoylar commented Apr 5, 2024

If this is a crash, it might be worth sharing a (ideally minimal) reproducer (or perhaps a test?)

@sallygal1
Copy link
Author

The thing is, I can't reproduce it consistently enough (hence why I think it's a weird race-condition/lock-up). Is there a way to get the logs when running off battery? Like logging to a file on the chip, or sending logs via bluetooth.

@caksoylar
Copy link
Contributor

You can use USB logging but send keycodes to the active BLE profile: https://zmk.dev/docs/behaviors/outputs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants