XBox-One S Controller Support

../_images/xbox-one.jpg

XBox-One S Controller

The XBox One S controller (the most modern, with bluetooth support) can be used without any dongles, but you will have to change a configuration option in the bluetooth driver. This is done by creating a file in /etc/modprobe.d/. The file can be called anything, you’ll need to be root to create it, and must specify a single line. In my case I used

tom@Ogre ~ $ sudo nano /etc/modprobe.d/bluetooth.conf

…to create a file, with a single line:

options bluetooth disable_ertm=Y

After doing this you’ll need to reboot your computer. If you don’t perform this step your controller will pair, but will not stay connected for more than a couple of seconds (if you’re using the graphical bluetooth manager you’ll see it connecting and disconnecting forever). There don’t appear to be any drawbacks to setting this option, at least none that I’ve found in the context of making robots.

Once this is done you should be able to pair with Pairing Controllers over Bluetooth as with any normal bluetooth device.

Problems with button mappings

When you first pair your controller, it may not work! If you’re seeing messages about button codes not being recognised, or buttons are mapping to the wrong controls, you need to un-pair the controller and go through the pairing process again. We’re not sure why, but in three separate cases this has fixed the issue. See Issue #17 for discussion!

Controller Classes

class approxeng.input.xboxone.WiredXBoxOneSPad(dead_zone=0.1, hot_zone=0.05)[source]

Wired XBox One controller, tested with the newer controllers that use bluetooth and are supplied with the XBox One S but may work with older versions. Note that the codes and axis mappings for the wired controller are not the same as for the wireless!

__init__(dead_zone=0.1, hot_zone=0.05)[source]

Create a new xbox one s controller instance

Parameters
static registration_ids()[source]
Returns

list of (vendor_id, product_id) for this controller

class approxeng.input.xboxone.WirelessXBoxOneSPad(dead_zone=0.1, hot_zone=0.05)[source]

Wireless over bluetooth - for some reason the control ranges on this are different to when wired and all the buttons are different.

To make the wireless pair work with linux you need to set a kernel module option on the bluetooth module. This can be done by creating a file in /etc/modprobe.d with the line ‘options bluetooth disable_ertm=Y’ and rebooting.

__init__(dead_zone=0.1, hot_zone=0.05)[source]

Create a new xbox one s controller instance

Parameters
static registration_ids()[source]
Returns

list of (vendor_id, product_id) for this controller