-
Notifications
You must be signed in to change notification settings - Fork 217
XBox One controller - current firmware (BLE) - (peripheral.discoverAttributes fails #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To follow up on the first post, I am still trying to figure out what the I added some debug code at the start of this, that enumerates some of the stuff we know when we get here:
And for example if I run the PeripheralExplorer with the Microsoft "Surface Arc Mouse";
Then when the current main code is trying to enumerate let's say the first Service with 3 characteristics:
So the first characteristic it looks like it is passing in the range for the 2nd one. I know I am probably missing something obvious here, EDIT: Or maybe if >= start handle of one and less then then next one then add it... But again, I more or less am throwing darts here. Thoughts? |
I know I am probably simply talking to myself (not too unusual) ;) I now have my extended version of the Peripheral Explorer getting information from an XBox One Controller with the updated firmware that uses BLE on a Teensy 4.1...
My Fork/Branch is updated with the code. Still has some debug stuff turned on. |
Note: The main Issue that was causing this to not work, was in the function:
The Bluetooth 4.0 dongle returned 27 and the code was subtracting 9 from it for the ACL data size... From the Bluetooth 5.3 manual it says:
Removing that -9 caused everything to appear to work now. |
Hello, I've run into same issue when attempting discoverAttributes on XBox controller (BLE). I've been testing your changes and what made this work are your changes for descriptor UUID (16/128 bit format). |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi! Just run into the same issue with Arduino Uno R4 - stuck in infinite loop in discoverAttributes. Can confirm what @bediver said, your changes in discoverDescriptors from https://github.com/KurtE/ArduinoBLE/tree/uno_r4_wifi_teensy branch fix it. Thank you kindly for putting it up here, I would've never figured it out myself! Hope ArduinoBLE devs will pick it up eventually? |
Uh oh!
There was an error while loading. Please reload this page.
If you update an XBox One controller to the latest firmware, the update will convert the controller to running using BLE.
Microsoft shows a few different ways to do the update, including I believe simply plug it into USB to XBox One that is running the latest stuff. I updated one of mine using the Windows XBox Accessories App.
Side note: trying to add BLE support to our Teensy USBHost_t36 code base. We already have some bluetooth support, and for example we can connect and use an XBox one controller, with the original firmware, but not after they are updated.
So I thought I would experiment using the ArduinoBLE library, and first tried on Arduino Nano 33 IOT as well as BLE and this call fails.
Note: I now also have a fork/branch of this library that runs on Teensy boards (T3.6 and 4.x) and right now doing most of my stuff
I am using a bluetooth dongle plugged into an USBHost connector on either a 4.1 or a Micromod.
In order for BLE to see this you need to put the controller into pairing mode. Hopefully after I figure out this part will then figure out how to do an actual BLE pairing (Again sort of outside of this issue).
When in pairing mode I found a windows App, that can talk to the device.

Note: I posted Some of these details up on both a PJRC forum thread as well as an Arduino one:
https://forum.arduino.cc/t/arduinoble-trying-to-connect-to-xbox-one-controller-and-other-ble-devices/1054844/3
https://forum.pjrc.com/threads/71503-USBHost-Bluetooth-gt-BLE-gt-ArduinoBLE
As the title mentioned, the discoverAttributes call fails. I have added a lot of debug outputs and the like to code including into my
TeensyTransport code. This includes doing some decoding of the data that is sent back and forth with the ATT messages.
It looks like the code is properly enumerating the Services and the Characteristics and then fails after that:
From my debug output: first enumerating the Services:
Pardon some of my cryptic outputs:
But it looks here like it found:
Handle:0001 ID: 1800
0008 ID: 1801
0009 180a
0012 180f
0016 1812
Which map to:
It then goes through all 5 of these Services looking for Characteristics:
I won't go through all 5 groups here to decode. But looking at the first we see:
So as I read this, the first group should have 3 handles 2, 4 and 6
I have not fully decoded the 5 bytes, but it looks like 2 goes to UUID 0x2A00 and likewise and 04->0x2A01
Which maps to:
case 0x2A00: return "Device Name";
case 0x2A01: return "Appearance";
Which again matches the data I see with the Windows app.
Again the call discoverCharacteristics works, but then the call to:
bool ATTClass::discoverDescriptors(uint16_t connectionHandle, BLERemoteDevice* device)
Fails on the first items. That is i=0 and j=0;
If fails in the while(1) { loop.
Some debug from that part:
Something that does not feel right here is:
As I mentioned earlier is it looks like the first one has handle 2
but it is searching for it with the range 4,5?
It finds the 2nd one with ID 4,
It then tries a search on 5-5 which then bails with an error and I don't
see any response on the ACLDATA for it.
Still investigating
The text was updated successfully, but these errors were encountered: