Raspberry Pi

How to Pair 2 Raspberry Pi Devices over Bluetooth

Bluetooth is a wireless service that allows users to connect devices with each other and perform communication or file-sharing tasks. If you are a Raspberry Pi user and want to connect two different Raspberry Pi devices wirelessly then you can go for Bluetooth pairing between the two devices.

This article presents a detailed guide to pairing 2 Raspberry Pi devices over Bluetooth.

How to Pair 2 Raspberry Pi Devices Over Bluetooth?

The method to pair two Raspberry Pi devices over Bluetooth is mentioned-below in easy steps:

Step 1: First access the desktop of the first Raspberry Pi device and click on the Bluetooth icon present on the top left side of the screen and click the Make Discoverable option from the drop-down list:

The icon will start blinking in green color:

Step 2: Then access the desktop of the second Raspberry Pi device, and click on the Bluetooth icon and repeat the same for the second Raspberry Pi device:

Note: Make sure both Raspberry Pi devices have separate monitor displays.

Step 3: Now open the terminal of any one of the Raspberry Pi devices and type the below-mentioned command to run Bluetooth agent through the terminal:

$ sudo bluetoothctl

Step 4: Once the Bluetooth agent starts, execute the below-mentioned command to scan the available Bluetooth devices:

# scan on

In the output you can see the list of all the discoverable devices appears along with the device address. You have to look for the address of your second Raspberry Pi device here: The Raspberry Pi will appear in the list with Mac Address and the hostname as shown below.

Step 5: Now, use the below-mentioned pair command along with the device address to pair with it:

# pair <device-address>

Enter yes to connect the device as it will send the pairing request to the second Raspberry Pi device.

Step 6: Go to the second Raspberry Pi device screen and accept the pairing request from the first Raspberry Pi device. By clicking on the OK button.

Step 7: Then finally a prompt will appear to confirm that the connection is successful, click OK:

And that’s all, your two Raspberry Pi devices are connected successfully to each other.

Conclusion

To pair two Raspberry Pi devices, first, make both devices discoverable by clicking on the Bluetooth icon for each device. Then open the terminal of the first Raspberry Pi device and register the Bluetooth agent using bluetoothctl command. After that, use the scan command to view the available devices and pair them to the second Raspberry Pi device using the pair command with its Mac address.

About the author

Zahra Zamir

An Electronics graduate who loves to learn and share the knowledge, my passion for my field has helped me grasp complex electronics concepts and now I am here to share them with others.