Make your Raspberry Pi 4 more convenient with wireless typing!
Learn how to connect a Bluetooth keyboard to your Raspberry Pi 4 for hands-free computing. Follow these simple steps and say goodbye to wires forever! …
Updated October 15, 2023
Learn how to connect a Bluetooth keyboard to your Raspberry Pi 4 for hands-free computing. Follow these simple steps and say goodbye to wires forever!
Are you tired of using wired keyboards with your Raspberry Pi 4? Want to type without having to worry about tangled cords or finding a USB port? Look no further - connecting a Bluetooth keyboard to your Raspberry Pi 4 is easier than you think! In this guide, we will walk you through the process step-by-step.
Step 1: Prepare Your Hardware
To get started, you will need the following:
- A Raspberry Pi 4 with the latest version of Raspbian installed (or any other Linux-based OS).
- A Bluetooth keyboard compatible with Linux. Most modern keyboards should work fine, but check your device’s specifications if you have any doubts.
- A USB Bluetooth dongle or built-in Bluetooth support on your Pi 4 (Model B).
Step 2: Enable Bluetooth on the Raspberry Pi
First, make sure that your Raspberry Pi has Bluetooth enabled. You can check this by running the following command in the terminal:
sudo systemctl status bluetooth
If the output shows that the Bluetooth service is not active, run the following commands to enable it:
sudo systemctl enable bluetooth
sudo systemctl start bluetooth
Step 3: Pair Your Keyboard with Raspberry Pi
Now, it’s time to pair your keyboard with the Raspberry Pi. Make sure your Bluetooth keyboard is turned on and ready to pair. Run the following command in the terminal:
bluetoothctl
This will open a new prompt with bluetoothctl. Inside this prompt, run the following commands one by one:
power on
- This turns on your Raspberry Pi’s Bluetooth adapter.agent on
- Enables pairing mode.default-agent
- Selects the default pairing agent.scan on
- Scans for nearby devices that can be paired. Look for your keyboard in the list of available devices.- Once you find your keyboard, note its MAC address (it should look something like
XX:XX:XX:XX:XX:XX
). Then, run the following command, replacingXX:XX:XX:XX:XX:XX
with your keyboard’s MAC address:
pair XX:XX:XX:XX:XX:XX
- You will be prompted to enter a PIN or passkey for your keyboard. Most keyboards use the default PIN of
00000
, so you can just press Enter when asked. If your keyboard requires a different PIN, enter it now. - Wait for the pairing process to complete and confirm that your keyboard is paired successfully by running:
paired-devices
- To exit bluetoothctl, type
quit
.
Step 4: Connect Your Keyboard
Now that your keyboard is paired, you just need to connect it. Run the following command in the terminal:
bluetoothctl
Then, enter the following commands one by one:
power on
- Turns on Bluetooth if it’s not already active.connect XX:XX:XX:XX:XX:XX
- ReplaceXX:XX:XX:XX:XX
with your keyboard’s MAC address to connect.- To verify that the connection was successful, run:
info XX:XX:XX:XX:XX:XX
- If everything is working correctly, you should see a “Connected: yes” message in the output. Type
quit
to exit bluetoothctl.
That’s it! You have successfully connected your Bluetooth keyboard to your Raspberry Pi 4. Now you can sit back, relax, and enjoy wireless typing on your Linux-powered device.