Skip to content

Instantly share code, notes, and snippets.

@tekemperor
Created July 22, 2016 01:46
Show Gist options
  • Save tekemperor/1de33c1743cd34919af78e59076fb444 to your computer and use it in GitHub Desktop.
Save tekemperor/1de33c1743cd34919af78e59076fb444 to your computer and use it in GitHub Desktop.
Connect Apple Wireless Keyboard to Raspberry Pi 3 in Raspbian
sudo service bluetooth status # Verify bluetooth is active.
sudo bluetoothctl # Lauch bluetooth subshell.
agent on # [No idea what this does.]
default-agent # [No idea what this does.]
scan on # Displays a list of available devices.
pair XX:XX:XX:XX:XX:XX # This prepares a potential connection, the X's represent your device ID
# A "PIN code" will be displayed, type it on the keyboard and press "enter".
trust XX:XX:XX:XX:XX:XX # Adds device to trusted devices, this survives reboot.
connect XX:XX:XX:XX:XX:XX # Connect to the device now.
exit # Return to previous shell.
@hym3242
Copy link

hym3242 commented Nov 9, 2021

"agent" is the thing that negotiates with keyboard, displays the PIN code and finishes the pairing. Newer versions of raspbian(raspberry pi os) seem to have agent registered automatically when launching bluetoothctl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment