Skip to main content

Bluetooth Setup

Finding your device's Bluetooth MAC address

You'll need your device's Bluetooth MAC address to identify it in the scan results and for the security camera's presence detection. Here's where to find it:

  • Android: Settings → About phone → Status information → Bluetooth address
  • iPhone: Settings → General → About → Bluetooth
tip

If you've already paired, you can list paired devices and their MAC addresses anytime with:

bluetoothctl devices Paired

Pairing

Run the included pairing script:

/opt/security-cam/setup/pair_bluetooth.sh

The script offers two modes:

  • Mode 1 - Scan for devices: The Pi scans for nearby Bluetooth devices (30 seconds). You pick your device from the list after the scan is done and the script handles pairing and trusting. Make sure your device's Bluetooth visibility is turned on. On iPhone, keep Settings → Bluetooth open during the scan.
  • Mode 2 - Wait for incoming pairing: The Pi makes itself discoverable and waits for your device to initiate pairing (120 seconds). On your device, open Bluetooth settings and tap the Pi.

If one mode doesn't find your device, you can try the other without restarting the script. A confirmation prompt will appear on your device during pairing - make sure to accept it.

After successful pairing, the device is automatically registered in the dashboard for presence detection. You don't need to add it again in Settings > Devices.

info

If you prefer to do it manually or the script fails, you can use bluetoothctl directly. Enter bluetoothctl to open the prompt, then run the following commands one at a time:

  1. agent on
  2. default-agent
  3. scan on
  4. Wait for your device to appear, then:
  5. pair XX:XX:XX:XX:XX:XX (replace with your device's MAC address)
  6. trust XX:XX:XX:XX:XX:XX
  7. exit
tip

After setup is complete, you can also pair new Bluetooth devices directly from the dashboard at Settings > Devices - no SSH needed. The dashboard supports scanning, making the Pi discoverable, and manual MAC entry. See Devices settings for details.

Continue to mediamtx.mdx to set up the camera stream.