After setting up a mesh network, the coverage in the house has been much better, but my Mac sometimes refuses to roam to a stronger signal. It happened this morning when I was sat next to one of the wifi nodes, but had no connection, so I knew something was up.

Helpfully, you can use the airport CLI to change your Mac’s roaming strategy.

If you haven’t already, make a simple alias for airport like this in a terminal:

# Make a local bin folder if you haven't already
mkdir -p ~/bin

# Symlink ~/bin/airport to the actual airport command
ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport ~/bin/

# Add ~/bin to your $PATH and add to your bash profile
echo "export PATH=$PATH:~/bin" >> ~/.bash_profile

# Finally, just run it, so you can call the airport alias
# in your current bash session
export PATH=$PATH:~/bin

# Now you can use the airport command, to e.g. scan for networks
airport -s

Use the airport command to change your wifi roaming strategy

Thanks to this Apple Stackexchange answer, I found out that you can tell your Mac to switch to the strongest signal:

sudo airport prefs joinMode=Strongest

You need the sudo, because you’re changing a system setting.

You can check it was set using:

airport prefs joinMode

There’s also a nice GUI for checking what wifi networks are near you:

Option-click on the Wi-Fi menu, click Open Wireless Diagnostic, from the menu bar, click Window > Scan

MacOS Big Sur Option click the wifi menu

MacOS Wireless Diagnostics wifi signal strength window

Check wifi RSSI in iOS

Tim asked if it’s possible to do the same in iOS:

I don’t think it is; it looks like it’s triggered by a drop in the RSSI

Apple have an Airport Utility app that you can use to scan wifi networks and check RSSI strength.

Once you’ve installed the app, you need to enable the wifi scanner in Settings: On your iPhone, iPad or iPod touch, go to Settings, tap AirPort Utility, then turn on Wi-Fi Scanner.

iOS Airport Utility scanning wifi networks