Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I seem to be having persistent issues with Bluetooth connectivity, especially after waking up my Macbook Pro from a long sleep.

I have a speaker that automatically turns off after a certain period of inactivity, and my use case typically is open the laptop, turn the speaker on, and when the Bluetooth driver is acting normal, they will automatically reconnect.

However, the problem seem to be that the my Bluetooth peripherals do not reconnect if my Macbook has just been woken up from a long sleep.

After searching around, I found this script to relaunch the bluetooth kernel extensions, but it didn't seem to work on Yosemite.

Here's what sudo tail -f /var/log/system.log gave me after doing a kextload and kextunload (hostname and username redacted):

Nov 17 07:50:11 {redacted} sudo[8118]: username: TTY=ttys000 ; PWD=/Users/username; USER=root ; COMMAND=/sbin/kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
Nov 17 07:50:11 {redacted} kernel[0]: IOBluetoothUSBDFU::probe
Nov 17 07:50:11 {redacted} kernel[0]: IOBluetoothUSBDFU::probe ProductID - 0x821D FirmwareVersion - 0x0147
Nov 17 07:50:11 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][start] -- completed -- result = TRUE -- 0x0800 ****
Nov 17 07:50:11 {redacted} kernel[0]: **** [BroadcomBluetoothHostControllerUSBTransport][start] -- Completed -- 0x0800 ****
Nov 17 07:50:11 {redacted} kernel[0]: [IOBluetoothHCIController][staticBluetoothTransportShowsUp] -- Received Bluetooth Controller register service notification -- 0x0800 
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][initHardwareWL] -- failed -- calling DoDeviceReset (kBluetoothControllerResetHub) -- 0x0800 ****
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][DoDeviceReset] -- thread_call_enter1 (mReEnumerateOrResetThread) -- reEnumerateOrReset (0xffffff8213ac3ae0) = 2 --  returned FALSE -- 0x0800 ****
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHCIController][ProcessBluetoothTransportShowsUpActionWL] -- Error!! -- Something went wrong in the setup process. Could not communicate with Bluetooth Transport successfully -- 0x0800 -- 0x0800 ****
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrResetThreadEntry] -- entering -- param0 = 0xffffff806a870800, param1 = 0x2 -- 0x0800
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrReset] -- entering -- reEnumerateOrResetIn = 2 -- this = 0x0800 ****
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrReset] -- in our workloop -- 0x0800 ****
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrReset] -- parameter is valid -- 0x0800 ****
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrReset] -- reEnumerateOrReset = 2 -- 0x0800 ****
Nov 17 07:50:12 {redacted} kernel[0]: [IOBluetoothHostControllerUSBTransport][ReEnumerateOrReset] -- calling myHub->ReEnumerateDevice() -- gEnumerateCounter = 1 
Nov 17 07:50:12 {redacted} kernel[0]: [IOBluetoothHostControllerUSBTransport][ReEnumerateOrReset] -- exit; error = 0x0000 (kIOReturnSuccess)
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ReEnumerateOrResetThreadEntry] -- exiting -- 0x0800
Nov 17 07:50:12 {redacted} kernel[0]: IOBluetoothUSBDFU::probe
Nov 17 07:50:12 {redacted} kernel[0]: IOBluetoothUSBDFU::probe ProductID - 0x821D FirmwareVersion - 0x0147
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHostControllerUSBTransport][start] -- completed -- result = TRUE -- 0x0800 ****
Nov 17 07:50:12 {redacted} kernel[0]: **** [BroadcomBluetoothHostControllerUSBTransport][start] -- Completed -- 0x0800 ****
Nov 17 07:50:12 {redacted} kernel[0]: [IOBluetoothHCIController][staticBluetoothTransportShowsUp] -- Received Bluetooth Controller register service notification -- 0x0800 
Nov 17 07:50:12 {redacted} kernel[0]: [IOBluetoothHCIController::setConfigState] calling registerService
Nov 17 07:50:12 {redacted} kernel[0]: **** [IOBluetoothHCIController][ProcessBluetoothTransportShowsUpActionWL] -- Connected to the transport successfully -- 0xe300 -- 0x0800 -- 0x0800 ****
Nov 17 07:50:12 {redacted} sharingd[367]: 07:50:12.595 : SDStatusMonitor::kStatusBluetoothPowerChanged
Nov 17 07:50:12 {redacted} sharingd[367]: 07:50:12.617 : SDStatusMonitor::kStatusBluetoothPowerChanged
Nov 17 07:50:12 {redacted} sharingd[367]: 07:50:12.637 : SDStatusMonitor::kStatusBluetoothPowerChanged
Nov 17 07:50:12 {redacted} sharingd[367]: 07:50:12.657 : SDStatusMonitor::kStatusBluetoothPowerChanged
Nov 17 07:50:12 {redacted} sharingd[367]: 07:50:12.659 : BTLE scanner Powered Off
Nov 17 07:50:12 --- last message repeated 2 times ---
Nov 17 07:50:12 {redacted} coreaudiod[360]: 2014-11-17 07:50:12.663673 AM [AirPlay] BTLE client stopping to browse for AirPlay Solo Target Presence.
Nov 17 07:50:12 {redacted} blued[62]: hciControllerOnline; HID devices? 0
Nov 17 07:50:12 {redacted} coreaudiod[360]: 2014-11-17 07:50:12.663868 AM [AirPlay] BTLE client starting to browse for AirPlay Solo Target Presence.
Nov 17 07:50:12 {redacted} sharingd[367]: 07:50:12.664 : Starting Handoff scanning
Nov 17 07:50:12 {redacted} coreaudiod[360]: 2014-11-17 07:50:12.664336 AM [AirPlay] BTLE client stopped to browse for AirPlay Solo Target Presence.
Nov 17 07:50:12 {redacted} coreaudiod[360]: 2014-11-17 07:50:12.664753 AM [AirPlay] BTLE client started to browse for AirPlay Solo Target Presence.
Nov 17 07:50:12 {redacted} sharingd[367]: 07:50:12.664 : Stopping Handoff advertising
Nov 17 07:50:12 {redacted} sharingd[367]: 07:50:12.665 : BTLE scanner Powered On
Nov 17 07:50:12 {redacted} blued[62]: hostControllerOnline - Number of Paired devices = 2, List of Paired devices = (
      "00-0c-8a-dd-fd-88",
      "84-38-35-ec-1c-ea"
  )
Nov 17 07:50:13 {redacted} kernel[0]: AppleUSBMultitouchDriver::message - kIOUSBMessagePortHasBeenReset.
Nov 17 07:50:13 {redacted} kernel[0]: AppleUSBMultitouchDriver::checkStatus - received Status Packet, Payload 2: device was reinitialized
Nov 17 07:50:13 {redacted} hidd[74]: MultitouchHID: device bootloaded
Nov 17 07:50:13 {redacted} kernel[0]: AppleUSBMultitouchDriver::_deviceGetReport - DeviceRequest for reportID 0xc8 returned with result 0xe000404f - retrying

uname -a output (hostname redacted):

$ uname -a
Darwin {redacted} 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

Has any of you seen this problem before? Any help would be appreciated.

share|improve this question
    
Try to hold mouse button for 2 secs after your Mac woke up. My MagicMouse connects after this. May be side effect of intentional design to save battery while idle or something. – Yaroslav Admin Feb 12 '15 at 15:03
    
This happens to me sometimes. The other symptom is that nothing happens if I try to turn Bluetooth off. @webaholik solution fixed my Bluetooth. – Bennett McElwee Feb 9 at 21:31
up vote 43 down vote accepted

I've had issues reconnecting my bluetooth keyboard & trackpad since upgrading to Yosimite.

First try this: Open Terminal & run 2 commands:

sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport

I only had to run above once. If later bluetooth breaks again 2 options, simply run above again or you can create a 1-click solution with a simple app using Automator:

  1. Search for (Spotlight search) and run Automator
  2. Click "New Document" at bottom
  3. Choose "Application" for new file type
  4. Click on "Utilities" from list
  5. Double-Click "Run AppleScript"
  6. Replace (* Your script goes here *) with:

    do shell script "kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport; 
    kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport" with administrator privileges
    
  7. Press play to test (will prompt for password)
  8. File->Save to desktop or wherever

Run the automator app whenever bluetooth devices won't connect

share|improve this answer
1  
Hmm, I think that was what I tried above as the log suggests, and it didn't help. Maybe I'll try this again. – Ivan Gozali Nov 26 '14 at 18:22
    
In your log, I didn't see: kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport, only kextload, just make sure you run unload first. I've only had to run this once (last week), previously almost daily I was having to restart whenever trying to wake my macbook pro up and connect to my bluetooth keyboard & mouse. – webaholik Dec 1 '14 at 16:30
    
It works! Thanks! Also curious to know if it happens to you randomly or after the laptop sleeps and is woken up? – Ivan Gozali Dec 3 '14 at 4:37
2  
I have made a script to install sleepwatcher and run those to commands every time the computer wakes from sleep, which has completely eliminated the problem from me: gist.github.com/Tyilo/c92684d277acb62272b5 – Tyilo Dec 13 '14 at 1:46
1  
@delphirules I may have had a formatting problem, try again, should work – webaholik Jun 19 '15 at 1:41

Mikaey's solution on the apple support forum:

  1. Turn your WiFi off
  2. Try re-connecting to your bluetooth devices (should work)
  3. Turn WiFi back on

This has solved the issue for me.

share|improve this answer
1  
Indeed, I remember this working for me on occasions as well. And more specifically, the issue was when connected to 5GHz wifi. – haylem Apr 28 '15 at 8:15
    
I did this when I first encountered the problem, turned everything off and back on in different sequences and it did not solve my issue. The bluetooth device simply did not want to connect to the mac after sleep. – DataHerder Jul 4 '15 at 5:27
1  
This solution worked for me. :) And I was using 5GHz Wifi, as @haylem. – Greg Dubicki Sep 23 '15 at 7:33
1  
...but the next time I had this issue I had to use @webaholik's solution. – Greg Dubicki Oct 22 '15 at 7:45

After trying to run the scripts suggested by other answers, unloading and reloading both the kext and the bluetooth daemon, my bluetooth still wasn't responding.

However, I have discovered that if Yosemite sleeps with VMWare running and bluetooth doesn't work when the OS is woken up, closing VMWare rectifies the issue.

It seems that the drivers in VMWare don't always handle the sleep / wake process correctly.

share|improve this answer
    
I noticed the same thing. VMWare was the problem. After suspending virtual machine, bluetooth started working again. – gappani Sep 21 '15 at 6:18
    
Awesome, thanks! This worked for me! – Ken Sykora Oct 22 '15 at 13:05

-- UPDATE: This problem is fixed in OSX 10.11 El Capitan --

The following is an alternative to the Automator solution posted by webaholic, for those who, like me, find inconvenient having to entering your password again (most likely you'll have just entered it to logon after waking your Mac up).

First, in Terminal, create a script that reloads the bluetooth subsystem:

cat > bt_restart <<END
#!/bin/bash
kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
kextload -b $BTKEXT com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
END
chmod +x bt_restart

Second, make root its owner and move it to /sbin:

sudo chown root:wheel bt_restart
sudo mv bt_restart /sbin

Third, add the command to the list of NOPASSWD commands in sudoers:

sudo bash -c 'echo -e "\n\n# Restart bluetooth without password\n$USER ALL=(ALL) NOPASSWD: /sbin/bt_restart" >> /etc/sudoers'

Finally, create a script on your desktop that calls bt_restart:

cat > ~/Desktop/"Restart Bluetooth" <<END
#!/bin/bash
sudo /sbin/bt_restart
END
chmod +x ~/Desktop/"Restart Bluetooth"

Done! Just double-click with your notebook's trackpad (or USB mouse) on the Restart Bluetooth on your Desktop.

share|improve this answer
    
typo when changing owner, should be chown not chmod - tried to edit myself, but no cred here and edit was below a length limit :-/ – Ralph Callaway Oct 27 '15 at 20:18
1  
at least on my machine, i get a permission error when trying to modify /etc/sudoers, as an alternative you can edit the file directly with sudo visudo – Ralph Callaway Oct 27 '15 at 20:32

I had the same problem and I think I spotted a possible cause of the problem. My mouse was called "My Name's mouse" with the apostrophe, maybe that was causing the errors.

I have changed the name to avoid using spaces and special characters, now is called just "mymouse" and I don't seem to have the problem anymore.

share|improve this answer
    
This looks interesting. Basically rename the Bluetooth device to not contain spaces. I'll give it a shot. – Ivan Gozali Nov 26 '14 at 18:23

Thanks to Tyilo from the comments on the accepted answer, I have modified his script to install sleepwatcher and append to the script some code that will not only unload the Bluetooth driver (com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport), but also restart blued, Apple's Bluetooth daemon.

The script can be found here: https://gist.github.com/timgws/fc63aeca6a248bbb25ff

Running this has resolved all the issues for me.

share|improve this answer

To summarize, here's a list of things mentioned here, in links from here, in similar threads at other sites, or even made up by me reasoning from those others. I've tried all of these, singly and in many combinations. All of them have seemed to work at least once; all have failed at least once.

  • new mouse batteries
  • remove and re-pair mouse
  • turn off WiFi and mouse; connect Bluetooth mouse; restore WiFi
  • turn off WiFi, mouse, and VPN; connect; restore
  • delete Bluetooth PAN; connect
  • kextunload/load USBTransport; connect
  • wire kextunload to sleepwatcher; sleep; awake; connect
  • disconnect all USB connectors (heck, all connectors); connect
  • log out; log in; connect
  • restart; log in; connect
  • reset SMC (which involves "shut down"); restart; log in connect
  • shut down VM hosting (such as VMWare, Parallels, or VirtualBox)

I choose to keep this list handy, and use "all of the above."

I think the only thing that's certain, here, is that there's a large dose of "random" involved somewhere, perhaps a race among all these drivers for networks, pseudo networks, layered networks, virtual networks, and proxy networks. In which case, it's probably not merely Apple's fault, because those drivers come from a variety of sources.

Of course, Apple's once-famous "just works" reputation was largely built on forbidding exactly this kind of colliding diversity.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.