![]() #Sleepwatcher mac install#So the first thing to do is actually turn off the wireless interface when the MacBook sleeps (I do not require any features like Remote Desktop that will be affected by doing this - but it may be different for you, in which case I guess the web server approach - perhaps with a custom node-red function node - will be better for you)Ī) Install sleepwatcher: brew install sleepwatcherī) Create a script for when the machine sleeps: echo "networksetup -setairportpower Wi-Fi off" > ~/.sleep.sh chmod +x ~/.sleep.shĬ) Create a script for when the machine wakes up: echo "networksetup -setairportpower Wi-Fi on" > ~/.wakeup.sh chmod +x ~/.wakeup.shĭ) You can test if these work by running them directly - for example: > cd ~ >. on the request node, I decided I wanted to use a ping probe as it would be more elegant for various reasons. Although this works fairly well, and besides not being able to easily configure socket timeouts, etc. Realising this, I first tried running a simple HTTP server that node-red can poll. ![]() Thus, using a ping probe from node-red to decide if the laptop is asleep will not work as is. The ideal approach would be a ping probe (that turns the light off if it does not receive a response on the ICMP packet and vice versa) - but it’s worth noting that MacOS keeps theWi-Fi connected even when asleep whether WoL (Wake-on-LAN) is enabled or not.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |