I have been working with xbox controllers connecting to the Arduino Uno Q.
I currently have 5 Arduino Uno Q boards flashed with the command line tool, so they are all the same. I generally use this sequence below to attach the devices together after holding down the sync button for 15 seconds on the xbox controller to clear the controller, turn it on, hold down the sync button to get it into pairing mode:
sudo bluetoothctl
Then within the bluetoothctl tool (with XX:XX:XX:XX:XX:XX as the MAC address):
power on
agent on
default-agent
scan on
Look for the MAC address of the xbox controller, and then:
scan off
pair XX:XX:XX:XX:XX:XX
trust XX:XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX:XX
Then you can use evtool to see events coming from the controller to verify the connection.
The problem as mentioned above, is this works just fine with 3 of the boards, but no matter what I try, it does not work with 2 others, even if I do this before the above sequence:
sudo systemctl restart bluetooth
sudo rfkill unblock bluetooth
sudo bluetoothctl remove XX:XX:XX:XX:XX:XX
I have tried just about every suggestion I can find (short of going to an older version of the firmware on the controller), including the following:
Adding the following to /etc/modprobe.d/bluetooth.conf
options bluetooth disable_ertm=1
Setting in /etc/bluetooth/input.conf in the [General] section:
ClassicBondedOnly=false
UserspaceHID=true
Adding in /etc/bluetooth/main.conf
JustWorksRepairing=always
FastConnectable=true
KeepPairing=true
I think I have made each board as exactly the same as I can by reflashing all of them prior to trying to pair with the controller.
Also, I used two different controllers with all 5 to make sure it was not an xbox controller issue.
I am out of ideas.
