Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Impossible to pair Apple Wireless Keyboard (A1016) after update to Monterey 12.0.1

I have trouble pairing again my white Apple Wireless Keyboard (2003) (S/N M9270LL/A or A1016) to my 15-inch 2016 MacBook Pro after update to Monterey 12.0.1. Here is how the problem unfolds:


  1. Device turned on and in 'Discovery' mode, it appears in the 'Bluetooth' panel in 'System Preferences', in the list of unpaired devices.
  2. By clicking on 'Connect' button, nothing happens until 'Return' key is pressed.
  3. Then, the panel indicating the 6-digit 'Passkey' appears and then immediately disappears.
  4. If no key is pressed though, the panel never appears and pairing simply fails; then the Connect button is clickable again within approximately 20 seconds.
  5. Device status in BT panel then indicates 'Passkey doesn't match' (as I was unable to enter the passkey anyway).


I have tried turning Bluetooth off and on, rebooting Mac and reseting SMC+PRAM countless times, as well as replacing the batteries. Since I own two of these I tried with both and the problem is exactly the same. The two worked seamlessly on that computer before the update. I haven't got another computer to test them on unfortunately. My other BT peripherals connect fine to that same computer.


Please note that I was unable to reset the Bluetooth module or delete all devices since these options don't seem to be present anymore by opening Bluetooth menu in Menu Bar while pressing alt+shift after update to Monterey, sadly.


I also tried pairing using blueutil in Terminal however it's the same problem: nothing happens until I press return. As soon as I press return, pairing immediately fails without giving me the opportunity to enter the passcode. If I try to enter the 6-digit code then return, it does the same as it doesn't recognize the passcode I entered. Here is the error messages:


alexis@macbook-pro ~ % blueutil --pair 00-0a-95-45-9b-58 123123
Input pin 123123 on "Apple Wireless Keyboard" (00-0a-95-45-9b-58)
2021-10-31 08:44:43.900 blueutil[2637:220491] IOBluetoothDevicePair BluetoothHCIPINCodeRequestReply - 0
2021-10-31 08:44:44.466 blueutil[2637:220493] -[IOBluetoothDevicePair peerPairingCompleted:withError:]: Calling connectionComplete on IOBluetoothDevicePair. Status: 31
2021-10-31 08:44:44.470 blueutil[2637:220493] -[IOBluetoothDevicePair peerPairingCompleted:withError:]: Calling connectionComplete on IOBluetoothDevicePair. Status: 31
Failed to pair "00-0a-95-45-9b-58" with error 0x1f (Unspecified Error)


Note that the phrase "Input pin 123123 on "Apple Wireless Keyboard" doesn't appear UNTIL I press Return on the external keyboard, the terminal stays blank. If I try to enter a passcode and then press Return, it makes no difference, the passkey isn't registered. I also tried with different 6-digit codes with no result.


So to me it doesn't seem to be a problem with the UI but rather with the IOBluetooth API handling the pairing internally. I reported what seems to be a bug to Apple using the provided tool. Please help, I would like to avoid having to downgrade to Big Sur to get my external keyboard to work if possible.


Kind regards,

Posted on Oct 31, 2021 11:27 AM

Reply
Question marked as Best reply

Posted on Dec 8, 2021 3:30 PM

  • Step 1: Install Homebrew for macOS


Copy/paste the following command (taken from the Homebrew website https://brew.sh) into Terminal and type Return

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"


  • Step 2: Install blueutil with Homebrew


Still in Terminal, enter the following command and wait for it to complete:

brew install blueutil


  • Step 3: Use blueutil to discover your Bluetooth peripherals and get its MAC address


Using blueutil is pretty simple. There is a good documentation of what it can do out there, but you can also simply type in Terminal :

blueutil --help


From now on, make sure:

– Your Bluetooth module is on by clicking on the BT icon in the menu bar,

– Your keyboard is in 'Discovery' mode (you just turned it on, it isn't connected to anything else and its green light is blinking)


Run the command:

blueutil --inquiry

to discover the available Bluetooth peripherals in your area. It will give you something like this:


(base) you@your-computer ~ % blueutil --inquiry                    
address: xx-xx-xx-xx-xx-xx, not connected, not favourite, not paired, name: "Apple Wireless Keyboard", recent access date: 2021-11-06 18:22:39 +0000


You may have more than one peripheral here, be careful to select which one is most likely your keyboard. Note the 'address' part. That's the MAC (not Macintosh) address of your keyboard which is its unique network identifier, with x hexadecimal numbers between 0 and f. You want to highlight and copy that part with Cmd+C.


Now that you have your keyboard's MAC address all you have to do is run the following command:

blueutil --pair xx-xx-xx-xx-xx-xx 0000

The '0000' is the PIN key we specify so we have to type the same on the keyboard to finalize pairing. Be careful, here, after you press enter, nothing happens. It's a bug of the current BT API embedded in Monterey. Just wait a few seconds and then enter 0000 and press Return on your external keyboard. Pairing should then be successful and you would be able to use your ancient but nicely designed keyboard with your modern Mac. If not, you can try several things (for which I have no proof they actually help):


  • Reboot your computer
  • Enter the PIN number by using the main keyboard, or conversely, the numeric keypad
  • Make sure that your keyboard isn't already paired — with blueutil, you can check that by running the command blueutil --paired
  • Reset your computer's SMC and NVRAM (How to reset the SMC of your Mac - Apple Support https://support.apple.com/en-us/HT204063)
  • Reset the keyboard by removing the batteries for ~20 seconds, putting them back in and turning the keyboard on again
  • Replace the batteries


Mine was reluctant to pair until I reset the SMC and PRAM once more. Good luck!

35 replies
Question marked as Best reply

Dec 8, 2021 3:30 PM in response to harriswelles

  • Step 1: Install Homebrew for macOS


Copy/paste the following command (taken from the Homebrew website https://brew.sh) into Terminal and type Return

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"


  • Step 2: Install blueutil with Homebrew


Still in Terminal, enter the following command and wait for it to complete:

brew install blueutil


  • Step 3: Use blueutil to discover your Bluetooth peripherals and get its MAC address


Using blueutil is pretty simple. There is a good documentation of what it can do out there, but you can also simply type in Terminal :

blueutil --help


From now on, make sure:

– Your Bluetooth module is on by clicking on the BT icon in the menu bar,

– Your keyboard is in 'Discovery' mode (you just turned it on, it isn't connected to anything else and its green light is blinking)


Run the command:

blueutil --inquiry

to discover the available Bluetooth peripherals in your area. It will give you something like this:


(base) you@your-computer ~ % blueutil --inquiry                    
address: xx-xx-xx-xx-xx-xx, not connected, not favourite, not paired, name: "Apple Wireless Keyboard", recent access date: 2021-11-06 18:22:39 +0000


You may have more than one peripheral here, be careful to select which one is most likely your keyboard. Note the 'address' part. That's the MAC (not Macintosh) address of your keyboard which is its unique network identifier, with x hexadecimal numbers between 0 and f. You want to highlight and copy that part with Cmd+C.


Now that you have your keyboard's MAC address all you have to do is run the following command:

blueutil --pair xx-xx-xx-xx-xx-xx 0000

The '0000' is the PIN key we specify so we have to type the same on the keyboard to finalize pairing. Be careful, here, after you press enter, nothing happens. It's a bug of the current BT API embedded in Monterey. Just wait a few seconds and then enter 0000 and press Return on your external keyboard. Pairing should then be successful and you would be able to use your ancient but nicely designed keyboard with your modern Mac. If not, you can try several things (for which I have no proof they actually help):


  • Reboot your computer
  • Enter the PIN number by using the main keyboard, or conversely, the numeric keypad
  • Make sure that your keyboard isn't already paired — with blueutil, you can check that by running the command blueutil --paired
  • Reset your computer's SMC and NVRAM (How to reset the SMC of your Mac - Apple Support https://support.apple.com/en-us/HT204063)
  • Reset the keyboard by removing the batteries for ~20 seconds, putting them back in and turning the keyboard on again
  • Replace the batteries


Mine was reluctant to pair until I reset the SMC and PRAM once more. Good luck!

Nov 6, 2021 11:23 AM in response to Phil Song

Thank you, but that doesn't solve anything for me. The log in Terminal is still exactly the same as before.


(base) alexis@macbook-pro-de-alexis ~ % blueutil --inquiry                    
address: 00-0a-95-3d-8e-83, not connected, not favourite, not paired, name: "Apple Wireless Keyboard", recent access date: 2021-11-06 18:22:39 +0000
(base) alexis@macbook-pro-de-alexis ~ % blueutil --pair 00-0a-95-3d-8e-83 0000
Input pin 0000 on "Apple Wireless Keyboard" (00-0a-95-3d-8e-83)
2021-11-06 19:22:56.457 blueutil[18651:1804279] IOBluetoothDevicePair BluetoothHCIPINCodeRequestReply - 0
2021-11-06 19:22:56.764 blueutil[18651:1804284] -[IOBluetoothDevicePair peerPairingCompleted:withError:]: Calling connectionComplete on IOBluetoothDevicePair. Status: 31
Failed to pair "00-0a-95-3d-8e-83" with error 0x1f (Unspecified Error)
(base) alexis@macbook-pro-de-alexis ~ % 


If anybody has another solution, I'll be glad. Many thanks,

Dec 29, 2021 4:20 PM in response to Phil Song

First, Thanks to Sesame for the detailed terminal instructions and code. Unfortunately, they didn't work for me. However, I followed Phil's advice and just kept entering 0000 then Enter and it finally paired. My guess is that there's something in the new code that doesn't send instructions to present the code and you just have to hope your 0000+Enter combination hits at the right time.


Mar 22, 2022 9:00 PM in response to What_is_a_sesame

Hey, what_is_a_sesame! I just want to thank you for the detailed help. I'm currently using my old A1016, which I've had in my drawer for the last several years, waiting for the time to come for me to need it again. And I've spent the last few days banging my head against the wall trying to get it to work again - it would not connect! All the same issues you describe in the original post, and everyone else seem to have. BUT your advice, specifically by installing homebrew, and manually inputting the MAC address for the keyboard finally did the trick! I can't thank you enough. peace and love

May 21, 2022 5:34 AM in response to harriswelles

Good afternoon from suny and hot Spain......

"What is a sesame" has been very helpful with his instructions but the only thing I find confusing is which keyboard to use to enter 0000 after introducing: "blueutil --pair xx-xx-xx-xx-xx-xx" with a different external keyboard not being the good old A1016. Should 0000 and enter be done with the A1016?? Thank you very much!!

Impossible to pair Apple Wireless Keyboard (A1016) after update to Monterey 12.0.1

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