MBPr Mid (2013) - Running in Clamshell mode.
My Problem : WIFI Drops when connecting Bluetooth Keyboard / Mouse. No divices connected it seems ok. but for clamshell, that's kind of difficult with a bluetooth keyboard and mouse.
In Frustration i've written a little script to run in the background which Is now on version 3, but keeps me running with everything appearing to work ok and i don't have to worry about clicking / restarting anything the script does it all. I offer no guarantees, and the script may change a little over the day but it appears ok so far, with having to automatically reset the wifi 3 times in just under an hour.
Edit the script and put your own router id in it :- YOURROUTERID=192.168.1.1
What it looks like running in a terminal :-
Try to keep Yoesemite Wifi Online
Mon 27 Oct 2014 05:59:44 UTC
----------------------------------------------
Mon 27 Oct 2014 06:03:52 UTC: bounced - 1 WIFI OK, Smash another Search
Mon 27 Oct 2014 06:03:58 UTC: bounced - 2 WIFI OK, Smash another Search
Mon 27 Oct 2014 06:04:04 UTC: bounced - 3 Lost WIFI Connection, Big Bounce Try
Mon 27 Oct 2014 06:06:18 UTC: bounced - 4 WIFI OK, Smash another Search
Mon 27 Oct 2014 06:06:24 UTC: bounced - 5 Lost WIFI Connection, Big Bounce Try
Mon 27 Oct 2014 06:42:53 UTC: bounced - 6 WIFI OK, Smash another Search
Mon 27 Oct 2014 06:44:26 UTC: bounced - 7 WIFI OK, Smash another Search
Mon 27 Oct 2014 06:48:43 UTC: bounced - 8 WIFI OK, Smash another Search
Mon 27 Oct 2014 06:48:49 UTC: bounced - 9 WIFI OK, Smash another Search
Mon 27 Oct 2014 06:48:55 UTC: bounced - 10 Lost WIFI Connection, Big Bounce Try
Mon 27 Oct 2014 06:49:26 UTC:OK Fails:10
The Script
#! /usr/bin/env bash
clear
COUNTER=0
YOURROUTERID=192.168.1.1
echo -e "\033[38;5;232mTry to keep Yoesemite Wifi Online"
echo -e " $(date -u) "
echo -e "---------------------------------------------- "
while true; do
ping -c 1 -t 1 $YOURROUTERID &> /dev/null
ONLINE=$?
if [[ $ONLINE == 2 ]]
then
let COUNTER+=1
CHECKIFACE=$(ping -c 1 -t 1 $YOURROUTERID 2>&1 | grep -cs 'No route to host')
echo -ne "\r\033[38;5;232m$(date -u):\033[38;5;196m bounced - $COUNTER "
if [[ $CHECKIFACE == 1 ]]
then
echo "Lost WIFI Connection, Big Bounce Try"
ifconfig en0 down > /dev/null
ifconfig en0 up > /dev/null
sleep 4
else
echo "WIFI OK, Smash another Search"
fi
else
echo -ne "\r\033[38;5;232m$(date -u):\033[38;5;148mOK Fails:$COUNTER "
fi
sleep 1
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resource s/airport -s &> /dev/null
done