Raspberry Pi

How to Connect Xbox Controller with Raspberry Pi

For those who want to enjoy a better gaming experience, they certainly need an Xbox controller in order to play games with great control. Getting a wireless Xbox controller is a bit expensive so most people stick with buying an affordable wired Xbox controller. So, if you are one of those people who have a wired Xbox USB controller and you want to play games with it on your Raspberry Pi OS then you certainly need help in configuring it on the device.

How to connect Xbox USB controller on Raspberry Pi OS

In this article, we will provide you with some steps if you want to connect an Xbox wired USB controller on Raspberry Pi OS so that you can enjoy playing games with the Xbox controller. The below are the steps which are required to connect Xbox wired USB controller on Raspberry Pi OS:

Step 1: The first step you need to do is to buy an Xbox 360 or Xbox One controller preferably a wired USB controller for an easy setup.

Step 2: Make sure that your wired Xbox controller is connected with your Raspberry Pi device and in order to check the connection, you can use the below given command in the terminal which will confirm that your Xbox controller is attached to your Raspberry Pi device.

$ lsusb


Step 3: Next, you will need to install the Xbox driver for your Raspberry Pi device and to do that, enter the below given command in the terminal.

$ sudo apt install xboxdrv


Step 4: In order to test the connection, you will have to install a joystick toolset which lets you ensure that everything is working fine. To do this, add the below given terminal command.

$ sudo apt-get install joystick


After the installation, type the below mentioned command in the terminal and press the” Enter” button to enable the testing mode of the Xbox controller.

$ sudo jstest /dev/input/js0


From the above command, you can now test the working of all keys of your Xbox controller. You will need to press each key from your Xbox controller and if that key appears on the terminal, it will blink.

Step 5: Now if you want to use the Xbox controller in place of the mouse, you will need to add the below mentioned command in the terminal and when you press enter you will then  be able to use the Xbox controller in place of the mouse.

$ sudo xboxdrv –detach-kernel-driver –silent --mouse


Here, you have finished the setup of your Xbox controller and in order to use its services, you will need to install Games which gives you the option to use the Xbox controller then you will enjoy a good gaming experience.

Conclusion

If you are a game lover, you will definitely want to play games on your Raspberry Pi device and you will enjoy it more when you are able to play the games with your Xbox controller. The above steps will let you connect your both Xbox One and Xbox 360 wired controllers with the Raspberry Pi device and in order to play games using the Xbox controller, you just need to install required drivers on your Raspberry Pi.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.