Keeping a permanent wireless connection under Leopard.

Hippo Man

Hippo Man
I'm running Leopard on a MacBook Pro. I'm using the AirPort to maintain a wireless connection.

I notice from time to time that the connection goes down. I understand that this could be due to vagaries with my wireless router, or interference from other devices in my vicinity. And under Leopard, it's easy to get the connection back up when it goes down: all I have to do is to click on the AirPort icon in my menu bar and then click on the menu entry that represents my wireless router.

The problem I'm having is that I want this to occur automatically when a connection goes down, and I don't know how to make that happen. I have a static IP and I make use of that to remotely ssh into my MacBook Pro. Obviously, this ceases to work when the wireless connection goes down, and I can't do anything about it because I'm not in front of my MacBook Pro to perform the manual reconnection. It would be nice if there was a way to have my system automatically try to re-establish the wireless connection if it goes down (the moral equivalent to my selecting the AirPort icon and then the menu entry for my wireless router).

I rarely had this problem under 10.4, although it happens several times a day under 10.5. I'm not sure if it was because the wireless connection was more robust under 10.4, or if perhaps there was some mechanism under 10.4 which performed an auto-reconnect when the connection went down, but which is not being performed under 10.5.

Anyway, can any of you suggest a way under 10.5 to cause my system to automatically try to reconnect whenever my wireless connection goes down?

Thanks in advance.
.​
 
Open your Network pref pane
Click on Airport
√ the box for 'Ask to join new networks
Click the Advanced... button
√ the box 'Remember any network this computer has joined' (probably already set)
Drag your preferred networks in the list, so your normal network is on top.
Click OK, then click Apply.
That should help you auto-connect, and stay connected.
 
Open your Network pref pane
Click on Airport
√ the box for 'Ask to join new networks
Click the Advanced... button
√ the box 'Remember any network this computer has joined' (probably already set)
Drag your preferred networks in the list, so your normal network is on top.
Click OK, then click Apply.
That should help you auto-connect, and stay connected.
Thank you very much.

I checked these steps, and it turns out that this is exactly the way that I already have my wireless network set up. And actually, there is no other network to compete with it (in other words, the wireless network is the only one in the Preferred Networks list).

Can anyone think of anything else that might be causing my system to not auto-reconnect when the wireless connection is interrupted? I know that the router is OK at the times that I manually reconnect, because all I have to do is click on the router's name in the AirPort menu for the reconnection to successfully take place.
.​
 
I'm a bit disheartened that no solutions seem to be available for this problem, but hope springs eternal ...

Is there perhaps a *BSD-based method for reinitializing the network connection under Leopard? In other words, I'm looking for something I can run via the shell under a Terminal session that will have the same effect as clicking on the AirPort icon and then clicking on the menu entry for my wireless router.

If so, I can then put together a script that runs under cron or launchd that will periodically check my network connection and then automatically reinitialize it if it's down.

... or are there any other possible ways to solve this problem?

Thanks again, in advance.
.​
 
Well, in hacking around, I discovered at least one way to reset my non-working wireless connection from the command line. I can issue the following two commands, one after the other:
networksetup -setnetworkserviceenabled AirPort off
networksetup -setnetworkserviceenabled AirPort on
Even if the AirPort connection is listed as being up and running, it seems like I have to turn it off and then on again in order to get it to re-connect properly to my wireless router.

Is there a less brutal way of doing this? In other words, do any of you know a way from the command line to tell my AirPort device to re-connect to the wireless router without completely shutting it down and restarting it?

Thanks again, in advance.

PS: keep in mind that I have to do this because several times a day, my MacBook Pro running Leopard loses the ability to see the outside world through my wireless connection, even though the AirPort connection is shown as being up and running. I consider this to be a hack and not a solution, and I'm still hoping for a better way to correct this problem.
.​
 
Are you setup for Automatic in your Airport card settings? I setup a "Home" network (in my Network->Airport settings) and set my Preferred (Advance tab) Network for only my "Home" network because I can see several networks where I live.
 
Are you setup for Automatic in your Airport card settings? I setup a "Home" network (in my Network->Airport settings) and set my Preferred (Advance tab) Network for only my "Home" network because I can see several networks where I live.
Thank you very much for your help here.

Yes, In the "Preferred Networks" tab, I only have my home network set up.

In case this is important, below that tab, I have "Remember any network this computer has joined" checked, and the other two options are unchecked ("Disconnect from wireless networks when logging out" and "Require Administrator password to control "AirPort"). I've tried all the other combinations of those two bottom-most check boxes, and none of them make a difference w/r/t to my losing the wireless connection.

On the other page, I have "Ask to join new networks" checked. Should that be unchecked, by any chance?

By the way, I have now set up a script in crontab which runs every minute and checks to see if I have a usable wireless connection. If it determines that I don't, it then runs the two "networksetup" commands that I mentioned above and writes a line into a log file stating that the network has been reinitialized. Now, I can monitor that log file and see exactly when the connection gets dropped. By correlating those log entries with information in the other system logs, I might be able to figure out what is causing this periodic problem with my wireless connection.
.​
 
Now that I am logging the times when my wireless re-connect hack has to do its work, I have found something in the system logs that might indicate what the problem is.

This morning, the wireless connection had to be restarted, and right at that time, the following line appeared in /var/log/system.log:
Nov 11 10:03:51 home com.apple.launchd[1] (com.apple.dyld): Throttling respawn: Will start in 6 seconds
The wireless connection was up at 10:03, but it went down between then and 10:04, when it had to be restarted.

Could this launchd message have something to do with the wireless connection being dropped, or do you think it's just a coincidence that it occurred at the same time? If it does have something to do with the problem, can any of you think of what I could do to fix it? ... i.e., what to do to keep this respawning from killing my wireless connection in a way that prevents it from properly restarting on its own?

Thanks.
.​
 
Well, I found something that might work to fix the problem. Check out the discussions at these two locations:
This apparently has to do with some sort of corruption that seems to appear in dyld's cache after the first software upgrade that is performed following a Leopard install. Running the following command from a within a Terminal session followed by a reboot allegedly fixes things:
sudo update_prebinding -force -root /
This might also fix other mysterious post-Leopard-install problems that people are experiening.

I'll keep you all posted as to whether this really does seem to correct my problem.
.​
 
I don't know if the two are connected - tho it's great to come on this issue, which requires, apparently, only a force re-prebind, via Terminal, TinkerTool System or another utility that has been clearly updated for Leopard. I had your problem in Tiger, for a while, and eventually disconnecting, trashing all the network-related preferences I could find, and creating a new config file in Airport Admin Utility solved it. Also, a new Keychain card.

"I have "Ask to join new networks" checked. Should that be unchecked, by any chance?" Don't think that matters. Pref files do get corrupted; before looking for bigger problems, best to clear that possiblity.
 
I'm not sure if this will contribute to anything, but I googled my exact problem as you were having and came to this thread.

What I found was that my wireless n-router was setup with just WEP encryption (due to some older hardware in my house). This was the only place I would lose connection. I switched encryption to WPA and now I have zero problems.

This is a MacBook running leopard, btw.
 
Back
Top