Forum Rule: Always post complete source code & details to reproduce any issue!
Page 6 of 6 FirstFirst ... 4 5 6
Results 126 to 142 of 142

Thread: T3.6 USB Host - Joysticks

  1. #126
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,090
    @mjs513 - Wondering. I know it is probably my screw up... But I was wondering about the PS4 and my mapping of Button bits and was thinking maybe they are screwed up?

    Code:
    		/*
    		 * [1] LX, [2] = LY, [3] = RX, [4] = RY
    		 * [5] combo, tri, cir, x, sqr, D-PAD (4bits, 0-3
    		 * [6] R3,L3, opt, share, R2, L2, R1, L1
    		 * [7] Counter (bit7-2), T-PAD, PS
    		 * [8] Left Trigger, [9] Right Trigger
    		 * [10-11] Timestamp
    		 * [12] Battery (0 to 0xff)
    		 * [13-14] acceleration x
    		 * [15-16] acceleration y
    		 * [17-18] acceleration z
    		 * [19-20] gyro x
    		 * [21-22] gyro y
    		 * [23-24] gyro z
    		 * [25-29] unknown
    		 * [30] 0x00,phone,mic, usb, battery level (4bits)
    		 * rest is trackpad?  to do implement?
    		 */
    		//PS Bit
    		tmp_data[7] = (tmp_data[7] >> 0) & 1;
    		//set arrow buttons to axis[0]
    		tmp_data[10] = tmp_data[5] & ((1 << 4) - 1);
    		//set buttons for last 4bits in the axis[5]
    		tmp_data[5] = tmp_data[5] >> 4;
    		
    	
    		// Quick and dirty hack to match PS4 HID data
    		uint32_t cur_buttons = tmp_data[7] | (tmp_data[10]) | ((tmp_data[6]*10)) | ((uint16_t)tmp_data[5] << 16) ; 
    		if (cur_buttons != buttons) {
    			buttons = cur_buttons;
    			joystickEvent = true;	// something changed.
    		}
    Did I/we think the 10 is correct? I can see maybe 0x10, but this sets two multiple bits, which I was noticing and the values just feel wrong...
    And if I fix was wondering if I should hack up the bits for D-PAD instead of 8 value for nothing pressed maybe quick map to bits like PS3?

    Thoughts?

  2. #127
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,457
    Quote Originally Posted by KurtE View Post
    @mjs513 - Wondering. I know it is probably my screw up... But I was wondering about the PS4 and my mapping of Button bits and was thinking maybe they are screwed up?

    Code:
    		/*
    		 * [1] LX, [2] = LY, [3] = RX, [4] = RY
    		 * [5] combo, tri, cir, x, sqr, D-PAD (4bits, 0-3
    		 * [6] R3,L3, opt, share, R2, L2, R1, L1
    		 * [7] Counter (bit7-2), T-PAD, PS
    		 * [8] Left Trigger, [9] Right Trigger
    		 * [10-11] Timestamp
    		 * [12] Battery (0 to 0xff)
    		 * [13-14] acceleration x
    		 * [15-16] acceleration y
    		 * [17-18] acceleration z
    		 * [19-20] gyro x
    		 * [21-22] gyro y
    		 * [23-24] gyro z
    		 * [25-29] unknown
    		 * [30] 0x00,phone,mic, usb, battery level (4bits)
    		 * rest is trackpad?  to do implement?
    		 */
    		//PS Bit
    		tmp_data[7] = (tmp_data[7] >> 0) & 1;
    		//set arrow buttons to axis[0]
    		tmp_data[10] = tmp_data[5] & ((1 << 4) - 1);
    		//set buttons for last 4bits in the axis[5]
    		tmp_data[5] = tmp_data[5] >> 4;
    		
    	
    		// Quick and dirty hack to match PS4 HID data
    		uint32_t cur_buttons = tmp_data[7] | (tmp_data[10]) | ((tmp_data[6]*10)) | ((uint16_t)tmp_data[5] << 16) ; 
    		if (cur_buttons != buttons) {
    			buttons = cur_buttons;
    			joystickEvent = true;	// something changed.
    		}
    Did I/we think the 10 is correct? I can see maybe 0x10, but this sets two multiple bits, which I was noticing and the values just feel wrong...
    And if I fix was wondering if I should hack up the bits for D-PAD instead of 8 value for nothing pressed maybe quick map to bits like PS3?

    Thoughts?
    Been awhile since I/we played with this - but I was never good with the button mapping. If i remember we originally had them mapped out to more array elements but then we combined buttons.

    Be honest, i will leave to your discretion as long as it doesn't get too confusing

  3. #128
    Ok, not sure what's going on, but when I try the USBHost_viewer sketch, I get the following error:

    USBHost_viewer:28: error: 'ILI9341_TFTWIDTH' was not declared in this scope
    DMAMEM uint16_t frame_buffer[ILI9341_TFTWIDTH * ILI9341_TFTHEIGHT];

    ^

    USBHost_viewer:28: error: 'ILI9341_TFTHEIGHT' was not declared in this scope
    DMAMEM uint16_t frame_buffer[ILI9341_TFTWIDTH * ILI9341_TFTHEIGHT];

    ^

    USBHost_viewer:50: error: 'ILI9341_t3n' does not name a type
    ILI9341_t3n tft = ILI9341_t3n(TFT_CS, TFT_DC, TFT_RST, TFT_MOSI, TFT_SCK, TFT_MISO);

    ^

    USBHost_viewer: In function 'void setup()':
    USBHost_viewer:153: error: 'tft' was not declared in this scope
    tft.begin();

    ^

    USBHost_viewer:155: error: 'frame_buffer' was not declared in this scope
    tft.setFrameBuffer(frame_buffer);

    ^

    USBHost_viewer:160: error: 'ILI9341_BLACK' was not declared in this scope
    tft.fillScreen(ILI9341_BLACK);

    ^

    USBHost_viewer:161: error: 'ILI9341_YELLOW' was not declared in this scope
    tft.setTextColor(ILI9341_YELLOW);

    ^

    USBHost_viewer: In function 'void UpdateActiveDeviceInfo()':
    USBHost_viewer:206: error: 'tft' was not declared in this scope
    tft.fillScreen(ILI9341_BLACK); // clear the screen.

    ^

    USBHost_viewer:206: error: 'ILI9341_BLACK' was not declared in this scope
    tft.fillScreen(ILI9341_BLACK); // clear the screen.

    ^

    USBHost_viewer:208: error: 'ILI9341_YELLOW' was not declared in this scope
    tft.setTextColor(ILI9341_YELLOW);

    ^

    USBHost_viewer:232: error: 'tft' was not declared in this scope
    tft.fillScreen(ILI9341_BLACK); // clear the screen.

    ^

    USBHost_viewer:232: error: 'ILI9341_BLACK' was not declared in this scope
    tft.fillScreen(ILI9341_BLACK); // clear the screen.

    ^

    USBHost_viewer:234: error: 'ILI9341_YELLOW' was not declared in this scope
    tft.setTextColor(ILI9341_YELLOW);

    ^

    USBHost_viewer:259: error: 'tft' was not declared in this scope
    tft.fillScreen(ILI9341_BLACK); // clear the screen.

    ^

    USBHost_viewer:259: error: 'ILI9341_BLACK' was not declared in this scope
    tft.fillScreen(ILI9341_BLACK); // clear the screen.

    ^

    USBHost_viewer:261: error: 'ILI9341_YELLOW' was not declared in this scope
    tft.setTextColor(ILI9341_YELLOW);

    ^

    USBHost_viewer: In function 'void ProcessTabletData()':
    USBHost_viewer:285: error: 'tft' was not declared in this scope
    tft.getCursor(&x, &y_position_after_device_info);

    ^

    USBHost_viewer:286: error: 'ILI9341_YELLOW' was not declared in this scope
    tft.setTextColor(ILI9341_YELLOW);

    ^

    USBHost_viewer:324: error: 'tft' was not declared in this scope
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);

    ^

    USBHost_viewer:324: error: 'ILI9341_WHITE' was not declared in this scope
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);

    ^

    USBHost_viewer:324: error: 'ILI9341_BLACK' was not declared in this scope
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);

    ^

    USBHost_viewer: In function 'void OutputNumberField(int16_t, int16_t, int, int16_t)':
    USBHost_viewer:355: error: 'tft' was not declared in this scope
    tft.setCursor(x, y);

    ^

    USBHost_viewer:357: error: 'ILI9341_BLACK' was not declared in this scope
    tft.fillRect(x2, y, field_width - (x2 - x), Arial_12.line_space, ILI9341_BLACK);

    ^

    USBHost_viewer: In function 'void ProcessMouseData()':
    USBHost_viewer:368: error: 'tft' was not declared in this scope
    tft.getCursor(&x, &y_position_after_device_info);

    ^

    USBHost_viewer:369: error: 'ILI9341_YELLOW' was not declared in this scope
    tft.setTextColor(ILI9341_YELLOW);

    ^

    USBHost_viewer:399: error: 'tft' was not declared in this scope
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);

    ^

    USBHost_viewer:399: error: 'ILI9341_WHITE' was not declared in this scope
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);

    ^

    USBHost_viewer:399: error: 'ILI9341_BLACK' was not declared in this scope
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);

    ^

    USBHost_viewer: In function 'void ProcessJoystickData()':
    USBHost_viewer:483: warning: comparison between signed and unsigned integer expressions
    if (buttons != buttons_cur) {

    ^

    USBHost_viewer: In function 'void tft_JoystickData()':
    USBHost_viewer:508: error: 'tft' was not declared in this scope
    tft.getCursor(&x, &y_position_after_device_info);

    ^

    USBHost_viewer:509: error: 'ILI9341_YELLOW' was not declared in this scope
    tft.setTextColor(ILI9341_YELLOW);

    ^

    USBHost_viewer:540: warning: enumeration value 'UNKNOWN' not handled in switch
    switch (joystick.joystickType()) {

    ^

    USBHost_viewer:540: warning: enumeration value 'PS3_MOTION' not handled in switch
    USBHost_viewer:540: warning: enumeration value 'SpaceNav' not handled in switch
    USBHost_viewer:568: error: 'tft' was not declared in this scope
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);

    ^

    USBHost_viewer:568: error: 'ILI9341_WHITE' was not declared in this scope
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);

    ^

    USBHost_viewer:568: error: 'ILI9341_BLACK' was not declared in this scope
    tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);

    ^

    USBHost_viewer: In function 'bool OnReceiveHidData(uint32_t, const uint8_t*, uint32_t)':
    USBHost_viewer:634: error: 'tft' was not declared in this scope
    tft.fillRect(45, 197, 240, 20, ILI9341_RED);

    ^

    USBHost_viewer:634: error: 'ILI9341_RED' was not declared in this scope
    tft.fillRect(45, 197, 240, 20, ILI9341_RED);

    ^

    USBHost_viewer: In function 'void MaybeSetupTextScrollArea()':
    USBHost_viewer:662: error: 'tft' was not declared in this scope
    tft.enableScroll();

    ^

    USBHost_viewer:664: error: 'ILI9341_GREEN' was not declared in this scope
    tft.setScrollBackgroundColor(ILI9341_GREEN);

    ^

    USBHost_viewer:666: error: 'ILI9341_BLACK' was not declared in this scope
    tft.setTextColor(ILI9341_BLACK);

    ^

    USBHost_viewer: In function 'void OnPress(int)':
    USBHost_viewer:675: error: 'tft' was not declared in this scope
    tft.print("key: ");

    ^

    USBHost_viewer: In function 'void OnHIDExtrasPress(uint32_t, uint16_t)':
    USBHost_viewer:729: error: 'tft' was not declared in this scope
    tft.print("HID (");

    ^

    USBHost_viewer: In function 'void OnHIDExtrasRelease(uint32_t, uint16_t)':
    USBHost_viewer:966: error: 'tft' was not declared in this scope
    tft.print("HID (");

    ^

    Multiple libraries were found for "USBHost_t36.h"
    Used: C:\Users\-\Documents\Arduino\libraries\USBHost_t36
    Not used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\USBHos t_t36
    'ILI9341_TFTWIDTH' was not declared in this scope
    I directly cloned the following libs to my Arduino IDE "libraries" folder:
    https://github.com/KurtE/USBHost_t36
    https://github.com/KurtE/ILI9341_t3n


    @KurtE - Any idea what's going on? I figured I downloaded the proper libraries, am I missing one?

  4. #129
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,090
    Sounds like it did not find the header files for those libraries.

    Might help to see the full set of output, which might include things like what the compiler options were. Example for T4? 4.1 or 3.6? Also what version of Teensyduino.

    Also if you downloaded from my github, did you use the default branch (master?) Probably should be in sync with the master one that shipped with the current released teensyduino.

  5. #130
    I installed the libraries in the correct place, so finding the installed headers is not the problem. Also, I'm compiling for T3.6 with the current Teensyduino version.

    I'd really appreciate if you can figure out why it's broken.

  6. #131
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,929
    Problem is missing DISPLAY library info ...ILI9341_TFTWIDTH' was not declared in this scope

    Library info not shown as if one was found

  7. #132
    Ok, I actually figured it out - you need to add
    Code:
    #include "ILI9341_t3n.h"
    to either ili9341_t3n_font_Arial.h or to the example sketch in order for things to work. I think that should be updated in the repository. I can do a PR if you want.

  8. #133
    Now when I plug my XBox One controller into my T3.6 and run the test sketch, the only thing that shows up in the serial monitor is "USB Host Testing". My controller on lights do not turn on and none of the buttons cause any printouts.

    You mentioned something about uncommenting a #define with "debug" in it, but I've searched the sketch and several lib headers and can't for the life of me find what you're talking about.

    Any suggestions?

  9. #134
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    11,929
    Quote Originally Posted by Power_Broker View Post
    Now when I plug my XBox One controller into my T3.6 and run the test sketch, the only thing that shows up in the serial monitor is "USB Host Testing". My controller on lights do not turn on and none of the buttons cause any printouts.

    You mentioned something about uncommenting a #define with "debug" in it, but I've searched the sketch and several lib headers and can't for the life of me find what you're talking about.

    Any suggestions?
    It is there as #define USBHOST_PRINT_DEBUG in : ...\hardware\teensy\avr\libraries\USBHost_t36\USBH ost_t36.h

  10. #135
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,090
    XBox One controller: I believe we have some of it working for USB connections. However we still have not been able to make it work using Bluetooth. It requires more pieces of the Bluetooth system than we have implemented.

    As @defragster mentioned, if you uncomment the line: #define USBHOST_PRINT_DEBUG
    in USBHost_t36.h, which is a library file, and rebuild it should print out a lot more debug information.

  11. #136
    Ok, cool - can't believe ctrl+f "debug" didn't find that statement, lol.

    I ran it with my (hardwired) XBox One controller attached and got the following:
    USB Host Testing

    sizeof Device = 36

    sizeof Pipe = 96

    sizeof Transfer = 64

    power up USBHS PHY

    reset waited 5

    USBHS_ASYNCLISTADDR = 0

    USBHS_PERIODICLISTBASE = 2001B000

    periodictable = 2001B000

    port change: 10001803

    connect

    begin reset

    port change: 10001005

    port enabled

    end recovery

    new_Device: 12 Mbit/sec

    new_Pipe

    enumeration:

    enumeration:

    enumeration:

    Device Descriptor:

    12 01 00 02 FF FF FF 40 C6 24 1A 58 01 01 01 02 03 01

    VendorID = 24C6, ProductID = 581A, Version = 0101

    Class/Subclass/Protocol = 255 / 255 / 255

    Number of Configurations = 1

    enumeration:

    enumeration:

    Manufacturer: BDA

    enumeration:

    Product: XB1 Classic Controller

    enumeration:

    Serial Number: 00001AE88AC3F082

    enumeration:

    Config data length = 96

    enumeration:

    Configuration Descriptor:

    09 02 60 00 03 01 00 A0 FA

    NumInterfaces = 3

    ConfigurationValue = 1

    09 04 00 00 02 FF 47 D0 00

    Interface = 0

    Number of endpoints = 2

    Class/Subclass/Protocol = 255 / 71 / 208

    07 05 02 03 40 00 04

    Endpoint = 2 OUT

    Type = Interrupt

    Max Size = 64

    Polling Interval = 4

    07 05 81 03 40 00 04

    Endpoint = 1 IN

    Type = Interrupt

    Max Size = 64

    Polling Interval = 4

    09 04 01 00 00 FF 47 D0 00

    Interface = 1

    Number of endpoints = 0

    Class/Subclass/Protocol = 255 / 71 / 208

    09 04 01 01 02 FF 47 D0 00

    Interface = 1

    Number of endpoints = 2

    Class/Subclass/Protocol = 255 / 71 / 208

    07 05 08 01 E4 00 01

    Endpoint = 8 OUT

    Type = Isochronous

    Max Size = 228

    Polling Interval = 1

    07 05 87 01 E4 00 01

    Endpoint = 7 IN

    Type = Isochronous

    Max Size = 228

    Polling Interval = 1

    09 04 02 00 00 FF 47 D0 00

    Interface = 2

    Number of endpoints = 0

    Class/Subclass/Protocol = 255 / 71 / 208

    09 04 02 01 02 FF 47 D0 00

    Interface = 2

    Number of endpoints = 2

    Class/Subclass/Protocol = 255 / 71 / 208

    07 05 04 02 40 00 00

    Endpoint = 4 OUT

    Type = Bulk

    Max Size = 64

    Polling Interval = 0

    07 05 83 02 40 00 00

    Endpoint = 3 IN

    Type = Bulk

    Max Size = 64

    Polling Interval = 0

    enumeration:

    USBHub memory usage = 960

    USBHub claim_device this=20019140

    USBHub memory usage = 960

    USBHub claim_device this=20019500

    KeyboardController claim this=20017260

    KeyboardController claim this=20017500

    HIDParser claim this=200177A0

    HIDParser claim this=20017DC0

    HIDParser claim this=20018B00

    HIDParser claim this=20019980

    HIDParser claim this=20018400

    JoystickController claim this=20019FC0

    BluetoothController claim this=2001A520

    Descriptor 4 = INTERFACE

    KeyboardController claim this=20017260

    09 04 00 00 02 FF 47 D0 00 07 05 02 03 40 00 04 07 05 81 03 40 00 04 09 04 01 00 00 FF 47 D0 00 09 04 01 01 02 FF 47 D0 00 07 05 08 01 E4 00 01 07 05 87 01 E4 00 01 09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    KeyboardController claim this=20017500

    09 04 00 00 02 FF 47 D0 00 07 05 02 03 40 00 04 07 05 81 03 40 00 04 09 04 01 00 00 FF 47 D0 00 09 04 01 01 02 FF 47 D0 00 07 05 08 01 E4 00 01 07 05 87 01 E4 00 01 09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    HIDParser claim this=200177A0

    HIDParser claim this=20017DC0

    HIDParser claim this=20018B00

    HIDParser claim this=20019980

    HIDParser claim this=20018400

    JoystickController claim this=20019FC0

    09 04 00 00 02 FF 47 D0 00 07 05 02 03 40 00 04 07 05 81 03 40 00 04 09 04 01 00 00 FF 47 D0 00 09 04 01 01 02 FF 47 D0 00 07 05 08 01 E4 00 01 07 05 87 01 E4 00 01 09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    Jtype=0

    BluetoothController claim this=2001A520

    Descriptor 5 = ENDPOINT

    Descriptor 5 = ENDPOINT

    Descriptor 4 = INTERFACE

    KeyboardController claim this=20017260

    09 04 01 00 00 FF 47 D0 00 09 04 01 01 02 FF 47 D0 00 07 05 08 01 E4 00 01 07 05 87 01 E4 00 01 09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    KeyboardController claim this=20017500

    09 04 01 00 00 FF 47 D0 00 09 04 01 01 02 FF 47 D0 00 07 05 08 01 E4 00 01 07 05 87 01 E4 00 01 09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    HIDParser claim this=200177A0

    HIDParser claim this=20017DC0

    HIDParser claim this=20018B00

    HIDParser claim this=20019980

    HIDParser claim this=20018400

    JoystickController claim this=20019FC0

    09 04 01 00 00 FF 47 D0 00 09 04 01 01 02 FF 47 D0 00 07 05 08 01 E4 00 01 07 05 87 01 E4 00 01 09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    Jtype=0

    BluetoothController claim this=2001A520

    Descriptor 4 = INTERFACE

    KeyboardController claim this=20017260

    09 04 01 01 02 FF 47 D0 00 07 05 08 01 E4 00 01 07 05 87 01 E4 00 01 09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    KeyboardController claim this=20017500

    09 04 01 01 02 FF 47 D0 00 07 05 08 01 E4 00 01 07 05 87 01 E4 00 01 09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    HIDParser claim this=200177A0

    HIDParser claim this=20017DC0

    HIDParser claim this=20018B00

    HIDParser claim this=20019980

    HIDParser claim this=20018400

    JoystickController claim this=20019FC0

    09 04 01 01 02 FF 47 D0 00 07 05 08 01 E4 00 01 07 05 87 01 E4 00 01 09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    Jtype=0

    BluetoothController claim this=2001A520

    Descriptor 5 = ENDPOINT

    Descriptor 5 = ENDPOINT

    Descriptor 4 = INTERFACE

    KeyboardController claim this=20017260

    09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    KeyboardController claim this=20017500

    09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    HIDParser claim this=200177A0

    HIDParser claim this=20017DC0

    HIDParser claim this=20018B00

    HIDParser claim this=20019980

    HIDParser claim this=20018400

    JoystickController claim this=20019FC0

    09 04 02 00 00 FF 47 D0 00 09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    Jtype=0

    BluetoothController claim this=2001A520

    Descriptor 4 = INTERFACE

    KeyboardController claim this=20017260

    KeyboardController claim this=20017500

    HIDParser claim this=200177A0

    HIDParser claim this=20017DC0

    HIDParser claim this=20018B00

    HIDParser claim this=20019980

    HIDParser claim this=20018400

    JoystickController claim this=20019FC0

    09 04 02 01 02 FF 47 D0 00 07 05 04 02 40 00 00 07 05 83 02 40 00 00

    Jtype=0

    BluetoothController claim this=2001A520

    Descriptor 5 = ENDPOINT

    Descriptor 5 = ENDPOINT
    I'm not experienced with HID or USB enough to know what the printouts mean - is my device connecting correctly?

  12. #137
    Any updates? I tried printing "joystick" class attributes in the "XBOXONE" case to see if I can get button press info, but the library doesn't recognize/initialize the controller correctly. Can you look into this?

  13. #138
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,090
    Sorry, I have been (and mostly still am) distracted with other things.

    But some of the information I see, in your output:
    Code:
    VendorID = 24C6, ProductID = 581A, Version = 0101
    Class/Subclass/Protocol = 255 / 255 / 255
    Number of Configurations = 1
    enumeration:
    enumeration:
    Manufacturer: BDA
    enumeration:
    Product: XB1 Classic Controller
    enumeration:
    Serial Number: 00001AE88AC3F082
    Shows this is NOT a Microsoft XBox One controller, and as such our special casing code for the XBox One is not being run...

    Don't know anything about your controller or the like, but the current code knows it is an XBox one IF the Vendor ID and Product ID match to some known values.
    In particular at the start of joystick.cpp, is a static mapping table that maps a Vendor ID, Product ID, to what we think this joystick is....
    Code:
    JoystickController::product_vendor_mapping_t JoystickController::pid_vid_mapping[] = {
    	{ 0x045e, 0x02ea, XBOXONE, false },{ 0x045e, 0x02dd, XBOXONE, false },
    	{ 0x045e, 0x0719, XBOX360, false},
    	{ 0x045e, 0x028E, SWITCH, false},  // Switch? 
    	{ 0x054C, 0x0268, PS3, true}, 
    	{ 0x054C, 0x042F, PS3, true},	// PS3 Navigation controller
    	{ 0x054C, 0x03D5, PS3_MOTION, true},	// PS3 Motion controller
    	{ 0x054C, 0x05C4, PS4, true}, 	{0x054C, 0x09CC, PS4, true },
    	{ 0x046D, 0xC626, SpaceNav, true},  // 3d Connextion Space Navigator, 0x10008
    	{ 0x046D, 0xC628, SpaceNav, true}  // 3d Connextion Space Navigator, 0x10008
    };
    Right now we show 2 different Product IDs under the one Vendor ID (0x45e for Microsoft)...

    It might work for you if you simply add a new entry for your unit and see what happens.
    Something like:
    Code:
    JoystickController::product_vendor_mapping_t JoystickController::pid_vid_mapping[] = {
    	{ 0x045e, 0x02ea, XBOXONE, false },{ 0x045e, 0x02dd, XBOXONE, false },
    	{ 0x24C6, 0x581A, XBOXONE, false },
    	{ 0x045e, 0x0719, XBOX360, false},
    	{ 0x045e, 0x028E, SWITCH, false},  // Switch? 
    	{ 0x054C, 0x0268, PS3, true}, 
    	{ 0x054C, 0x042F, PS3, true},	// PS3 Navigation controller
    	{ 0x054C, 0x03D5, PS3_MOTION, true},	// PS3 Motion controller
    	{ 0x054C, 0x05C4, PS4, true}, 	{0x054C, 0x09CC, PS4, true },
    	{ 0x046D, 0xC626, SpaceNav, true},  // 3d Connextion Space Navigator, 0x10008
    	{ 0x046D, 0xC628, SpaceNav, true}  // 3d Connextion Space Navigator, 0x10008
    };
    If it does work let us, and we can hopefully officially add it this list. Note: The red line I added, would be good to have comment of brand, model of your unit

  14. #139
    Senior Member
    Join Date
    Apr 2020
    Location
    DFW area in Texas
    Posts
    115
    Don't know if it's related or not, but that VID:PID (24c6:581a) seems to be reported <here> as having problems working with xboxdrv. Curiously, according to <this> reference, that VID belongs to ThrustMaster, Inc. & according to <this> reference, it belongs to "Xbox 3rd Party Partners".

    Mark J Culross
    KD5RXT

  15. #140
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,090
    Note: Off and On, I look at seeing what it will take to support the XBox One in Bluetooth mode.

    The question at some point may be, do we continue to make things work as needed or does someone try to take the whole beast on and try to fully understand and implement whole sub-systems, state machines... Not sure if better to discuss the XBox stuff here or in the Bluetooth thread (fits both categories)

    But example in hand:

    In my debug output when trying to bind to XBox One, includes:
    Code:
    BT rx_data(1): 0 
        Extended Inquiry Result - Count: 1
          BD:dc:13:d6:1b:aa:9c, PS:1, class: 508
          Local Name: Xbox Wireless Controller
          Peripheral device
            Gamepad
    BluetoothController::find_driver  driver 200070f8
    JoystickController::claim_bluetooth TRUE
      JoystickController::mapNameToJoystickType 200070e0 Xbox Wireless Controller - set to XBOXONE
      Joystick Type: 3
        *** Claimed ***
    HCI_INQUIRY_CANCEL called (02 04 00 )
        control callback (bluetooth) 64
    
        Control callback (bluetooth): 100 : 2 4 0 
    0E 04 01 02 04 00 
    
    BT rx_data(6): e 4 1 2 4 0 
        Command Completed! 
    HCI_CREATE_CONNECTION called (05 04 0d dc 13 d6 1b aa 9c 18 cc 01 00 00 00 00 )
        control callback (bluetooth) 65
    
        Control callback (bluetooth): 101 : 5 4 d dc 13 d6 1b aa 9c 18 cc 1 0 0 0 0 
    0F 04 00 01 05 04 
    
    BT rx_data(6): f 4 0 1 5 4 
        Command 405 Status 0
    03 0B 00 48 00 DC 13 D6 1B AA 9C 01 00 
    
    BT rx_data(13): 3 b 0 48 0 dc 13 d6 1b aa 9c 1 0 
        Connection Complete - ST:0 LH:48
    HCI_AUTH_REQUESTED called (11 04 02 48 00 )
        control callback (bluetooth) 6E
    
        Control callback (bluetooth): 110 : 11 4 2 48 0 
    0F 04 00 00 11 04 
    
    BT rx_data(6): f 4 0 0 11 4 
        Command 411 Status 0
    
    =====================
    BT rx2_data(16): 48 20 c 0 8 0 1 0 2 1 4 0 1 0 40 0 
        L2CAP Connection Request: ID: 1, PSM: 1, SCID: 40
    1B 03 48 00 05 
    
    BT rx_data(5): 1b 3 48 0 5 
    17 06 DC 13 D6 1B AA 9C 
    ...
    You see the connection request has PSM: 1
    Which we have not handled before:

    If you look at the assigned numbers for this in: https://www.bluetooth.com/specificat...-link-control/
    You see: 1 = SDP
    We currently only try to handle: 0x11 - HID_Control and 0x13 - HID_Interrupt

    So looks like, we need to learn more about SDP.

    Note: As far as I know there have not gotten the XBOX One to work in BT mode with the USB Host Shield 2 code either. There is a WIP branch of it from a year ago, which was not working... But it looks like they have implemented some of SDP... But again I will probably first go down the rabbit hole of seeing of we can make sense of each new message we receive and fake it

  16. #141
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,457
    Morning @KurtE
    There is a bunch of stuff i posted on the other thread regarding the XBOXONE BT driver starting around post #730 from the results of BT sniffing on the Android and USBHost shield2.0. But you are absolutely correct about SDP. It looks like it uses SDP for authenication and initization and everything else seems to be our normal stuff the log can be read using Wireshark and it may help.

    Not sure where it is better to post the XBOX One?

    EDIT: You might be able to fake it so that when certain PSM=1 requests hit you just send the expected respons?

  17. #142
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,090
    Morning again,

    As I mentioned it was unclear to do it here or in Bluetooth, will probably go back to BT thread. But probably BT so off to the other thread...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •