Giter Club home page Giter Club logo

Comments (30)

johanpostema avatar johanpostema commented on August 16, 2024 1

scan_pair_trust_connect_xbox_one_s_controller.pcapng.gz

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024 1

I just updated the firmware and suddenly it started to work with Linux and the driver.

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

Try the following:
sudo bluetoothctl
[bluetooth]# devices

Is there any Xbox Wireless Controller listed? (C8:3F:26:XX:XX:XX)

If yes, remove it:
[bluetooth]# remove C8:3F:26:<...>

Let me know once you are done :)

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

Yes it's listed when I run devices.

But when I remove it I assume I have push the little connect button and run pair , trust and connect again while the driver is loaded?
When I do that I get again the exact same result.

Also fyi, I disabled ertm:
cat /sys/module/bluetooth/parameters/disable_ertm
Y

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

After removing it, switch off the gamepad for a little while and reboot, just to be sure.
After that, do what you always do. What does bluetoothctl say after 'connect ...'?

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

When it is connected, but is still blinking, try to push the pair button just for a second or so. What hapens?

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

So here's what I did, I removed the device and rebooted. Loaded the driver and set debugging to 3. My controller is turned of and the bateteries are removed for +/- 5 minutes

[bluetooth]# devices
[bluetooth]#

Now I first put the batteries back in the controller, push the little connect button and the X starts to blink fast. Inside bluetoothctl I do:

[bluetooth]# scan on
Discovery started
<... some other devices...>
[NEW] Device C8:3F:26:17:EB:71 Xbox Wireless Controller 7EED80192272
[CHG] Device 46:56:1F:80:F8:E8 ManufacturerData Key: 0x004c
[CHG] Device 46:56:1F:80:F8:E8 ManufacturerData Value: 0x0c
[CHG] Device 46:56:1F:80:F8:E8 ManufacturerData Value: 0x0e
<some more>
[bluetooth]# pair C8:3F:26:17:EB:71
Attempting to pair with C8:3F:26:17:EB:71
[CHG] Device C8:3F:26:17:EB:71 Connected: yes
[CHG] Device C8:3F:26:17:EB:71 Modalias: usb:v045Ep02E0d0903
[CHG] Device C8:3F:26:17:EB:71 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device C8:3F:26:17:EB:71 UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device C8:3F:26:17:EB:71 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device C8:3F:26:17:EB:71 ServicesResolved: yes
[CHG] Device C8:3F:26:17:EB:71 Paired: yes
Pairing successful
[CHG] Device C8:3F:26:17:EB:71 ServicesResolved: no
[CHG] Device C8:3F:26:17:EB:71 Connected: no
[CHG] Device 18:EE:69:0D:23:31 RSSI: -93
[CHG] Device 18:EE:69:0D:23:31 RSSI: -83
[CHG] Device 46:56:1F:80:F8:E8 ManufacturerData Key: 0x004c
[CHG] Device 46:56:1F:80:F8:E8 ManufacturerData Value: 0x0c
<...>
[bluetooth]# trust C8:3F:26:17:EB:71
[CHG] Device C8:3F:26:17:EB:71 Trusted: yes
Changing C8:3F:26:17:EB:71 trust succeeded
[CHG] Device 6C:32:36:1A:C3:4D RSSI: -59
[CHG] Device E5:0C:3A:1A:41:5B RSSI: -86
<...>
[Xbox Wireless Controller 7EED80192272]# connect C8:3F:26:17:EB:71
Attempting to connect to C8:3F:26:17:EB:71
[CHG] Device C8:3F:26:17:EB:71 ServicesResolved: yes
Connection successful

Now in dmesg I can see similar output as in my first post, but the controller doesn't respond or work. The X starts to blink slowly like it's not paired or something and turns of automatically after a while.

Now my controller is off for a few minutes and the batteries are removed, just in case.

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

when I press it while it's blinking, nothing happens; it keeps blinking with the same rate.
Also nothing is added in dmesg, no additional lines.
When I hold the button long enough it shuts down.

First I thought it was perhaps the firmware in the controller, but when I connect it with my macbook the blinking light turns solid immediately after I connect.

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

Thats a pretty good description.
Unfortunately, I have no experience in iOS, I don't know which driver is used there or how it differs.

Do you have access to Windows or a Xbox One? If yes, could you please try to update the firmware please?

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

Unortunately I don't have a windows PC or an xbox, so I can't flash the firmware right now.
But I'll take the controller somewhere in the next days to someone with windows in order to update the controller. I have to say that I have this controller for quite a while, so it might have an old firmware.

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

The X starts to blink slowly like it's not paired or something and turns of automatically after a while.

Does it start to blink slowly immediately after the 'connect' command?

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

yes

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

sorry, that's a no. It keeps flashing quickly after it's connected

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

That's super strange.
Could you please try to hit the pair button for a second INSTEAD of the 'connect' command?

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

So I removed it first, then did pair + trust.
Turned of the controller as it didn't connect, also it didn't connect when pressing the pair button.
But after I turned off/on the controller, it automatically connects; but keeps blinking slowly

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

I need to catch some sleep now. Ill try to update the firmware in the coming days and will see if the behaviour changes. I will update this thread to let you know. Tnx!

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

If you can wait, I would prefer to find out why it does not work on your device instead of updating to the other fw.
What I was asking for is the following (sorry, I was on my phone before, what's why the answer was a bit short):

  • remove the device as before
  • pair and trust it
  • now, while it is still online but not yet connected, press the little black button on the upper left side just for a second or so. you wrote before that "When I hold the button long enough it shuts down." - was it maybe the (x) button you pressed?

Could you try to connect the gamepad to another PC where linux is running, and xpadneo installed? Just to make sure that it is not the computer itself (or linux), but xpadneo.

I am looking for a gamepad which still has the old fw for quite a long time now, so - if you cannot wait - then maybe you can sell (or borrow) it to me?

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

Hi, sorry I was away this weekend.
I decided not to upgrade the firmware, as you requested. I can perhaps borrow it to you, not a problem.
I'm not in a hurry, I bought this controller quite a while ago with the idea to test it with Linux but never got it to work and threw it in the corner for quite a while. Just a while ago I decided to take a look again.

I tried to remove the device and pair and trust it again. The problem is after the device is removed I simply cannot pair and trust it; the message I receive is:

[bluetooth]# pair C8:3F:26:17:EB:71
Device C8:3F:26:17:EB:71 not available

I can only pair it by first pressing the black button on the controller to make it discoverable and then set scan on in bluetoothctl.

Is there some way we can try to debug this together ? (phone/skype/irc/whatsapp/telegram/something else). Or I otherwise I can see if I can get the device to your address.

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

No problem, I was busy too ;)
Yes for sure, you have to set it into pairing mode and scan for it before - I forgot to mention that.

Before debugging, let us make sure that you have really done the following:

  • remove the device
  • set it into pairing mode by pressing and holding the upper little black button until the gamepad starts flashing fast
  • scan on
  • pair ... and trust ...
  • do not connect
  • press the little black button on the upper left side (the pairing button) just for a second or so. you wrote before that "When I hold the button long enough it shuts down." - was it maybe the (x) button you pressed?

If this does not work too, the next step would be to try another computer which has linux installed - just to make sure that it is not you system which is faulty. 😄

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

I tried the above as mentioned before, but doesn't work. Other linux computer same effect.
I will now update the firmware in the coming days and see if it makes a difference since it's an old firmware. Will post the results here.

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

Thank you for your answer!
Your gamepad does behave really strange, even your HID report descriptor is totally different from what I ahave seen so far, it really looks like you have the old FW.

05 01 09 05 a1 01 85 01 09 01 a1 00 09 30 09 31 15 00 27 ff
ff 00 00 95 02 75 10 81 02 c0 09 01 a1 00 09 33 09 34 15 00
27 ff ff 00 00 95 02 75 10 81 02 c0 05 01 09 32 15 00 26 ff
03 95 01 75 0a 81 02 15 00 25 00 75 06 95 01 81 03 05 01 09
35 15 00 26 ff 03 95 01 75 0a 81 02 15 00 25 00 75 06 95 01
81 03 05 01 09 39 15 01 25 08 35 00 46 3b 01 66 14 00 75 04
95 01 81 42 75 04 95 01 15 00 25 00 35 00 45 00 65 00 81 03
05 09 19 01 29 0a 15 00 25 01 75 01 95 0a 81 02 15 00 25 00
75 06 95 01 81 03 05 01 09 80 85 02 a1 00 09 85 15 00 25 01
95 01 75 01 81 02 15 00 25 00 75 07 95 01 81 03 c0 05 0f 09
21 85 03 a1 02 09 97 15 00 25 01 75 04 95 01 91 02 15 00 25
00 75 04 95 01 91 03 09 70 15 00 25 64 75 08 95 04 91 02 09
50 66 01 10 55 0e 15 00 26 ff 00 75 08 95 01 91 02 09 a7 15
00 26 ff 00 75 08 95 01 91 02 65 00 55 00 09 7c 15 00 26 ff
00 75 08 95 01 91 02 c0

I will decrypt it later and take a look at it, looks similar to the USB descriptor at a first glance.

But the really weird thing is that your gamepad's LED is not switching to the continuos light. This is not really something which this driver is responsible for since the connection itself (via BT) is established by the kernel, not the (relatively abstract and high-level HID drivers).

Anyway, it is a bug nonetheless - one which we should fix if possible.

Can you tell me something about the other linux OS which you tried?

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

I seem to be on firmware version "3.1.1209.0". Now Im setting up a windows 10 vm somewhere to be able to upgrade the firmware.
I tried different versions of raspbian on a few different raspberry pi's (pi 3, pi zero).

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

Okay, would be helpful if you could capture the "connection procedure" using Wireshark before.

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

Your decrypted report descriptor:

0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x05,        // Usage (Game Pad)
0xA1, 0x01,        // Collection (Application)
0x85, 0x01,        //   Report ID (1)
0x09, 0x01,        //   Usage (Pointer)
0xA1, 0x00,        //   Collection (Physical)
0x09, 0x30,        //     Usage (X)
0x09, 0x31,        //     Usage (Y)
0x15, 0x00,        //     Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00,  //     Logical Maximum (65534)
0x95, 0x02,        //     Report Count (2)
0x75, 0x10,        //     Report Size (16)
0x81, 0x02,        //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              //   End Collection
0x09, 0x01,        //   Usage (Pointer)
0xA1, 0x00,        //   Collection (Physical)
0x09, 0x33,        //     Usage (Rx)
0x09, 0x34,        //     Usage (Ry)
0x15, 0x00,        //     Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00,  //     Logical Maximum (65534)
0x95, 0x02,        //     Report Count (2)
0x75, 0x10,        //     Report Size (16)
0x81, 0x02,        //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              //   End Collection
0x05, 0x01,        //   Usage Page (Generic Desktop Ctrls)
0x09, 0x32,        //   Usage (Z)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x03,  //   Logical Maximum (1023)
0x95, 0x01,        //   Report Count (1)
0x75, 0x0A,        //   Report Size (10)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x00,        //   Logical Maximum (0)
0x75, 0x06,        //   Report Size (6)
0x95, 0x01,        //   Report Count (1)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01,        //   Usage Page (Generic Desktop Ctrls)
0x09, 0x35,        //   Usage (Rz)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x03,  //   Logical Maximum (1023)
0x95, 0x01,        //   Report Count (1)
0x75, 0x0A,        //   Report Size (10)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x00,        //   Logical Maximum (0)
0x75, 0x06,        //   Report Size (6)
0x95, 0x01,        //   Report Count (1)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01,        //   Usage Page (Generic Desktop Ctrls)
0x09, 0x39,        //   Usage (Hat switch)
0x15, 0x01,        //   Logical Minimum (1)
0x25, 0x08,        //   Logical Maximum (8)
0x35, 0x00,        //   Physical Minimum (0)
0x46, 0x3B, 0x01,  //   Physical Maximum (315)
0x66, 0x14, 0x00,  //   Unit (System: English Rotation, Length: Centimeter)
0x75, 0x04,        //   Report Size (4)
0x95, 0x01,        //   Report Count (1)
0x81, 0x42,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,Null State)
0x75, 0x04,        //   Report Size (4)
0x95, 0x01,        //   Report Count (1)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x00,        //   Logical Maximum (0)
0x35, 0x00,        //   Physical Minimum (0)
0x45, 0x00,        //   Physical Maximum (0)
0x65, 0x00,        //   Unit (None)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x09,        //   Usage Page (Button)
0x19, 0x01,        //   Usage Minimum (0x01)
0x29, 0x0A,        //   Usage Maximum (0x0A)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x01,        //   Logical Maximum (1)
0x75, 0x01,        //   Report Size (1)
0x95, 0x0A,        //   Report Count (10)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x00,        //   Logical Maximum (0)
0x75, 0x06,        //   Report Size (6)
0x95, 0x01,        //   Report Count (1)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01,        //   Usage Page (Generic Desktop Ctrls)
0x09, 0x80,        //   Usage (Sys Control)
0x85, 0x02,        //   Report ID (2)
0xA1, 0x00,        //   Collection (Physical)
0x09, 0x85,        //     Usage (Sys Main Menu)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x01,        //     Logical Maximum (1)
0x95, 0x01,        //     Report Count (1)
0x75, 0x01,        //     Report Size (1)
0x81, 0x02,        //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x00,        //     Logical Maximum (0)
0x75, 0x07,        //     Report Size (7)
0x95, 0x01,        //     Report Count (1)
0x81, 0x03,        //     Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              //   End Collection
0x05, 0x0F,        //   Usage Page (PID Page)
0x09, 0x21,        //   Usage (0x21)
0x85, 0x03,        //   Report ID (3)
0xA1, 0x02,        //   Collection (Logical)
0x09, 0x97,        //     Usage (0x97)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x01,        //     Logical Maximum (1)
0x75, 0x04,        //     Report Size (4)
0x95, 0x01,        //     Report Count (1)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x00,        //     Logical Maximum (0)
0x75, 0x04,        //     Report Size (4)
0x95, 0x01,        //     Report Count (1)
0x91, 0x03,        //     Output (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x09, 0x70,        //     Usage (0x70)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x64,        //     Logical Maximum (100)
0x75, 0x08,        //     Report Size (8)
0x95, 0x04,        //     Report Count (4)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x09, 0x50,        //     Usage (0x50)
0x66, 0x01, 0x10,  //     Unit (System: SI Linear, Time: Seconds)
0x55, 0x0E,        //     Unit Exponent (-2)
0x15, 0x00,        //     Logical Minimum (0)
0x26, 0xFF, 0x00,  //     Logical Maximum (255)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x09, 0xA7,        //     Usage (0xA7)
0x15, 0x00,        //     Logical Minimum (0)
0x26, 0xFF, 0x00,  //     Logical Maximum (255)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x65, 0x00,        //     Unit (None)
0x55, 0x00,        //     Unit Exponent (0)
0x09, 0x7C,        //     Usage (0x7C)
0x15, 0x00,        //     Logical Minimum (0)
0x26, 0xFF, 0x00,  //     Logical Maximum (255)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0xC0,              //   End Collection

Would be interesting how the events look in dmesg when you hit a button.

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

Ill install wireshark and see if I can do that. This might sound stupid as I have never captured BT traffic, but is that l2cap ? Any specific arguments/options for wireshark/bluetooth that I should consid
er?

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

the layer is l2cap, jap. the interface should be something like "bluetooth-monitor" in wireshark - you may need to run it as root to capture the traffic (if your "normal" user is missing the necessary privileges).

from xpadneo.

johanpostema avatar johanpostema commented on August 16, 2024

I have 23k pcapng file which started with a clean setup (gamepad remove).
I started wireshark, started bluetoothctl, scan on, pair/trust/connect waited a while (pressed some buttons) untill the gamepad turned off again. According to bluetoothctl it was connected successfull,
Can I upload this pcapng somewhere?

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

Thanks! According to the capture the connection and configuration is done correctly, at least that's what the gamepad asserts. Furthermore it seems like the keys you pressed never arrived your PC.

Have you turned on any filters while capturing? I just ask because my logs usually consist of around 700 packets ;)

Have you updated your Gamepad in the meanwhile? My guess is that the gamepad (running this early firmware) does actively prevent a sucessfull connection somehow when the OS is not the one it expects (Windows). On the other hand, you said that it does work on iOS...

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

I'm glad it works now, I will keep it in mind and update the README accordingly.

from xpadneo.

atar-axis avatar atar-axis commented on August 16, 2024

I won't try to fix it (at least for now) since it is not a driver issue but caused by either the kernels bluetooth implementation or the device itself which actively prevents the connection. For anyone that follows: Please update your gamepads for a successfull connection.

from xpadneo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.