How to connect a Bluetooth controller to a Raspberry Pi?

 Here’s the usual, reliable way to connect a Bluetooth controller to a Raspberry Pi (Raspberry Pi OS). I’ll give you both GUI and terminal methods, plus the pairing combos for common controllers.




1) Quick GUI method (Raspberry Pi OS Desktop)

  1. Turn on Bluetooth on the Pi:

    • Click the Bluetooth icon in the top bar (or go to Preferences → Bluetooth).

  2. Put your controller into pairing mode (see section 3).

  3. In the Bluetooth window:

    • Search / Add Device

    • Select your controller

    • Click Pair

  4. After pairing, choose Connect (some controllers auto-connect).

Tip: If you don’t see a Bluetooth UI, install it:

sudo apt update sudo apt install -y blueman

2) Terminal method (works on Desktop + Lite): bluetoothctl

  1. Open a terminal and run:

bluetoothctl
  1. Inside bluetoothctl, type:

power on agent on default-agent scan on
  1. Put the controller in pairing mode. Wait until you see it appear, then copy its MAC address (looks like AA:BB:CC:DD:EE:FF).

  2. Pair + trust + connect:

pair AA:BB:CC:DD:EE:FF trust AA:BB:CC:DD:EE:FF connect AA:BB:CC:DD:EE:FF scan off quit

If it asks for a PIN, most game controllers pair without one—just accept/confirm if prompted.


3) Pairing mode for common controllers

  • PS4 DualShock 4: hold SHARE + PS until the light bar flashes rapidly.

  • PS5 DualSense: hold CREATE + PS until the lights flash.

  • Xbox Wireless (Bluetooth models): turn on → hold the pair button until Xbox logo flashes fast.

    • (Older Xbox One controllers may not support Bluetooth unless they’re the newer revision / updated.)

  • Nintendo Switch Pro Controller: press the sync button (small button near USB-C) until lights scan.


4) Check if it’s actually connected

See Bluetooth devices

bluetoothctl devices bluetoothctl info AA:BB:CC:DD:EE:FF

Confirm Linux sees joystick/gamepad events

ls /dev/input/js*

Optional tests:

sudo apt install -y joystick jstest /dev/input/js0

5) Common fixes if it won’t pair/connect

  • Bluetooth blocked

rfkill list sudo rfkill unblock bluetooth sudo systemctl restart bluetooth
  • Remove and re-pair

bluetoothctl remove AA:BB:CC:DD:EE:FF

Then repeat the pairing steps.

  • Power issues / weak supply
    Controllers + Bluetooth can get flaky if the Pi’s power is unstable—use a solid PSU.

  • It pairs but won’t reconnect automatically
    Make sure you ran:

trust AA:BB:CC:DD:EE:FF

评论

此博客中的热门博文

Detailed Explanation of STM32 HAL Library Clock System

How do you set up ADC (Analog-to-Digital Converter) in STM32?

How To Connect Stm32 To PC?