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

Jerz

macrumors regular
Original poster
Dec 21, 2013
144
299
Boston, MA
I'm having a problem where my MBP Vega is sticking to further away access points and not switching to a closer access point when moving around my house. I constantly have to turn wifi on and off to switch to a closer access point, I have 3 eeros in my house.

How do I keep wifi disconnected when my mac is asleep? This way, it will connect to a closer access point when I wake it from sleep.
 
i wonder if it would work to go into System Preferences / Network / Advanced / and then drag your networks into your preferred connection order.
 
i wonder if it would work to go into System Preferences / Network / Advanced / and then drag your networks into your preferred connection order.

That would only be useful if each one was entirely out of the range of the other. OP has a mesh system. This method would not solve the issue.

My best advice is to just turn off Wi-Fi every time you put the computer to sleep and turn it on when you wake it up.

It’s a terrible solution, I know, but I don’t know how one would go about that since the software should be automatically connecting to the stronger signal.
 
Until 802.11k and 802.11r are better utilized, it's a bit of a crap shoot. The OS has its own criteria as to what a "decent" network looks like, and it's not an exclusive "Network A is current stronger than Network B, so I'm hopping to Network A" type of thing. Wifi networks can be pretty dynamic and I think a part of the issue is that constantly transitioning between networks would be far worse than using a sub-optimal network for a period of time.

Disconnect and re-connect are your best bet at this point I think, or split your network into multiple SSIDs, which brings its own complications.

iOS has adopted some these new standards (802.11k, r and v) so MacOS won't be far behind. If you're mesh network also supports 802.11k, r, and v, then it might be as soon as the next MacOS when things improve. Or maybe not.
 
  • Like
Reactions: internetrando
You could use Automator to create an application that would run a shell script with two commands...one to turn wifi OFF and the second to turn it back on. That's not much of an improvement over doing it manually.

There used to be some third-party apps that could automatically run commands at wake but I don't know of any that have been updated for the most recent macOS versions.
 
Using the command line, e.g. via Terminal.app, you can use the networksetup utility to turn wifi on and off.

networksetup -setairportpower en1 on

or

networksetup -setairportpower en1 off

(presuming your wifi port is using interface en1, see below)

To make that easier you can add an alias to your bash login, for example in .bash_profile you could add something like the following (if your wifi is using the en1 interface):

alias wifon='/usr/sbin/networksetup -setairportpower en1 on'
alias wifof='/usr/sbin/networksetup -setairportpower en1 off'

Then you can just enter wifon or wifof (or whatever alias you choose) when required (in any new terminal sessions)

But first you should use the following command to determine which 'en' interface your wifi is actually using:

networksetup -listallhardwareports

You'll see a list of ports, one of which will look similar to:

Hardware Port: Wi-Fi
Device: en1 # (yours may show en0, en1, en2 or something similar)

It's fairly straightforward to create a bash script for turning on and off wifi using these networksetup commands. You can also use Automator to run commands or scripts, to save you from opening Terminal, if that's your thing...
 
  • Like
Reactions: Howard2k
I'm having a problem where my MBP Vega is sticking to further away access points and not switching to a closer access point when moving around my house. I constantly have to turn wifi on and off to switch to a closer access point, I have 3 eeros in my house.

How do I keep wifi disconnected when my mac is asleep? This way, it will connect to a closer access point when I wake it from sleep.

I am not familiar with mesh networks, but have 3 Ubiquiti Pro access points in my house. I have no problem with the my 2018 MBP switching to the closest/strongest access point when I open it back up from carrying it to another room. You might see if there are issues with the mesh network.

It might also improve the situation by removing one of you APs if the distance between them is not too great. This is because some devices need to see signal from point A drop below a threshold before they start looking for a new source for the same SSID. If the devices are too close together this threshold may never be met.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.