-
Notifications
You must be signed in to change notification settings - Fork 48
Toggle Wi Fi during sleep wake up
Depending on the version of AirportItlwm.kext or the macOS release, Wi-Fi may not automatically reconnect to known networks during system wake-up. Toggle off / on Wi-Fi device button makes the trick: but such a solution is very annoying!
For this reason it is possible to automate this procedure using SleepWatcher through Homebrew.
For installing SleepWatcher and its services, please, refer to step #13 and following here.
Here are the additional steps:
- Command line to identify network service order:
/usr/sbin/networksetup -listnetworkserviceorder
- Create a Sleep and Wakeup file in your home directory:
touch ~/.sleep && chmod 755 ~/.sleep
touch ~/.wakeup && chmod 755 ~/.wakeup
- Put the following script into
~/.sleep
to disable the wifi adapter:
#!/bin/bash
/usr/sbin/networksetup setairportpower en1 off
touch /tmp/sleep.log
cat > /tmp/sleep.log
echo "Sleeping: `date`" >> /tmp/sleep.log
echo `/usr/sbin/networksetup getairportpower en1` >> /tmp/sleep.log
- Put the following script into
~/.wakeup
to re-enable the wifi adapter:
#!/bin/bash
sleep 10
/usr/sbin/networksetup setairportpower en1 on
echo "Waking Up: `date`" >> /tmp/sleep.log
echo `/usr/sbin/networksetup getairportpower en1` >> /tmp/sleep.log
- You can see the most recent sleep/wake cycle in the
/tmp/sleep.log
file:
cat /tmp/sleep.log
Note Your Wi-Fi device should be en1
References
Adding OpenCore entry to UEFI Boot
Activate Surround Sound via MIDI on internal speakers
Add custom shortcuts to Fn hotkeys
Drive Intel(R) UHD Graphics 620
Drive Intel(R) WiFi network card
Enable BIOS Secure Boot with OpenCore
Handle EFI partition from Windows
Keep Bluetooth devices paired on macOS and Windows
Prevent Windows partition from automatically mounting
Remove unnecessary Intel(R) Bluetooth firmware files
Remove unnecessary Intel(R) WiFi firmware files