-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Keyboard prevents macOS from sleeping #1273
Comments
Is it possible to change the frequency of the battery status notification being sent? For example I don't need to know battery status per second. Probably hourly is good enough for the purpose of knowing that I need to charge it. |
@kanru This seems to be hard-coded to check every minute; you can try to change the timer constant at: https://github.com/zmkfirmware/zmk/blob/main/app/src/battery.c#L107 |
I'd also be very open to moving that hardcoded value into a Kconfig setting, PRs welcomed. |
|
Recently I’ve started using this utility to disable Bluetooth on the Mac when the machine goes to sleep: https://github.com/odlp/bluesnooze It’s been a great workaround to stop my keyboard from waking my Mac. |
This workaround will increase timeout for the battery status update. Battery status update was considered as a cause for constant nagging mac book from deep sleep. Link for the zmk issue documenting this workaround: zmkfirmware/zmk#1273
Avoid waking connected devices while traveling zmkfirmware/zmk#1273
Avoid waking connected devices while traveling zmkfirmware/zmk#1273
I'm also encountering the issue, when will this be implemented? I really don't want to have to go back to qmk. I'd even be willing to completely disable battery reporting just so this stops happening. Drives me nuts. |
It is already implemented. #1303 was merged last year. |
But why does my keyboard then still wake up my mac constantly? |
You will need to explicitly increase the battery level reporting interval. Here is a setting for CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000
CONFIG_ZMK_BATTERY_REPORT_INTERVAL=1800 |
Thank you so much, it was driving me insane especially since my Apple Watch kept unlocking the Mac when it happened so it didn't even go back to sleep. Also my keyboard doesn't habe a power switch, so I couldn't even turn it off. |
You can also disable battery reporting completely with |
Also a great suggestion, thank you :) I'll be playing with the numbers first and see if that fixes my issue. At least I have a plan B now if that doesn't work. I wonder how Apple is doing this with their keyboards. |
I've tried setting Log:
|
@tsndr Can you share a link to the failing build (on a public config repo)? |
It looks like there were some issues with the setting, I opened a PR here as one way to fix them if you want to give it a try: #1867 You can change your manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
- name: caksoylar
url-base: https://github.com/caksoylar
projects:
- name: zmk
remote: caksoylar
revision: fix-battery-reporting
import: app/west.yml
self:
path: config |
Alright, with your branch it builds. When first flashing it the right keyboard half didn't work, but a reflash solved that. Now evering seems to be working. In my Bluetooth settings it now says I will keep an eye on the PR and switch back over once it's merged. Thank you :) |
My build is failing with the same error as @tsndr. I do not have the @caksoylar I noticed your PR got merged. Would this fix also resolve my issue, and if so what steps would I need to take in order to apply the fix? |
@johnnyBira It's not the same issue the PR is fixing, but a similar one where some feature (in this case the battery widget in the nice!view status screen) is not accounting for the possibility of reporting being disabled. I can go over that and other possible uses and create another PR when I get a chance. |
Thanks @caksoylar, appreciate it 🙏 |
Today I tried to get around this issue by disabling the battery widget, I instead bumped into another issue: https://github.com/johnnyBira/zmk-config/actions/runs/6135817090/job/16649960026 warning: Deprecated symbol BT_LL_SW_LLCP_LEGACY is enabled. Is there a fix on the way or is there any workaround? My builds used to pass and it makes me wonder if it would be possible to build for a different ZMK version until these issues have been resolved in the latest version. |
That is just a warning. The error that caused the build to fail looks to be
It seems to be trying to build both the standard ZMK layer status widget as well as the nice!view status screen. |
@joelspadin Okey! Would you say it's a bug or something that's wrong with my config? |
You cannot use these widget Kconfigs they are for the stock status screen, and the custom status screen of |
Thanks @caksoylar , my build is passing again 👌 |
Has anyone had any success with solving this issue without entirely disabling battery reporting? While applying the following configuration has drastically improved the situation, I'm still seeing my MBP wake from sleep intermittently.
The timing of the wakes seems to vary between ~45 minutes to about 2 hours. |
macOS users often report their machines being woken from sleep by their ZMK keyboard (causing laptop battery drain, etc).
This does not seem to be limited to ZMK keyboards as other bluetooth devices have been reported to prevent macOS from sleeping as well (e.g. Logitech mice).
With regards to ZMK devices however, @petejohanson mentioned on Discord:
Users have confirmed that their Macs are not woken by ZMK when their keyboard is in deep sleep.
Workaround
For users wishing to workaround this with deep sleep, it can be enabled and configured in your
<keyboard>.conf
file (example):(Note that deep sleep is not yet documented, though it is covered on the Power configuration page from the work-in-progress PR #722.)
The text was updated successfully, but these errors were encountered: