pikvm/pikvm

Macbook wake from sleep (Sonoma)

aastein opened this issue · 12 comments

sorry if this is a duplicate

Is your feature request related to a problem? Please describe.
A keypress only wakes up a Macbook pro in a limited scenario:

  • Hookup pikvmV3 to macbook pro
  • lock screen
  • hit escape to put computer to sleep. this closes the HDMI output of the macbook
  • On pikvm UI (which now displays , press any key, the HDMI output comes back on and the screen can be viewed in pikvm UI ✅
  • his escape again to put computer to sleep
  • Wait a long time (i have no idea if this is linked to a Mac OS setting or not, either way I think pikvm should handle this case. it happens for me after maybe 10 minutes)
  • On pikvm UI (which now displays , press any key, nothing happens ❌

This is a strange issue. I'm not sure if this is just a Mac OS thing, or if Mac OS somehow knows PiKVM is not a "real keyboard".

When it works:
good

When it doesn't work: (i noticed the keyboard/mouse icons are orange in this case)
bad

Describe the solution you'd like
Make a key press wake up a macbook even after a really long time.

Describe alternatives you've considered
making a physical machine that i can remotely activate that presses a physical keyboard key

Additional context
Add any other context or screenshots about the feature request here.

Hello. Please make a simple test with external USB keyboard. Connect it to your macbook and send it to sleep. After a long interval, hit external keyboard (just like with PiKVM) to wake it up. Will it work?

hi, i dont have a USB keyboard. I figured out that the bad case happens after 30 seconds of inactivity when the computer is locked. If I could configure the mouse jiggle every sub-30 seconds, this would keep the computer locked but never entering the hard-sleep mode.

I tried making the change in pikvm/kvmd#165

I will accept this patch, but I still kindly ask you to get a keyboard for testing, it will help me a lot. I checked Sonoma on my Mac Mini and the wake-up works correctly even after a day.

got a USB keyboard and did more testing:

  • If I unplug, and plug back in the PiKVM to the laptop (either unplug from laptop OR PiKVM side), the UI keyboard/mouse icons turn from orange to green, and key press & mouse click wakes up the laptop
    • maybe this can be emulated by PiKVM?
  • When both the USB keyboard and PiKVM are connected to the laptop & when PiKVM interactions do not wake up the laptop, the USB keyboard does wake up the laptop.

let me know if there is something else I can do to help

also, if you dont want to make a release in the next 2 days, do you have steps to install kvmd from source in PiKVM so locally I can get the enhancement?

If I unplug, and plug back in the PiKVM to the laptop (either unplug from laptop OR PiKVM side), the UI keyboard/mouse icons turn from orange to green, and key press & mouse click wakes up the laptop
maybe this can be emulated by PiKVM?

On V3 you can use System -> Main USB switch to unplug/plug the USB virtually. Please try it.

When both the USB keyboard and PiKVM are connected to the laptop & when PiKVM interactions do not wake up the laptop, the USB keyboard does wake up the laptop.

Got it. Which Macbook do you have, the exact model? And which USB cable do you use to connect it with PiKVM?

also, if you dont want to make a release in the next 2 days, do you have steps to install kvmd from source in PiKVM so locally I can get the enhancement?

I plan to make it very soon, maybe today or tomorrow.

On V3 you can use System -> Main USB switch to unplug/plug the USB virtually. Please try it.

that worked! so that fixes the problem enough, thanks

Which Macbook do you have, the exact model?

16-inch Macbook Pro, 2021

Hardware Overview:
  Model Name:	MacBook Pro 
  Model Identifier:	MacBookPro18,2
  Model Number:	Z1500006XHB/A
  Chip:	Apple M1 Max
  Total Number of Cores:	10 (8 performance and 2 efficiency)
  Memory:	32 GB
  System Firmware Version:	10151.101.3
  OS Loader Version:	10151.101.3
  Serial Number (system):	JJ6RWTXRWR
  Hardware UUID:	5DC8CBF2-C488-5811-9ACD-C312EB3A5801
  Provisioning UDID:	00006001-001261D01482801E
  Activation Lock Status:	Disabled

And which USB cable do you use to connect it with PiKVM?

I tested and got the same behavior with 2 different cables:

  • A mystery black USB-C cable with the markings E301195 (something that looks like "UR" but mirrored) AWM STYLE 2725 60°C 30V VW-1 SUPER HIGH SPEED USB Revision 3.1 PAK HENG
  • Apple USB-C cable. I think it came from the box of a 2020 MacBook Pro, like this screenshot
image

Can you try Type-C to USB-A cable?

i can test that next month

Okay.

@aastein can you please let me know what kind of USB-C hub you used? Is it just an adapter or a hub?