HOWTO · Raspberry Pi
How to Use Bluetooth on Raspberry Pi OS
This article explains basic operations for Bluetooth functionality on select Raspberry Pi devices.
On this page
This guide shows how to use bluetoothctl on Raspberry Pi OS to find, pair, connect to, and disconnect from a Bluetooth device. It also covers choosing a controller, removing a saved device, and turning off discoverability. Commands shown as prompt entries are typed after starting bluetoothctl; replace each example address with the address reported by your own system.
Use the bluetoothctl Command Line Control Tool in Raspberry Pi
Start the tool from a terminal with bluetoothctl. At its interactive prompt, enter scan on to search for nearby devices. When the target appears, note its address and use pair DEVICE_ADDRESS to pair it. For example, replace DEVICE_ADDRESS with the device’s actual address, such as AA:BB:CC:DD:EE:FF.
Pairing and connecting are separate operations. After pairing, enter connect DEVICE_ADDRESS to request a connection. To end that connection, enter disconnect DEVICE_ADDRESS. These commands act on the selected Bluetooth controller. To stop discovery after finding a device, enter scan off.
The examples here describe commands, not guaranteed prompt text or output. Results depend on the Bluetooth adapter, the remote device, its state, and the installed BlueZ version. If the command is unavailable, check the Raspberry Pi OS installation and its package documentation for the appropriate Bluetooth tools; package names and installation steps can vary by release.
Managing Multiple Controllers on Raspberry Pi
When the Pi has more than one Bluetooth adapter, identify the controller to use before scanning or managing devices. At the bluetoothctl prompt, enter list to display available controllers and their addresses. Then enter select CONTROLLER_ADDRESS, substituting the address of the intended adapter. Subsequent Bluetooth operations use the selected controller.
You can also request the controller list directly from a regular terminal with bluetoothctl list. The prompt command select belongs inside the interactive tool. Do not identify a controller by assuming a particular address prefix: hardware and address assignments vary. If you are unsure which adapter corresponds to a listed address, compare the list before selecting it.
Use the bluetoothctl to Remove Saved Devices in Raspberry Pi
At the prompt, enter paired-devices to list devices paired with the selected controller. Choose the address of the device you want to forget, then enter remove DEVICE_ADDRESS. This removes that device’s saved pairing information from the controller. It is different from disconnect, which ends a current connection, and from changing trust settings. Check the address carefully before removing a device.
Make Your Raspberry Pi Undiscoverable Using bluetoothctl
To stop the selected controller from being discoverable to nearby devices, enter discoverable off at the bluetoothctl prompt. This changes discoverability only; it does not turn off the Bluetooth radio or end existing connections. The controller can still participate in Bluetooth operations that do not require other devices to discover it.