Setsuna666

Q: 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:59 PM

Close

Q: OS X - Fix for wifi disconnect after suspend/resume

  • All replies
  • Helpful answers

Page 1 Next
  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 4:19 AM in response to Setsuna666
    Level 1 (0 points)
    May 17, 2014 4:19 AM in response to Setsuna666

    Setsuna, thanks for the work on this, sounds very promising.  I will backup, attempt it and let you know my results (both initially and after several days of it running)

  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 8:57 AM in response to antzcrashing
    Level 1 (0 points)
    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

  • by Setsuna666,

    Setsuna666 Setsuna666 May 17, 2014 9:10 AM in response to antzcrashing
    Level 1 (0 points)
    May 17, 2014 9:10 AM in response to antzcrashing

    If the uninstaller doesn't work, it might be because the installer didn't run properly. What it does is remove the files from where it has been installed.

     

    Will try it again to make sure, but from my tests it was working correctly.

     

    Thanks for the feedback.

  • by Setsuna666,

    Setsuna666 Setsuna666 May 17, 2014 9:03 AM in response to Setsuna666
    Level 1 (0 points)
    May 17, 2014 9:03 AM in response to Setsuna666

    Will also look a making a DMG file.

  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 9:16 AM in response to Setsuna666
    Level 1 (0 points)
    May 17, 2014 9:16 AM in response to Setsuna666

    Other people, please try this and give feedback!  There is literally no risk if you backup your system

    (Time machine is great and easy, and Disk Utility - Image backup works too).  The more people try this the more we can verify it and improve it.  And! if it works we can suggest it to Apple as a fix that they can rollout through updates

  • by Setsuna666,

    Setsuna666 Setsuna666 May 17, 2014 9:26 AM in response to antzcrashing
    Level 1 (0 points)
    May 17, 2014 9:26 AM in response to antzcrashing

    I doubt Apple would add this as a fix through their updates system since it is more a hack than an actual fix.

     

    I'm sure they can manage to fix it properly.

     

    The more people testing it, the better :)

     

    Thanks

  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 10:04 AM in response to Setsuna666
    Level 1 (0 points)
    May 17, 2014 10:04 AM in response to Setsuna666

    Does the readme specify a location to run the installer from?  Can it be run from anywhere? Wondering if mine was not installed properly amd hence not uninstalled properly as you suggested

  • by Setsuna666,

    Setsuna666 Setsuna666 May 17, 2014 10:05 AM in response to antzcrashing
    Level 1 (0 points)
    May 17, 2014 10:05 AM in response to antzcrashing

    You need to download the zip file and run it from the extracted folder.

  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 10:17 AM in response to Setsuna666
    Level 1 (0 points)
    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

  • by Setsuna666,

    Setsuna666 Setsuna666 May 17, 2014 10:19 AM in response to antzcrashing
    Level 1 (0 points)
    May 17, 2014 10:19 AM in response to antzcrashing

    Oh, I see the issue. Will look into this and post a fix.

     

    Thanks for the log.

  • by Setsuna666,

    Setsuna666 Setsuna666 May 17, 2014 11:07 AM in response to Setsuna666
    Level 1 (0 points)
    May 17, 2014 11:07 AM in response to Setsuna666

    Just made an update to fix the wget errors. Now it should work properly. Here is the link: https://github.com/Setsuna666/osx-wifibtfix/archive/v1.0.3.zip

  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 11:55 AM in response to Setsuna666
    Level 1 (0 points)
    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

  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 11:56 AM in response to antzcrashing
    Level 1 (0 points)
    May 17, 2014 11:56 AM in response to antzcrashing

    The uninstaller appears to work with output:

     

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

    Password:

    Uninstalling blueutil...

    Uninstalling SleepWatcher...

    Stopping SleepWatcher...

    Uninstall finished

  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 11:59 AM in response to antzcrashing
    Level 1 (0 points)
    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

Page 1 Next