2

I have a Macbook Pro Retina, 15in, and I have the above issue. In a related question (Wifi doesn't work unless I turn it off then on again) a user commented:

For as long as I can remember, I've had to do this on my MacBook Pro Retina 15″ — I've always presumed it's the router, as I only have the problem at home. I even have a script that will automatically cycle the Wi-Fi if it's attempting to connect to my home network and fails for more than 3 seconds :) – grgarside Jan 26 at 20:00

Does anyone know how to write/load this kind of script? Thanks!

  • Hi! In the future, I'd be happy to provide follow-up details to anything I say like this—feel free to ping me in Ask Different Chat, I get many notifications that I can miss the occasional comment ping. – grg Jan 19 '15 at 19:37
0

You could try something like this: (Copy and Paste it into AppleScript Editor)

--
-- Toggle Airport Power On and Off
--
if (offset of "On" in (do shell script "networksetup -getairportpower en1")) > 0 then
    do shell script "networksetup -setairportpower en1 off"
else
    do shell script "networksetup -setairportpower en1 on"
end if

Change the en1 to en0 (zero) for your WiFi.

If it works save the apple script as application. Pull it to your dock for fast access.

  • Hey thanks I'm trying to see if I can figure this out based on your answer.. Can you recommend an automated solution? Like "on wake from sleep, toggle wifi off, then on if not connected" ? How can this be done? Want to avoid have to click anything... Thanks! – fabbb Oct 16 '14 at 0:34
  • For that you might want to take look at the app called sleepwatcher. macupdate.com/app/mac/10387/sleepwatcher – Ruskes Oct 16 '14 at 0:45
0

Upgraded to Yosemite 10.10 and problem is now fixed.

0

Try this Golang script out - https://github.com/icecrasher321/Wifi_Hack

The script automates the process of turning off and on your wifi at intervals of 20 minutes(Future versions will detect packet drops to start the wifi reset process). You can keep it running in the background. More information is available in the README of the github link given above.

If you don't want to install Golang just for this, you can get the same result by using the following shell script

while :; do
    networksetup -setairportpower en1 off
    sleep 3
    networksetup -setairportpower en1 on
    sleep $((20 * 60))
done

Run networksetup -listallhardwareports first to check whether your Wi-Fi really is on en1 .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .