5

I have two wifi access points at home: "downstairs" and "upstairs". They're both WPA2.

If I'm upstairs and connected to "upstairs" and my laptop goes to sleep, when I reactivate it, it connects to "downstairs" as it is higher in the list, but the signal is too low and I have to switch it manually to "upstairs". How can I prevent that?

Remark: I don't want "upstairs" or "downstairs" to have priority: it depends on where I stand in the house. I just want OSX to stick with the network I have selected, whichever it is. I don't want to re-type the lengthy password all the time neither ("forget network" is probably not the way to go).

Script or third-party program welcome...

OS X 10.10

EDIT I originally wrote I wanted to stick to current network, as opposed to switching to another weaker network. But if all APs have the same name and password, then the seamless switch is ok to me. See this answer and this advise:

"(...) let the client devices each decide which is best to use" - "Make all the Wi-Fi networks in your home the same. Your life will be better for it."

4 Answers 4

3

I also have two wifi access points at my home, and have found out the best way for OS X to switch between both automatically and choose the one with the best signal is to name both access points with exactly the same name with the same passwords so OS X sees them as identical. Works great with my AirPort Extreme (downstairs) and Time Machine (upstairs) which extends the downstairs wifi.

5
  • 2
    Why is this down voted? It sounds quite logical to me… Does this solution not work? Commented Dec 26, 2014 at 10:36
  • 1
    @BartArondson maybe "I just OSX to stick with the network I have selected"
    – markhunte
    Commented Dec 26, 2014 at 13:03
  • 1
    @markhunte Now I'm even more confused… That is a sentence the OP has in the question. Why would that be a reason to down vote ajkblue's answer? Does this solution not make OSX stick with the network OP selected? Commented Dec 26, 2014 at 13:12
  • @BartArondson From what I understand of the answer, no. And how do you know anyway if they have the same exact name. Maybe ajkblue can answer this with more clarity.
    – markhunte
    Commented Dec 26, 2014 at 14:31
  • Indeed, I said I wanted to stick to the network I had selected. As opposed to switching to the weaker one. My question was actually oriented toward a category of solutions. Not what I meant, I must I admit. The advise sounds good : see Use same SSID for all radios on the same network : "(...) let the client devices each decide which is best to use" - "Make all the Wi-Fi networks in your home the same. Your life will be better for it." I'll give it a shot.
    – youri
    Commented Mar 15, 2015 at 10:41
8

You could use a script to check the RSSI value of the currently connected SSID. If it is above a certain threshold, than change to other SSID with lower RSSI. This could be run manually or paired with a Launch Daemon that is triggered by network change.

In the below script you would just have to change en1 to your wifi interface. Also set your desired threshold for the RSSI value. In the below script I set it for 65. The first time it runs it will prompt for a password to allow netowrksetup to access the system. Otherwise run it as root.

If you create a Launch Daemon I would monitor these three files:

/etc/resolv.conf

/Library/Preferences/SystemConfiguration/NetworkInterfaces.plist

/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist

Script to change SSID if RSSI value is to high.

#!/bin/bash

##Check signal strength of wifi and change if over a certain RSSI threshold.

##Get RSSI strength of WIFI and strip off the - charecter
signalStrength=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI | awk '{print $2}' | sed 's/^[-]*//'`

##Grab current connected WIFI SSID
wifiID=`networksetup -getairportnetwork en1 | cut -d ":" -f2 | sed 's/^[ t]*//'`

if [[ "$signalStrength" > 65 && "$wifiID" = "Upstairs" ]]; then
    networksetup -setairportnetwork en1 "Downstairs" [password]
    echo "Changing to Downstairs wireless, RSSI signal out of threshold"
elif [[ "$signalStrength" > 65 && "$wifiID" = "Downstairs" ]]; then
    networksetup -setairportnetwork en1 "Upstairs" [password]
    echo "Changing to Upstairs wireless, RSSI signal out of threshold"
fi
4
  • Very interesting! Your script will switch to the network with the best signal, which is probably better than what I asked in the first place. Some remarks/questions: 1°- I had to change to en1 to en0. 2°- "monitor these three files" -> could you please elaborate? 3°- Are you sure OSX won't perform the switch right after the script was executed, or try to perform the switch concurrently, possibly causing undesired behavior?
    – youri
    Commented Dec 24, 2014 at 13:56
  • You would have to test to see how it would run using a launchDaemon. I use it as a script that I put up in the menu bar and run when needed. Those three files are what get modified when network changes happen. It is what would trigger your launchDaemon when the SSID changes.
    – tron_jones
    Commented Dec 26, 2014 at 14:12
  • This answer appears to also suit an earlier question: Is there a way to auto switch wireless networks depending on signal strength? (2012-08-25) Commented Mar 18, 2015 at 12:06
  • 1
    +1 to this answer, and re: the comment from @youri "I had to change to en1 to en0", apple.stackexchange.com/a/145351/8546 refers to a JAMF Nation post that may be of interest. Commented Mar 18, 2015 at 12:25
7

Go to System PreferencesNetwork, select your Wi-Fi service, choose Advanced…Wi-Fi and enable Require administrator authorisation to: Change networks. This will mean that you will need to enter your password to change networks, and prevent OS X from doing this automatically.

2
  • It is slightly annoying that I would have to type my admin password but this definitely prevents OSX from switching network... and it's super simple to implement!
    – youri
    Commented Dec 24, 2014 at 13:59
  • 1
    Weird: after a few days, I still have the option checked but now OSX switches networks anyway... and I can manually change wifi network without admin password.
    – youri
    Commented Dec 27, 2014 at 16:37
0

You could try adding two 'locations' within the network section of system preferences. One for upstairs and one for downstairs. Then go in and move downstairs network to top priority when you've chosen the downstairs location and move the upstairs network to top priority under the upstairs locations.

You can then switch between the two locations within system preferences (or using the apple icon if you are pre-yosemite) depending if you're upstairs or downstairs

You must log in to answer this question.

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