How to connect the Xbox One controller to the Raspberry Pi

Are you a retro gaming fan wishing to connect the Xbox One controller to the Raspberry Pi? Thanks to the automatic configuration tools in RetroPie and Recalbox, you can control games using Xbox controller.

Are you a retro gaming fan wishing to connect the Xbox One controller to the Raspberry Pi? Thanks to the automatic configuration tools in RetroPie and Recalbox, you can control games using Xbox controller.

But what is the specific implementation? Need an adapter to connect the Xbox One controller to another computer? This is what you need to know.

Instructions for connecting the Xbox One controller with Raspberry Pi

  1. Raspbian configuration for the Xbox One controller
  2. How to connect the Xbox One controller to Raspberry Pi via USB
  3. How to connect the Xbox One controller to Raspberry Pi via Bluetooth
    1. Method 1: Use Microsoft's Xbox wireless adapter
    2. Method 2: Pair directly via Bluetooth tool
  4. Check out the Xbox One controller

Raspbian configuration for the Xbox One controller

If you plan to use the Xbox One controller with a Raspberry Pi, start by updating your operating system. In the terminal, enter the following command:

 sudo apt update sudo apt upgrade 

Wait for these commands to complete, notice any prompts that appear to confirm the installation.

How to connect the Xbox One controller to the Raspberry Pi Picture 1How to connect the Xbox One controller to the Raspberry Pi Picture 1

In most cases, you don't need a driver for the Xbox One controller on Raspbian. Support for controllers built on the operating system. However, the emulator and the old game do not recognize this controller. This feature is also useful for connecting via Bluetooth (details are in the following section).

If you have a problem when the Xbox One controller works with certain games, install the driver with the command:

 sudo apt install xboxdrv 

As always, wait for the installation to complete before proceeding to the next step.

How to connect the Xbox One controller to Raspberry Pi via USB

The advantage of USB is that you only need to plug and use. Although the convenience of the Xbox One controller comes from the flexibility of wireless connectivity, but if you are disappointed when using it, try USB. Xbox One charging cable can be used for this, but if not available, you'll have to buy it yourself. The 2.7-meter version is best for playing games on retro systems.

Don't forget, you can also buy the Xbox One controller version with the included cable. Simply plug this cable in and save your Bluetooth configuration time.

How to connect the Xbox One controller to Raspberry Pi via Bluetooth

If you plan to connect your Xbox One controller to a Raspberry Pi, it's best to choose to connect via Bluetooth. However, it should be noted that older Raspberry Pi models may have processing speeds (or WiFi and Bluetooth connectivity) that do not meet the needs of wireless controllers. Please use USB if you are restricted by the old Pi version.

For new Raspberry Pi models (from Pi 3 and above), you have two options for wireless connectivity:

  1. Dongle wireless adapter
  2. Integrated Bluetooth tool

One of these two methods will be much easier than the other option.

Method 1: Use Microsoft's Xbox wireless adapter

The easiest way to connect the Xbox One controller to the Raspberry Pi is to use Microsoft's official Xbox wireless adapter.

(Note that this adapter is different from what is used by the Xbox 360 wireless controller).

With the wireless adapter connected to the Raspberry Pi, start and then wait for the device to light up. Keep the pairing button on the adapter and the Xbox One controller at the same time, then wait for the light to go on. When they stop flashing, you're ready to use!

Method 2: Pair directly via Bluetooth tool

Before continuing, make sure you have installed the xboxdrv driver as the article explained earlier.

Synchronizing the Xbox One controller requires you to disable ERTM (short for Enhanced Re-Transmission Mode, a key feature of Bluetooth). With ERTM enabled, devices cannot be synchronized. Disable ERTM with the following command:

 echo 'options bluetooth disable_ertm=Y' | sudo tee -a /etc/modprobe.d/bluetooth.conf 

Next, restart the Raspberry Pi:

 sudo reboot 

The rebooted Raspberry Pi is now available for Bluetooth connectivity. Start the Bluetooth tools with:

 sudo bluetoothctl 

You will see a 'Agent registered' response and a new prompt [Bluetooth] #. At the prompt, activate the agent as follows:

 agent on 

Then set it as the default option:

 default-agent 

The next step is to start scanning for identifiable Bluetooth devices. Use the 'scan on' command to start scanning:

 scan on 

How to connect the Xbox One controller to the Raspberry Pi Picture 2How to connect the Xbox One controller to the Raspberry Pi Picture 2

Immediately, you will see a list in the terminal, including the available devices. However, the Xbox One controller will not be among these items. Instead, you will need to make the controller recognizable. Turn it on, then hold the sync button on the front of the device, next to the microUSB port.

How to connect the Xbox One controller to the Raspberry Pi Picture 3How to connect the Xbox One controller to the Raspberry Pi Picture 3

When the light on the Xbox button starts flashing, it can be detected. You will see a string of numbers and descriptions appear in the terminal. They will look like this:

 [NEW] Device 5C:BA:37:4D:1D:95 Xbox Wireless Controller 

6 pairs of letters and numbers separated by colons are the MAC addresses of the Xbox One controller. This address is used to connect the controller to the Raspberry Pi with the connect command :

 connect 5C:BA:37:4D:1D:95 

( Note : Your MAC address will be different).

How to connect the Xbox One controller to the Raspberry Pi Picture 4How to connect the Xbox One controller to the Raspberry Pi Picture 4

The connection will be confirmed in the Command Prompt with a row of lines following the message 'Connection successful'.

To ensure an easy connection in the future, guide Raspberry Pi to 'trust' the controller:

 trust 5C:BA:37:4D:1D:95 

When done, exit the Bluetooth tool with Ctrl + D

Check out the Xbox One controller

At this stage, you have completed all setup operations. To confirm if the Xbox One controller works correctly, install the joystick software :

 sudo apt install joystick 

With this setting, use the jstest tool to check your Xbox One controller input:

 sudo jstest /dev/input/js0 

A new window will open in the terminal, including a list of buttons and axes. Each will display different values ​​when pressing and moving. Moving around the buttons and thumbstick on the Xbox One controller will make values ​​appear. If the feedback is different and takes place immediately, then it means everything is set up and working correctly.

Until now, you're ready to start playing games with the Xbox One controller on the Raspberry Pi. Whether you use RetroPie, Recalbox or some other retro games for Raspberry Pi, profile controllers will also be available. This means that when you connect your controller, you can not only navigate the look of the retro game platform, but also play games!

Remember, you have 3 ways to connect the Xbox One controller to the Raspberry Pi:

  1. Use a USB cable
  2. Sync via Xbox wireless adapter
  3. Sync with the built-in Bluetooth tool (Raspberry Pi 3 and above)

Hope you are succesful.

3.9 ★ | 67 Vote