Hacker News new | ask | show | jobs
by 314 1214 days ago
This is a nice idea, I was jsut wondering how to do that.

Another approach (if it is supported by the adaptor) is to configure WoL so that it does not need a magic packet. Some adaptors can be configured to wake on any "directed packet".

I have a linux server sitting downstairs that I might play around with. It would be nice if the sleep support featured a timer and integration with the system cron daemon. Then it could wake on a directed packet or when there is a scheduled task.

1 comments

Interesting! I believe all the new Mac products also work like this. While sleeping a Mac will still stay on WiFi if it’s on a power adapter and the sleeping M1/M2 Macs stay on WiFi even while on battery. They also still respond to some mDNS traffic. When I try to access certain services on a sleeping Mac, like SSH, it’ll immediately wake up. Even port scanning with `nmap -p 22 <ip>` will cause a wake up. That sounds like the wake on “directed packet” thing? In practice I think this mostly obviates the need for a Bonjour Sleep Proxy.

Also, fun tip: You can easily check if a Mac on the network is sleeping or not based on its ping response TTL. While awake it uses a TTL of 64 but while sleeping it uses a TTL of 32. You can use this little signal to roughly keep a log of when the Macs on your network are awake vs sleeping. (Not too much of an actual privacy concern I think)

Nice. I'll have to try this. I may have ssh'd into a sleeping mac before and assumed that it had failed to sleep. I did not realise what it was doing.