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

Previous Page 2
  • by Setsuna666,

    Setsuna666 Setsuna666 May 17, 2014 12:06 PM in response to antzcrashing
    Level 1 (0 points)
    May 17, 2014 12:06 PM in response to antzcrashing

    Yeah, I think I know what the issue is. Let me check and do some more tests before releasing a new version.

     

    Thanks again for the help.

  • by Setsuna666,

    Setsuna666 Setsuna666 May 17, 2014 12:10 PM in response to Setsuna666
    Level 1 (0 points)
    May 17, 2014 12:10 PM in response to Setsuna666

    From what I gathered, you are running the script as root and not as your user, so that seems to be the issue. I added a check to make sure it is run as the user and not root.

  • by Setsuna666,

    Setsuna666 Setsuna666 May 17, 2014 12:43 PM in response to Setsuna666
    Level 1 (0 points)
    May 17, 2014 12:43 PM in response to Setsuna666

    Just published a new version with some fixes.

     

    It can be download here: https://github.com/Setsuna666/osx-wifibtfix/archive/v1.0.4.zip

  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 1:24 PM in response to Setsuna666
    Level 1 (0 points)
    May 17, 2014 1:24 PM in response to Setsuna666

    I receive the following output when I try the install:

     

    again does not seems to be working (does not turn on BT 10s after wait as it did the very first time)

     

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

    Password:

    1. install.sh: line 12: cd: /Users/Jeffrey/Documents/OS: No such file or directory

    Installing Wifi/BT fix by Setsuna666...

    Script as been executed as root, please run it again as a user (without sudo)

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

    1. install.sh: line 12: cd: /Users/Jeffrey/Documents/OS: No such file or directory

    Installing Wifi/BT fix by Setsuna666...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

    Downloading SleepWatcher...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

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

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

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

                                     Dload  Upload Total   Spent    Left Speed

    100 43385  100 43385 0     0  50263 0 --:--:-- --:--:-- --:--:-- 50272

    Extracting SleepWatcher...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

    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...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

    Installing SleepWatcher...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

    Copying SleepWatcher configuration...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

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

    cp: Stuff/MAC/osx-wifibtfix-1.0.4/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.4/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...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

    Downloading blueutil...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

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

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

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

                                     Dload  Upload Total   Spent    Left Speed

    100 33343  100 33343 0     0  13110 0  0:00:02  0:00:02 --:--:-- 13106

    Mounting blueutil disk image...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

    /dev/disk2              Apple_partition_scheme          

    /dev/disk2s1            Apple_partition_map             

    /dev/disk2s2            Apple_HFS                        /Volumes/blueutil

    Installing blueutil...

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

     

    Finished installing Wifi/BT fix

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

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

    ./lib/functions.sh: line 5: //tmp//wifi-bt-fix.log: Permission denied

  • by antzcrashing,

    antzcrashing antzcrashing May 17, 2014 1:25 PM in response to antzcrashing
    Level 1 (0 points)
    May 17, 2014 1:25 PM in response to antzcrashing

    uninstall gives the following output:

     

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

    1. uninstall.sh: line 10: cd: /Users/Jeffrey/Documents/OS: No such file or directory

    Uninstalling blueutil...

    ./lib/functions.sh: line 5: //wifi-bt-fix.log: Permission denied

    Uninstalling SleepWatcher...

    ./lib/functions.sh: line 5: //wifi-bt-fix.log: Permission denied

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

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

    Stopping SleepWatcher...

    ./lib/functions.sh: line 5: //wifi-bt-fix.log: Permission denied

    Uninstall finished

    ./lib/functions.sh: line 5: //wifi-bt-fix.log: Permission denied

  • by Jon Bo,

    Jon Bo Jon Bo May 30, 2014 4:31 PM in response to Setsuna666
    Level 1 (5 points)
    May 30, 2014 4:31 PM in response to Setsuna666

    Setsuna666 can you please provide the source code for the binaries your script installs? How can you guarantee that this software is not a spyware and without a backdoor ?

     

    All users, please read carefully about potential risks of installing "custom" software of unknown origin:

    http://en.wikipedia.org/wiki/Malware#Backdoors

     

    Best solution would be to open all sources and to allow users to build the full solution from sources.

  • by Setsuna666,

    Setsuna666 Setsuna666 May 30, 2014 4:51 PM in response to Jon Bo
    Level 1 (0 points)
    May 30, 2014 4:51 PM in response to Jon Bo

    All the binaries used in my script aren't developed by me, so unless they are already open source, I can't so much. But, as for malwares, this could be said for all closed source software. 

  • by Setsuna666,

    Setsuna666 Setsuna666 May 30, 2014 4:53 PM in response to Setsuna666
    Level 1 (0 points)
    May 30, 2014 4:53 PM in response to Setsuna666

    Even if the code to theses binaries was open, unless someone did an audit on the code itself, you can't guarantee that it is truly secure. Making it open source doesn't guarantee that.

  • by antzcrashing,

    antzcrashing antzcrashing May 30, 2014 6:32 PM in response to Jon Bo
    Level 1 (0 points)
    May 30, 2014 6:32 PM in response to Jon Bo

    I Have tested the code provided and it appears to work.  However since I could not install without sudo access, and uninstall and reinstalling failed, I have since reverted to a backup version of my OS.  I am waiting for another commit before I reattempt.  The idea and code seems promising

  • by Fryguy9,

    Fryguy9 Fryguy9 Jun 3, 2014 9:15 AM in response to Setsuna666
    Level 1 (0 points)
    Jun 3, 2014 9:15 AM in response to Setsuna666

    I didn't realize you created your own thread for this utility, and replied in the other thread, so I'll copy it here:

     

    sleepwatcher and blueutil are both available via Homebrew.  With Homebrew the installation becomes

     

    - brew install sleepwatcher blueutil

    - ln -sfv /usr/local/opt/sleepwatcher/*.plist ~/Library/LaunchAgents

     

    And uninstallation is

     

    - brew uninstall sleepwatcher blueutil

    - rm -rf ~/Library/LaunchAgents/de.bernhard-baehr.sleepwatcher*

  • by Setsuna666,

    Setsuna666 Setsuna666 Jun 3, 2014 9:17 AM in response to Fryguy9
    Level 1 (0 points)
    Jun 3, 2014 9:17 AM in response to Fryguy9

    Nice, didn't even think of checking if it was included in homebrew. Will look into integrating this into the script.

     

    Thanks for the input.

Previous Page 2