Pair 2 Raspberry Pis

The instructions below describe pairing a couple of Raspberry Pis which either have built-in Bluetooth (the Pi 3B or the Pi Zero W) or a USB Bluetooth dongle.

Using the Desktop

On the first Raspberry Pi:

  1. Click Bluetooth ‣ Turn On Bluetooth (if it’s off)
  2. Click Bluetooth ‣ Make Discoverable

On the second Raspberry Pi:

  1. Click Bluetooth ‣ Turn On Bluetooth (if it’s off)
  2. Click Bluetooth ‣ Make Discoverable
  3. Click Bluetooth ‣ Add Device
  4. The first Pi will appear in the list: select it and click the Pair button

On the first Raspberry Pi again:

  1. Accept the pairing request

Note

You may receive errors relating to services not being able available or being unable to connect: these can be ignored.

Using the Command Line

On the first Raspberry Pi:

  1. Enter bluetoothctl to open Bluetooth control

  2. At the [bluetooth]# prompt enter the following commands:

    discoverable on
    pairable on
    agent on
    default-agent
    

On the second Raspberry Pi:

  1. Enter bluetoothctl to open Bluetooth control

  2. At the [bluetooth]# prompt enter the following commands:

    discoverable on
    pairable on
    agent on
    default-agent
    scan on
    
  3. Wait for a message to appear showing the first Pi has been found:

    [NEW] Device 12:23:34:45:56:67 devicename
    
  4. Type pair with the mac address of the first Pi:

    pair 12:23:34:45:56:67
    

On both Raspberry Pi’s:

  1. Confirm the passcode.
  2. Type quit and press Enter to return to the command line