EDIT: Use blueutil to pair keyboard via the command line via solution below or:
Pair with a Bluetooth device over Terminal
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 my setup:
- Device turned on and in 'Discovery' mode, it appears in the 'Bluetooth' panel in 'System Preferences', in the list of unpaired devices.
- By clicking on 'Connect' button, nothing happens until 'Return' key is pressed.
- Then, the panel indicating the 6-digit 'Passkey' appears (the Passkey being different each time) and then immediately disappears.
- 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.
- 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 headphones, mouse and DualShock 4 controller pair and connect fine to that same computer.
I was unable to reset the Bluetooth module or delete all devices since you can't have access to these options anymore by opening Bluetooth menu in Menu Bar while pressing alt+shift after update to Monterey.
I do not think I ever saw the line about "Input Pin". If you are pressing return before you press the 0000 on the top of the keyboard that might be your error. I just saw a blinking cursor and after 5-10 seconds of nothing happening, typed 0000 + Return, then got the message that it had paired (with error). But I was then able to "Connect" in the GUI. – doublepluskat Nov 06 '21 at 21:17
peerPairingCompleted:withError:. Then I did 0000 and after about 10 seconds typed that on external KB and it worked. Maybe the magic is just to wait longer. Keep trying if you have this problem – captain Feb 11 '22 at 00:18blueutil --inquiryresult is the Mac address? It seems that this is referring to the device's address as the sequence of numbers and dashes (XX-XX...) after the address, e.g., address: XX-XX-XX-XX-XX-XX, not connected, not favourite, not paired, name: "{Device name}", recent access date: 2022-08-18 17:03:36 +0000. – AdamHurwitz Aug 18 '22 at 17:06--paircommand with the keyboard's Mac address and I am receiving an error: Status: 31 Failed to pair "{XX-XX-XX-XX-XX-XX" with error 0x1f (Unspecified Error) – AdamHurwitz Aug 18 '22 at 17:26