Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

handsomekilla

macrumors newbie
Original poster
Aug 7, 2017
12
3
I have some processes running on my Mac that require constant or 99.999% uptime/connection to wi-fi.

I find that sometimes my Mac needs to disconnect and reconnect to wi-fi in order for the internet to actually work.

Is there a utility or Apple Script solution to continuously or very frequently checking wi-fi status and then turning wi-fi off and back on if necessary?
 
I have some processes running on my Mac that require constant or 99.999% uptime/connection to wi-fi.

I find that sometimes my Mac needs to disconnect and reconnect to wi-fi in order for the internet to actually work.

Is there a utility or Apple Script solution to continuously or very frequently checking wi-fi status and then turning wi-fi off and back on if necessary?
That's not normal behavior dropping wifi connection unless your Mac goes to sleep. Check if it works with another access point. If not, maybe you have a problem with your airport card.
 
Thanks @LuisN. I find that every Mac at some point loses its connection to wi-fi. Even so, I think the issue is how I can check to be sure my Mac’s wifi connection is stable.
 
Thanks @LuisN. I find that every Mac at some point loses its connection to wi-fi. Even so, I think the issue is how I can check to be sure my Mac’s wifi connection is stable.

Are you saying that when your Mac losses it’s WiFi connection it just goes out all together and you have to manually turn off/on the WiFi connection? If that is the case, that does not sound normal. I have not experienced something like that unless there is an issue with my ISP.

Sounds like maybe you are getting interference of some sort. Maybe the issue is related to the channel you have selected. Have you looked at that?

I use a free app called WiFi Explorer Lite. You can find it in the Mac App Store. It shows me all the WiFi networks around me and how my WiFi channel overlaps with other neighboring networks.

 
Last edited:
I have some processes running on my Mac that require constant or 99.999% uptime/connection to wi-fi.

I find that sometimes my Mac needs to disconnect and reconnect to wi-fi in order for the internet to actually work.

Is there a utility or Apple Script solution to continuously or very frequently checking wi-fi status and then turning wi-fi off and back on if necessary?
you can open terminal and have it ping your router. It will check connection every second.
I really don't know any other way to 100% monitor a connection outside of ping. It's the way I check if a connection to other computers or devices is up.


Or run an ethernet cable and forget about wifi and the issues that go with WiFi connection/interferences/drops/etc.
If you require something reliable, you run a cable.
For myself, in a business, WiFi has it's convenience when it is a convenience, then when it isn't convenient, it can be one of the most frustrating things on the planet at that moment.
Is it the internet provider? Is it the modem? Is it the router? Is it the access point? Is it my computer? Is it some interference? etc, etc, etc.
 
If I thought my wifi connection was dropping off, I would first suspect that something was going on (or off) with the wireless router. I have replaced my home router maybe 4 times in 20(?) years, usually because of some kind of instability due to an aging router.
How do you know that your Mac is at fault, and NOT your router?
 
Thanks everyone for your thoughts. The point I’m concerned about is not that my Mac’s wi-fi card or my router are unstable. In my experience every Mac at some point needs to reconnect to wi-fi. So I’m looking for a way to automate that if possible.
 
I have some processes running on my Mac that require constant or 99.999% uptime/connection to wi-fi.

I find that sometimes my Mac needs to disconnect and reconnect to wi-fi in order for the internet to actually work.

Is there a utility or Apple Script solution to continuously or very frequently checking wi-fi status and then turning wi-fi off and back on if necessary?

I have an old Mac Mini that occasionally loses wifi. I wrote a shell script that pings Google and if the ping fails, it restarts the AirPort connection and wifi reconnects. I set it up as a cron job that runs every hour, but you can increase the frequency to whatever you need. Here's the script that I run:

Code:
#!/bin/bash

if ping -q -W 1 -c 1 google.com > /dev/null
then
    exit 0
else
    networksetup -setairportpower en1 off
    networksetup -setairportpower en1 on
fi
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.