OS X - Fix for wifi disconnect after suspend/resume

OS X - Fix for wifi disconnect after suspend/resume


I've purchased a Mac recently and since upgrading to Maverick have been having some problem with wifi after suspend/resume. Looking into the issue, I've found this thread: https://discussions.apple.com/thread/5495375 and some people have reported that turning off bluetooth did fix the issue.


For my case, this was not possible, so I've tried to make a little fix, that disable bluetooth on suspend and enable it on wake, but with a 10 seconds delay, in order to let the wifi connect successfully.


Here is my github repo for anyone to look at the code: https://github.com/Setsuna666/osx-wifibtfix


Here is the latest version of the fix, which include an uninstall script: https://github.com/Setsuna666/osx-wifibtfix/archive/v1.0.2.zip


If you have any questions or issues, please post it here so it can be easier for me to keep track of.

Posted on May 16, 2014 9:52 PM

Reply
25 replies

May 17, 2014 8:57 AM in response to antzcrashing

What I did:


Note: since I believe it matters, the order of my network connections are (this is default after you delete system preferences in /Library/Preferences folder:

Bluetooth DUN

WIFI

Bluetooth PAN

Thunderbolt


Tried to reproduce the error:


Put laptop to sleep with Bluetooth on, upon wake it takes approximately 15 seconds to connect to the internet. This is not the severe case in which it never connects to the internet and which you have to disable/enable wifi and maybe select the wifi source to reconnect. So to reproduce that issue, I connected to a BTdevice (bose speaker), unpaired the device and restarted my machine.

Now when waking from sleep I cannot connect to internet. So I employed the plist fix by removing those system preferences. Now I can connect to the internet but it takes approx. 15 seconds to connect to the internet (hangs and eventually brings me to the website of interest). Then I DL your fix:


DL source code.


Install with sudo bash install.sh > suggest adding a set.exe/dmg that they can run because most users will be baffled by cmd line haha, and make the readme a .txt, not sure how to run .mg file myself


1) Shut laptop into sleep and waked with Bluetooth off –

-instant


2) Shut laptop into sleep and waked with Bluetooth connected –

-instant


3) Shut laptop into sleep and waked with Bluetooth unpaired but still in devices list–

-15s


4) Restarted System

Connected internet with BT on but unpaired

-instant

Laptop to sleep and wake

-15s


5) Shut laptop into sleep and waked with Bluetooth connected –

-webpage not connected, reload worked

-instant

-instant

-instant

-not connected, reload worked

-instant


6) Shut laptop into sleep and waked with Bluetooth off –

-instant

-instant

-instant


Uninstall:

I received the following errors when attempting uninstall:

Uninstalling blueutil...

rm: /usr/local/bin/blueutil: No such file or directory

Uninstalling SleepWatcher...

rm: /usr/local/sbin/sleepwatcher: No such file or directory

rm: /usr/local/share/man/man8/sleepwatcher.8: No such file or directory

rm: /Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher-20compatibility.plist: No such file or directory

Stopping SleepWatcher...

No matching processes were found

Uninstall finished


Verdict: Fix appears to improve reliability and usability over not having the fix and having Bluetooth off, however, it seems at this point for me it is better to just turn Bluetooth off (because Bluetooth on my laptop is not critical, I can use ipad for BT music playing)


Summary of Results:

Install works

Uninstall does not work


Recommendations:

Make the installer/uninstaller a .dmg file for click and load

Make readme a .txt

Fix uninstaller if possible, looks like it cannot find the files

Improve results when BT not connected (the 15s delay) if possible

May 17, 2014 10:17 AM in response to Setsuna666

I guess it may be issues with the installer that caused the uninstaller to not work. See the output of my running:


Antzcrashing-MacBook-Air:osx-wifibtfix-1.0.2 Antzcrashing$ sudo bash install.sh

Password:

Installing Wifi/BT fix by Setsuna666...

Downloading SleepWatcher...

Downloading file from http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz...

sudo: wget: command not found

Extracting SleepWatcher...

tar: Error opening archive: Failed to open '//tmp//sleepwatcher_2.2.tgz'

Creating dependencies for SleepWatcher...

Installing SleepWatcher...

cp: //tmp//sleepwatcher_2.2/sleepwatcher: No such file or directory

cp: //tmp//sleepwatcher_2.2/sleepwatcher.8: No such file or directory

cp: //tmp//sleepwatcher_2.2/config/de.bernhard-baehr.sleepwatcher-20compatibility.p list: No such file or directory

Copying SleepWatcher configuration...

Starting SleepWatcher...

launchctl: Couldn't stat("/Library/LaunchDaemons/de.bernhard-baehr.sleepwatcher-20compatibility.pli st"): No such file or directory

nothing found to load

Downloading blueutil...

Downloading file from http://www.frederikseiffert.de/blueutil/download/blueutil.dmg...

sudo: wget: command not found

Mounting blueutil disk image...

hdiutil: mount failed - No such file or directory

Installing blueutil...

install.sh: line 39: /Volumes/blueutil/Install.command: No such file or directory

Finished installing Wifi/BT fix

Now try to suspend and resume your Mac, your wifi should connect without issue

May 17, 2014 11:55 AM in response to Setsuna666

Installed properly this time:


It appears to work, when I resume from sleep the Bluetooth icon is off (gray) and wifi connects, after 10s Bluetooth icon comes on again.


Here is the correct output:


Antzcrashing-MacBook-Air:osx-wifibtfix-1.0.3 Antzcrashing$ sudo bash install.sh

Password:

Installing Wifi/BT fix by Setsuna666...

Downloading SleepWatcher...

Downloading file from http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz...

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 43385 100 43385 0 0 28567 0 0:00:01 0:00:01 --:--:-- 28580

Extracting SleepWatcher...

x ./sleepwatcher_2.2/

x ./sleepwatcher_2.2/config/

x ./sleepwatcher_2.2/ReadMe.rtf

x ./sleepwatcher_2.2/sleepwatcher

x ./sleepwatcher_2.2/._sleepwatcher.8

x ./sleepwatcher_2.2/sleepwatcher.8

x ./sleepwatcher_2.2/sources/

x ./sleepwatcher_2.2/sources/Makefile

x ./sleepwatcher_2.2/sources/._sleepwatcher.c

x ./sleepwatcher_2.2/sources/sleepwatcher.c

x ./sleepwatcher_2.2/sources/sleepwatcher.xcodeproj/

x ./sleepwatcher_2.2/sources/sleepwatcher.xcodeproj/bb.pbxuser

x ./sleepwatcher_2.2/sources/sleepwatcher.xcodeproj/bb.perspectivev3

x ./sleepwatcher_2.2/sources/sleepwatcher.xcodeproj/project.pbxproj

x ./sleepwatcher_2.2/config/de.bernhard-baehr.sleepwatcher-20compatibility-localu ser.plist

x ./sleepwatcher_2.2/config/de.bernhard-baehr.sleepwatcher-20compatibility.plist

x ./sleepwatcher_2.2/config/rc.sleep

x ./sleepwatcher_2.2/config/rc.wakeup

Creating dependencies for SleepWatcher...

Installing SleepWatcher...

Copying SleepWatcher configuration...

cp: /Users/Jeffrey/Documents/OS: No such file or directory

cp: Stuff/MAC/osx-wifibtfix-1.0.3/extra//rc.sleep: No such file or directory

cp: /Users/Jeffrey/Documents/OS: No such file or directory

cp: Stuff/MAC/osx-wifibtfix-1.0.3/extra//rc.wakeup: No such file or directory

Starting SleepWatcher...

Downloading blueutil...

Downloading file from http://www.frederikseiffert.de/blueutil/download/blueutil.dmg...

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 33343 100 33343 0 0 11945 0 0:00:02 0:00:02 --:--:-- 11942

Mounting blueutil disk image...

Checksumming Driver Descriptor Map (DDM : 0)…

Driver Descriptor Map (DDM : 0): verified CRC32 $0275F970

Checksumming Apple (Apple_partition_map : 1)…

Apple (Apple_partition_map : 1): verified CRC32 $1779B6BD

Checksumming disk image (Apple_HFS : 2)…

..............................................................................

disk image (Apple_HFS : 2): verified CRC32 $920D4FD8

Checksumming (Apple_Free : 3)…

(Apple_Free : 3): verified CRC32 $00000000

verified CRC32 $AFAB3FAE

/dev/disk2 Apple_partition_scheme

/dev/disk2s1 Apple_partition_map

/dev/disk2s2 Apple_HFS /Volumes/blueutil

Installing blueutil...


Finished installing Wifi/BT fix

Now try to suspend and resume your Mac, your wifi should connect without issue

May 17, 2014 11:59 AM in response to antzcrashing

However, when I try to reinstall, I get a proper output, but it does not seem to work anymore, which makes me think the installer/uninstaller are not working together properly. The reason I say it no longer works is because when I wake from sleep bluetooth does not automatically come on (gray-Black) as it used to. Here is the output from the re-install:


Uninstall finished

Antzcrashing-MacBook-Air:osx-wifibtfix-1.0.3 Antzcrashing$ sudo bash install.sh

Installing Wifi/BT fix by Setsuna666...

Downloading SleepWatcher...

Downloading file from http://www.bernhard-baehr.de/sleepwatcher_2.2.tgz...

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 43385 100 43385 0 0 23663 0 0:00:01 0:00:01 --:--:-- 23655

Extracting SleepWatcher...

x ./sleepwatcher_2.2/

x ./sleepwatcher_2.2/config/

x ./sleepwatcher_2.2/ReadMe.rtf

x ./sleepwatcher_2.2/sleepwatcher

x ./sleepwatcher_2.2/._sleepwatcher.8

x ./sleepwatcher_2.2/sleepwatcher.8

x ./sleepwatcher_2.2/sources/

x ./sleepwatcher_2.2/sources/Makefile

x ./sleepwatcher_2.2/sources/._sleepwatcher.c

x ./sleepwatcher_2.2/sources/sleepwatcher.c

x ./sleepwatcher_2.2/sources/sleepwatcher.xcodeproj/

x ./sleepwatcher_2.2/sources/sleepwatcher.xcodeproj/bb.pbxuser

x ./sleepwatcher_2.2/sources/sleepwatcher.xcodeproj/bb.perspectivev3

x ./sleepwatcher_2.2/sources/sleepwatcher.xcodeproj/project.pbxproj

x ./sleepwatcher_2.2/config/de.bernhard-baehr.sleepwatcher-20compatibility-localu ser.plist

x ./sleepwatcher_2.2/config/de.bernhard-baehr.sleepwatcher-20compatibility.plist

x ./sleepwatcher_2.2/config/rc.sleep

x ./sleepwatcher_2.2/config/rc.wakeup

Creating dependencies for SleepWatcher...

Installing SleepWatcher...

Copying SleepWatcher configuration...

cp: /Users/Jeffrey/Documents/OS: No such file or directory

cp: Stuff/MAC/osx-wifibtfix-1.0.3/extra//rc.sleep: No such file or directory

cp: /Users/Jeffrey/Documents/OS: No such file or directory

cp: Stuff/MAC/osx-wifibtfix-1.0.3/extra//rc.wakeup: No such file or directory

chmod: /etc/rc.sleep: No such file or directory

chmod: /etc/rc.wakeup: No such file or directory

Starting SleepWatcher...

de.bernhard-baehr.sleepwatcher: Already loaded

Downloading blueutil...

Downloading file from http://www.frederikseiffert.de/blueutil/download/blueutil.dmg...

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 33343 100 33343 0 0 19540 0 0:00:01 0:00:01 --:--:-- 19533

Mounting blueutil disk image...

/dev/disk2 Apple_partition_scheme

/dev/disk2s1 Apple_partition_map

/dev/disk2s2 Apple_HFS /Volumes/blueutil

Installing blueutil...


Finished installing Wifi/BT fix

Now try to suspend and resume your Mac, your wifi should connect without issue

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

OS X - Fix for wifi disconnect after suspend/resume

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.