Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

headhog70

macrumors newbie
Original poster
Oct 14, 2013
15
0
Dayton, OH
I cannot turn off Bluetooth on my iMac, 27-inch, Late 2013, Version 10.12.1.

I click on the Bluetooth icon in the menu bar and then click Turn Bluetooth Off. I then get this error message: You cannot control your computer if you turn Bluetooth off at this time.

I have no Bluetooth devices connected. System Report for Bluetooth does not show any connected devices.

Using Bluetooth Debug I have Reset the Bluetooth Module, Factory Reset all connected Apple devices, and Removed all devices.

I cannot turn off Bluetooth in Safe Mode.

I did SMC and PRAM Resets.

I reloaded the operating system.

Apple Care says next step is taking computer in for repair.

Is there anything else I should try before taking the iMac to Apple store?
 

997440

Cancelled
Oct 11, 2015
938
664

headhog70

macrumors newbie
Original poster
Oct 14, 2013
15
0
Dayton, OH
Thanks for your reply. I always use a wired keyboard and mouse. Also deleted BT plist. Problem is still there.
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
Have you tried this also?
Code:
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState -bool NO && sudo pkill -HUP blued
 

headhog70

macrumors newbie
Original poster
Oct 14, 2013
15
0
Dayton, OH
I have not tried anything with com.apple.Bluetooth.plist. This is beyond my skill level. I am hesitant to try something that I don't completely understand or cannot undo. In my previous post I said I deleted BT plist. What I did was rename com.apple.BluetoothFileExchange.plist to BluetoothFileExchangeOLD.plist. This was obviously just trying anything at that point.
Could you briefly say what the sudo defaults write does and how to undo it if necessary?
Thanks for your help.
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
BluetoothFileExchange.plist is something else entirely.

In short, it changes the configuration for the Bluetooth process and tells it to re-check its configuration and quit/start if appropriate.

sudo is a command that executes the command thereafter as another user, in this case as the root user (because the
com.apple.Bluetooth.plist file is owned by root). defaults is a system command that modifies .plist files directly, without having to use a text editor. What it does is change (‘write’) the key ‘ControllerPowerState’ within it to the boolean value false (’NO’). By default, this value is set to true (‘YES’). ControllerPowerState is the key that determines whether the Bluetooth process should be running, if it is set to false, then the Bluetooth process will not run. The ‘&&’ connects this command to the next command. pkill is another system command with which you can terminate running processes, much like quitting via the menu bar or the Dock. ‘-HUP’ is a signal that tells the process to ‘hang up’ and re-evaluate its configuration (in this case the Bluetooth.plist file). blued is the name of the Bluetooth process (Bluetooth daemon).

When you disable Bluetooth in System Preferences, then the system modifies this key as well. With Terminal you can do that directly without having to deal with this weird error in System Preferences.

You can verify the current state of ‘ControllerPowerState’ with this command. This will just read the information from the file.
Code:
defaults read /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState

When it returns a 1 it is set to true (default), a 0 when it is false. False is what you want.

To reverse it, you can just enable Bluetooth in System Preferences or use the reverse of the first command I gave you:
Code:
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState -bool YES && sudo pkill -HUP blued
 

headhog70

macrumors newbie
Original poster
Oct 14, 2013
15
0
Dayton, OH
I was once the chief engineer for a couple of aircraft. My technical staff rarely gave such accurate and succinct replies such as yours. Thank You.

It of course worked (after entering my password).

This problem was not that critical. I just do not like errors that seem relatively harmless. Sometimes a harmless annoyance brings down an aircraft.
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
I was once the chief engineer for a couple of aircraft. My technical staff rarely gave such accurate and succinct replies such as yours. Thank You.

It of course worked (after entering my password).

This problem was not that critical. I just do not like errors that seem relatively harmless. Sometimes a harmless annoyance brings down an aircraft.

Thanks for the compliment. :)
 

Spudner

macrumors member
Aug 13, 2018
96
5
Canada
BluetoothFileExchange.plist is something else entirely.

In short, it changes the configuration for the Bluetooth process and tells it to re-check its configuration and quit/start if appropriate.

sudo is a command that executes the command thereafter as another user, in this case as the root user (because the
com.apple.Bluetooth.plist file is owned by root). defaults is a system command that modifies .plist files directly, without having to use a text editor. What it does is change (‘write’) the key ‘ControllerPowerState’ within it to the boolean value false (’NO’). By default, this value is set to true (‘YES’). ControllerPowerState is the key that determines whether the Bluetooth process should be running, if it is set to false, then the Bluetooth process will not run. The ‘&&’ connects this command to the next command. pkill is another system command with which you can terminate running processes, much like quitting via the menu bar or the Dock. ‘-HUP’ is a signal that tells the process to ‘hang up’ and re-evaluate its configuration (in this case the Bluetooth.plist file). blued is the name of the Bluetooth process (Bluetooth daemon).

When you disable Bluetooth in System Preferences, then the system modifies this key as well. With Terminal you can do that directly without having to deal with this weird error in System Preferences.

You can verify the current state of ‘ControllerPowerState’ with this command. This will just read the information from the file.
Code:
defaults read /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState

When it returns a 1 it is set to true (default), a 0 when it is false. False is what you want.

To reverse it, you can just enable Bluetooth in System Preferences or use the reverse of the first command I gave you:
Code:
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState -bool YES && sudo pkill -HUP blued

I cannot get it to return a 0. I have no wireless devices connected to the darn thing.

I tried this command: defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0
but got the following error: Could not write domain /Library/Preferences/com.apple.Bluetooth.plist; exiting.
 
Last edited:

Spudner

macrumors member
Aug 13, 2018
96
5
Canada
Thanks for your reply. I always use a wired keyboard and mouse. Also deleted BT plist. Problem is still there.

I'm having the same problem. I never use wireless devices. I only recently turned BT on to check that it wasn't already on, then I couldn't turn it back off.
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
I cannot get it to return a 0. I have no wireless devices connected to the darn thing.

I tried this command: defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0
but got the following error: Could not write domain /Library/Preferences/com.apple.Bluetooth.plist; exiting.

You have to execute the command with elevated privileges (see below). The advice above pertained to older versions of macOS. I cannot tell if it works on modern systems, including Catalina (I have not updated yet).

Bash:
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState -bool NO && sudo pkill -HUP blued
 
  • Like
Reactions: Spudner

Spudner

macrumors member
Aug 13, 2018
96
5
Canada
You have to execute the command with elevated privileges (see below). The advice above pertained to older versions of macOS. I cannot tell if it works on modern systems, including Catalina (I have not updated yet).

Bash:
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState -bool NO && sudo pkill -HUP blued

Thanks. This command worked in Terminal; however, it didn't solve my problem with not being able to disable bluetooth. Do you have to reboot after this command?
 
Last edited:

Spudner

macrumors member
Aug 13, 2018
96
5
Canada
You have to execute the command with elevated privileges (see below). The advice above pertained to older versions of macOS. I cannot tell if it works on modern systems, including Catalina (I have not updated yet).

Bash:
sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState -bool NO && sudo pkill -HUP blued

Just did a reboot. Now the Bluetooth is off! Thanks so much for that. :)
 

poorsillyboy

macrumors newbie
Jun 14, 2021
1
0
If you haven't yet, check out these old ASC threads. At that time, it seems the problem was sometimes resolved (worked around) by plugging in an USB mouse. Another poster deleted their BT plist. Whether this would be appropriate for Sierra, I don't know. Maybe someone else will.

https://discussions.apple.com/thread/2609432?start=0&tstart=0

https://discussions.apple.com/thread/2526613?start=15&tstart=0
Thank you very very much plugging in a USB mouse into the oldest USB slot worked for me! Your awesome!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.