T3.6 USB Host - Bluetooth

@defragster

Ok - going to throw you a monkey wrench - for the PS4 if no button is pressed the value is 8. :) Nothing easy or consistent. Easy enough fix though.
 
Oooppps - I was using 'r2' - not 'r1' - your table is fine.

How's this look for dewrenching? Assumes buttons will never be 0xffffffff. Can be adapted for other devices with NULL state not 0 or 8.
You'll have to confirm PS4 operation.
Code:
bool bShowVals = true;
void DebugShowValue( ) {
  static uint32_t buttonsLast = 0xffffffff;
  if ( 0xffffffff == buttonsLast ) {
    Serial.println( "Press right trigger 2 to toggle this printing.");
  }
  if ( buttonsLast != buttons ) {
    Serial.print(buttons);
    Serial.print( "\t0x" );
    Serial.println( buttons, HEX );
  }
  buttonsLast = buttons;
}

void KeyPadLoop() {
  buttons = joystick1.getButtons();

  switch (joystick1.joystickType()) {
  case JoystickController::UNKNOWN:
  case JoystickController::PS4:
  {
    if ( bShowVals && buttons != 8 ) {
      DebugShowValue( );
    }
    if (buttons == 0x80) { // right trigger #2
      bShowVals = !bShowVals; // Toggle Debug value
      delay(200); //debounce
    }
    if (buttons == 168 ) {
      ClearKeys();   //else but_START=false;
      but_START = true;
      delay(300);
    }
    if (buttons == 328 ) {
      ClearKeys();
      but_SELECT = true;
      delay(300);
    }  else but_SELECT = false;
    if (buttons == 262152 ) {
      ClearKeys();
      but_A = true;
    }  else but_A = false;
    if (buttons == 262152) {
      ClearKeys();
      but_B = true;
    }  else but_B = false;
    if (buttons == 0) {
      ClearKeys();   //else but_UP=false;
      but_UP = true;
    }
    if (buttons == 4) {
      ClearKeys();   //else but_DOWN=false;
      but_DOWN = true;
    }
    if (buttons == 6) {
      ClearKeys();   // else but_LEFT=false;
      but_LEFT = true;
    }
    if (buttons == 2) {
      ClearKeys();   //else but_RIGHT=false;
      but_RIGHT = true;
    }
  }
  break;
  case JoystickController::PS3:
  {
    if ( bShowVals && buttons != 0 ) {
      DebugShowValue( );
    }
    if (buttons == 512) { // right trigger #2
      bShowVals = !bShowVals; // Toggle Debug value
      delay(200); //debounce
    }
    if (buttons == 8 ) {
      ClearKeys();   //else but_START=false;
      but_START = true;
      delay(300);
    }
    if (buttons == 1 ) {
      ClearKeys();
      but_SELECT = true;
      delay(300);
    }  else but_SELECT = false;
    if (buttons == 32768 ) {
      ClearKeys();
      but_A = true;
    }  else but_A = false;
    if (buttons == 8192) {
      ClearKeys();
      but_B = true;
    }  else but_B = false;
    if (buttons == 16) {
      ClearKeys();   //else but_UP=false;
      but_UP = true;
    }
    if (buttons == 64) {
      ClearKeys();   //else but_DOWN=false;
      but_DOWN = true;
    }
    if (buttons == 128) {
      ClearKeys();   // else but_LEFT=false;
      but_LEFT = true;
    }
    if (buttons == 32) {
      ClearKeys();   //else but_RIGHT=false;
      but_RIGHT = true;
    }
  }
  break;
  default:
    break;
  }

  yield();
}
 
Last edited:
@mjs513 : Stopped changing the above. Completed a whole board - do the fruits really go away that quickly?

Have to go see the T4 trouble you were having, then see about getting mine to work - after utting fressh display zips into libs folder.

Going to do that MISO test now.
 
@mjs513 : Stopped changing the above. Completed a whole board - do the fruits really go away that quickly?

Have to go see the T4 trouble you were having, then see about getting mine to work - after utting fressh display zips into libs folder.

Going to do that MISO test now.
Yeah - kind of a let down sometimes but its still fun :)

Thanks for checking that problem I am having with the T4.

Good luck with the MISO test. Didn't get a chance to check it out.
 
Posted on T4 thread :: Teensy-4-0-First-Beta-Test with display ref posts.

<edited>

@Paul - will look on T4 thread ... if you see this RE the ILI9488 Display board you have.

Just tested MISO on ILI9341 and 9488 - on the Touch and TFT halves :: pjrc.com/better-spi-bus-design-in-3-steps/

As it seemed the TFT MISO on the ILI9488 I got from your posted link is not Tri-Stated

The Touch MISO on 9488 does go to 3.3V/2 between the two 10K's when its CS is made HIGH. And the same for BOTH TFT and TOUCH MISO on the ILI9341

The TFT MISO on 9488 does NOT go to 3.3V/2 between the two 10K's when its CS is made HIGH, is seems to drop to Zero.
 
Last edited:
@KurtE

For the heck of it I attached my wacom intuos pad and ran the mouse program. It did recognize it but no data is seen even with the debug turn on:
Code:
*** Device HID2 56a:302 - connected ***
  manufacturer: Wacom Co.,Ltd.
  product: Intuos PTS
*** Device HID3 56a:302 - connected ***
  manufacturer: Wacom Co.,Ltd.
  product: Intuos PTS
*** Device HID1 56a:302 - connected ***
  manufacturer: Wacom Co.,Ltd.
  product: Intuos PTS
Just thought I would let you know. This is on a T3.6. The T$ is giving me that problem with the USB again, on that it did recognize as a mouse.
 
Hi Mike, if you get a chance, you might try using the linux hid dump to get an idea of how this device is configured.
 
Morning Kurt. Ok hook it up and did a HID dump:
Code:
Usage Page (Desktop),                                           ; Generic desktop controls (01h)
Usage (Mouse),                                                  ; [COLOR="#FF0000"]Mouse (02h, application collection)[/COLOR]
Collection (Application),
    Usage (Pointer),                                            ;[COLOR="#FF0000"] Pointer (01h, physical collection)[/COLOR]
    Collection (Physical),
        Usage Page (Button),                                    ; [COLOR="#FF0000"]Button (09h)[/COLOR]
        Usage Minimum (01h),
        Usage Maximum (05h),
        Logical Minimum (0),
        Logical Maximum (1),
        Report Count (5),
        Report Size (1),
        Input (Variable),
        Report Count (1),
        Report Size (3),
        Input (Constant, Variable),
        Usage Page (Desktop),                                   ; Generic desktop controls (01h)
        Usage (Wheel),                                          ; [COLOR="#FF0000"]Wheel (38h, dynamic value)[/COLOR]
        Logical Minimum (-127),
        Logical Maximum (127),
        Report Size (8),
        Report Count (1),
        Input (Variable, Relative),
        Usage Page (Consumer),                                  ; Consumer (0Ch)
        Usage (AC Pan),                                         ; [COLOR="#FF0000"]AC pan (0238h, linear control)[/COLOR]
        Report Count (1),
        Input (Variable, Relative),
        Report Size (8),
        Report Count (1),
        Input (Constant, Variable),
        Usage Page (Desktop),                                   ; Generic desktop controls (01h)
        Usage (X),                                              ;[COLOR="#FF0000"] X (30h, dynamic value)[/COLOR]
        Usage (Y),                                              ; [COLOR="#FF0000"]Y (31h, dynamic value)[/COLOR]
        Logical Minimum (0),
        Logical Maximum (32767),
        Physical Minimum (0),
        Physical Maximum (32767),
        Report Size (16),
        Report Count (2),
        Input (Variable),
    End Collection,
It shows a couple of things that I don't think I have seen before "AC PAN" and "POINTER". It shows mouse, wheel, button, X and Y. Would have thought it would still pick it up as a mouse?

EDIT: Just looked through mouse.cpp and it looks like it should be picking it up as a mouse - even AC PAN. Unless its a power issue.
 
Last edited:
I would probably run the usbhost with the debug output and see what is happening. Wonder how many HID reports it is generating? It showed three in your first run... Maybe add one or two more and see what happens?
 
I tried with debug on and nothing printed to serial1 going to try again and see what happens.
EDIT: My mistake had the wire wrong
Code:
960

sizeof Device = 36
sizeof Pipe = 96
sizeof Transfer = 64
power up USBHS PHY

 reset waited 4
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 1FFF6000
periodictable = 1FFF6000
port change: 10001803
    connect
  begin reset
port change: 18001205
  port enabled
  end recovery
new_Device: 480 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 10 02 09 00 01 40 09 21 11 28 70 90 01 02 00 01 
    VendorID = 2109, ProductID = 2811, Version = 9070
    Class/Subclass/Protocol = 9(Hub) / 0 / 1(Single-TT)
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: VIA Labs, Inc.         
enumeration:
Product: USB2.0 Hub             
enumeration:
Config data length = 25
enumeration:
Configuration Descriptor:
  09 02 19 00 01 01 00 E0 00 
    NumInterfaces = 1
    ConfigurationValue = 1
  09 04 00 00 01 09 00 00 00 
    Interface = 0
    Number of endpoints = 1
    Class/Subclass/Protocol = 9(Hub) / 0 / 0
  07 05 81 03 01 00 0C 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 1
    Polling Interval = 12
enumeration:
USBHub memory usage = 960
USBHub claim_device this=1FFF3340
found possible interface, altsetting=0
number of interfaces found = 1
USBHub control callback
09 29 04 E9 01 32 64 00 FF 00 00 00 00 00 00 00 
Hub ports = 4
USBHub control callback
USBHub control callback
USBHub control callback
USBHub control callback
power turned on to all ports
device addr = 1
new_Pipe
allocate_interrupt_pipe_bandwidth
  ep interval = 12
  interval = 256
 best_bandwidth = 2, at offset = 0
pipe cap1 = F0012101
0HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
01 01 01 00 
New Port Status
  status=10101  port=1
  state=0
  Device is present: 
  Has Power
USBHub control callback
Port Status Cleared, port=1
timer event (20000 us): Debounce Timer, this = 1FFF3340, timer = 1FFF3658
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=2
  Device is present: 
  Has Power

timer event (20000 us): Debounce Timer, this = 1FFF3340, timer = 1FFF3658
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=3
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 1FFF3340, timer = 1FFF3658
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=4
  Device is present: 
  Has Power

timer event (19999 us): Debounce Timer, this = 1FFF3340, timer = 1FFF3658
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=5
  Device is present: 
  Has Power
timer event (19999 us): Debounce Timer, this = 1FFF3340, timer = 1FFF3658
ports in use bitmask = 2
getstatus, port = 1
USBHub control callback
01 01 00 00 
New Port Status
  status=101  port=1
  state=6
  Device is present: 
  Has Power
sending reset
send_setreset

USBHub control callback
unhandled setup, message = 40323
timer event (19999 us): Debounce Timer, this = 1FFF3340, timer = 1FFF3658
ports in use bitmask = 0

HUB Callback (member)
status = 2
getstatus, port = 1
USBHub control callback
03 01 10 00 
New Port Status
  status=100103  port=1
  state=7
  Device is present: 
  Enabled, speed = 12 Mbit/sec
  Has Power
USBHub control callback
unhandled setup, message = 140123

timer event (25000 us): Hello, I'm resettimer, this = 1FFF3340, timer = 1FFF3674
port_doing_reset = 1
PORT_RECOVERY
new_Device: 12 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 02 00 00 00 40 6A 05 02 03 00 01 01 02 00 01 
    VendorID = 056A, ProductID = 0302, Version = 0100
    Class/Subclass/Protocol = 0 / 0 / 0
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: Wacom Co.,Ltd.
enumeration:
Product: Intuos PTS
enumeration:
Config data length = 84
enumeration:
Configuration Descriptor:
  09 02 54 00 03 01 00 80 F9 
    NumInterfaces = 3
    ConfigurationValue = 1
  09 04 00 00 01 03 00 00 00 
    Interface = 0
    Number of endpoints = 1
    Class/Subclass/Protocol = 3(HID) / 0 / 0
  09 21 10 01 00 01 22 C0 00 
    HID, 1 report descriptor
  07 05 81 03 10 00 02 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 16
    Polling Interval = 2
  09 04 01 00 01 03 00 00 00 
    Interface = 1
    Number of endpoints = 1
    Class/Subclass/Protocol = 3(HID) / 0 / 0
  09 21 10 01 00 01 22 26 00 
    HID, 1 report descriptor
  07 05 82 03 40 00 02 
    Endpoint = 2 IN
    Type = Interrupt
    Max Size = 64
    Polling Interval = 2
  09 04 02 00 01 03 01 02 00 
    Interface = 2
    Number of endpoints = 1
    Class/Subclass/Protocol = 3(HID) / 1(Boot) / 2(Mouse)
  09 21 10 01 00 01 22 34 00 
    HID, 1 report descriptor
  07 05 83 03 40 00 02 
    Endpoint = 3 IN
    Type = Interrupt
    Max Size = 64
    Polling Interval = 2
enumeration:
USBHub memory usage = 960
USBHub claim_device this=1FFF2580
KeyboardController claim this=1FFF2020
KeyboardController claim this=1FFF22C0
HIDParser claim this=1FFF4300
HIDParser claim this=1FFF2940
HIDParser claim this=1FFF2E40
HIDParser claim this=1FFF4800
HIDParser claim this=1FFF3700
JoystickController claim this=1FFF4E80
BluetoothController claim this=1FFF3C60
Descriptor 4 = INTERFACE
KeyboardController claim this=1FFF2020
09 04 00 00 01 03 00 00 00 09 21 10 01 00 01 22 C0 00 07 05 81 03 10 00 02 09 04 01 00 01 03 00 00 00 09 21 10 01 00 01 22 26 00 07 05 82 03 40 00 02 09 04 02 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 83 03 40 00 02 
KeyboardController claim this=1FFF22C0
09 04 00 00 01 03 00 00 00 09 21 10 01 00 01 22 C0 00 07 05 81 03 10 00 02 09 04 01 00 01 03 00 00 00 09 21 10 01 00 01 22 26 00 07 05 82 03 40 00 02 09 04 02 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 83 03 40 00 02 
HIDParser claim this=1FFF4300
 bInterfaceClass =    3
 bInterfaceSubClass = 0
 bInterfaceProtocol = 0
HID Parser Claim: 09 04 00 00 01 03 00 00 00 09 21 10 01 00 01 22 C0 00 07 05 81 03 10 00 02 09 04 01 00 01 03 00 00 00 09 21 10 01 00 01 22 26 00 07 05 82 03 40 00 02 09 04 02 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 83 03 40 00 02 
report descriptor size = 192
Single endpoint HID:
  endpoint = 81
   size = 16
   interval = 2
new_Pipe
allocate_interrupt_pipe_bandwidth
 best_bandwidth = 3, at offset = 0, shift= 1
Descriptor 33 = HID
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=1FFF2020
09 04 01 00 01 03 00 00 00 09 21 10 01 00 01 22 26 00 07 05 82 03 40 00 02 09 04 02 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 83 03 40 00 02 
KeyboardController claim this=1FFF22C0
09 04 01 00 01 03 00 00 00 09 21 10 01 00 01 22 26 00 07 05 82 03 40 00 02 09 04 02 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 83 03 40 00 02 
HIDParser claim this=1FFF2940
 bInterfaceClass =    3
 bInterfaceSubClass = 0
 bInterfaceProtocol = 0
HID Parser Claim: 09 04 01 00 01 03 00 00 00 09 21 10 01 00 01 22 26 00 07 05 82 03 40 00 02 09 04 02 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 83 03 40 00 02 
report descriptor size = 38
Single endpoint HID:
  endpoint = 82
   size = 64
   interval = 2
new_Pipe
allocate_interrupt_pipe_bandwidth
 best_bandwidth = 5, at offset = 1, shift= 0
Descriptor 33 = HID
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=1FFF2020
09 04 02 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 83 03 40 00 02 
KeyboardController claim this=1FFF22C0
09 04 02 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 83 03 40 00 02 
HIDParser claim this=1FFF2E40
 bInterfaceClass =    3
 bInterfaceSubClass = 1
 bInterfaceProtocol = 2
HID Parser Claim: 09 04 02 00 01 03 01 02 00 09 21 10 01 00 01 22 34 00 07 05 83 03 40 00 02 
report descriptor size = 52
Single endpoint HID:
  endpoint = 83
   size = 64
   interval = 2
new_Pipe
allocate_interrupt_pipe_bandwidth
 best_bandwidth = 7, at offset = 1, shift= 3
Descriptor 33 = HID
Descriptor 5 = ENDPOINT
control callback (hid)
06 0D FF 09 01 A1 01 85 02 A1 00 06 00 FF 09 01 15 00 26 FF 00 75 08 95 09 81 02 C0 09 01 85 02 95 01 B1 02 09 01 85 03 95 01 B1 02 09 01 85 04 95 01 B1 02 09 01 85 05 95 01 B1 02 09 01 85 10 95 02 B1 02 09 01 85 11 95 10 B1 02 09 01 85 13 95 01 B1 02 09 01 85 07 95 09 B1 02 09 01 85 20 95 05 B1 02 09 01 85 21 95 01 B1 02 09 01 85 22 95 01 B1 02 09 01 85 23 95 0E B1 02 09 01 85 14 95 1F B1 02 09 01 85 30 96 02 00 B1 02 09 01 85 31 96 09 01 B1 02 09 01 85 32 96 08 01 B1 02 09 01 85 33 95 01 B1 02 09 01 85 24 95 1F B1 02 09 01 85 25 95 04 B1 1F 85 C0 09 00 95 09 81 02 C0 
  mesg = 22000681
  got report descriptor
Found top level collection FF0D0001
find_driver
  driver 1FFF202C
  driver 1FFF22CC
  driver 1FFF3C00
  driver 1FFF4E8C
  driver 1FFF4D20
Rawhid Claim: 56a:302 usage: ff0d0001
  driver 1FFF4DC0
Rawhid Claim: 56a:302 usage: ff0d0001
control callback (hid)
06 00 FF 09 80 A1 01 85 02 09 01 15 00 26 FF 00 75 08 95 3F 81 03 85 03 09 01 15 00 26 FF 00 75 08 95 3F 81 03 C0 
  mesg = 22000681
  got report descriptor
Found top level collection FF000080
find_driver
  driver 1FFF202C
  driver 1FFF22CC
  driver 1FFF3C00
  driver 1FFF4E8C
  driver 1FFF4D20
Rawhid Claim: 56a:302 usage: ff000080
  driver 1FFF4DC0
Rawhid Claim: 56a:302 usage: ff000080
control callback (hid)
05 01 09 02 A1 01 85 01 09 01 A1 00 05 09 19 01 29 05 15 00 25 01 95 05 75 01 81 02 95 01 75 03 81 01 05 01 09 30 09 31 15 81 25 7F 75 08 95 02 81 06 C0 C0 
  mesg = 22000681
  got report descriptor
Found top level collection 10002
find_driver
  driver 1FFF202C
  driver 1FFF22CC
  driver 1FFF3C00

HID: 1 - C0 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 
HID: 1 - 02 01 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
HID: 1 - 02 01 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
HID: 1 - 02 01 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
HID: 1 - 02 01 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

EDIT: Think the problem is this:
Code:
Rawhid Claim: 56a:302 usage: 10002

The mouse.cpp file has:
Code:
	if (topusage != 0x10001) return CLAIM_NO;
but there may be other problems as well.

EDIT2: Not sure your mask is right for 10002
Code:
	usage &= 0xFFFF;
This will give (I deleted the test for 10001):
Code:
Mouse: usage=FF000100, value=0
FF00
  usage = FF000101  data = 0
Mouse: usage=FF000101, value=0
FF00
  usage = FF000102  data = 0
Mouse: usage=FF000102, value=0
FF00
  usage = FF000103  data = 0
Mouse: usage=FF000103, value=0
FF00
  usage = FF000104  data = 0
Mouse: usage=FF000104, value=0
FF00
  usage = FF000105  data = 0
Mouse: usage=FF000105, value=0
FF00
  usage = FF000106  data = 0
Mouse: usage=FF000106, value=0
FF00
  usage = FF000107  data = 0
Mouse: usage=FF000107, value=0
FF00
  usage = FF000108  data = 1
Mouse: usage=FF000108, value=1
FF00
When I think you just want 0 - 8. The FF00 is:
Code:
	uint32_t usage_page = usage >> 16;
	USBHDBGSerial.println(usage_page,HEX);
 
Last edited:
@mjs513 - Sorry I missed responding to this one.

Looks like we need to walk though this one and see what is happening.

As for Usage values, need to go through the tables that define this, example: https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf

If you look at page 26, it looks like I/we are only handling Pointer and not Mouse? So probably should change the claim code to 10001 and 10002 and see what that does, to start
 
@KurtE

I did try to change the 10001 to 10002 as a test to see if I would get mouse data but usage_page and usage was still not right:
Code:
begin, usage=FF0D0000
       type= 2
       min=  0
       max=  255
       reportcount=9
       usage count=0
Input, total bits=72
  usage = FF000100  data = 224
Mouse: usage=FF000100, value=224
Mouse: +usage=100, value=224
Mouse: +usage=FF00 
  usage = FF000101  data = 13
Mouse: usage=FF000101, value=13
Mouse: +usage=101, value=13
Mouse: +usage=FF00 
  usage = FF000102  data = 51
Mouse: usage=FF000102, value=51
Mouse: +usage=102, value=51
Mouse: +usage=FF00 
  usage = FF000103  data = 115
Mouse: usage=FF000103, value=115
Mouse: +usage=103, value=115
Mouse: +usage=FF00 
  usage = FF000104  data = 19
Mouse: usage=FF000104, value=19
Mouse: +usage=104, value=19
Mouse: +usage=FF00 
  usage = FF000105  data = 0
Mouse: usage=FF000105, value=0
Mouse: +usage=105, value=0
Mouse: +usage=FF00 
  usage = FF000106  data = 0
Mouse: usage=FF000106, value=0
Mouse: +usage=106, value=0
Mouse: +usage=FF00 
  usage = FF000107  data = 45
Mouse: usage=FF000107, value=45
Mouse: +usage=107, value=45
Mouse: +usage=FF00 
  usage = FF000108  data = 0
Mouse: usage=FF000108, value=0
Mouse: +usage=108, value=0
Mouse: +usage=FF00 
HID: 1 - 02 E0 0F 33 61 13 00 00 2D 00 00 00 00 00 00 00

Put this on the back burner for now while playing with other stuff.
 
Hi @mjs513 - Not sure what is going on. I would think in theory changing
Code:
hidclaim_t MouseController::claim_collection(USBHIDParser *driver, Device_t *dev, uint32_t topusage)
{
	// only claim Desktop/Mouse
	if (topusage != 0x10002) return CLAIM_NO;
	// only claim from one physical device
	if (mydevice != NULL && dev != mydevice) return CLAIM_NO;
	mydevice = dev;
	collections_claimed++;
	return CLAIM_REPORT;
}
to
Code:
hidclaim_t MouseController::claim_collection(USBHIDParser *driver, Device_t *dev, uint32_t topusage)
{
	// only claim Desktop/Mouse
	if ((topusage != 0x10002) && ((topusage != 0x10001)) return CLAIM_NO;
	// only claim from one physical device
	if (mydevice != NULL && dev != mydevice) return CLAIM_NO;
	mydevice = dev;
	collections_claimed++;
	return CLAIM_REPORT;
}
Should properly claim this one...

And your HIDDUMP looked like it should generate a proper report where the usage page should be 9 for the buttons and 1 for wheel and X Y... Which should be picked up.
You appear to be getting page FF00 which is typically vendor specific...

I am wondering if you did the HID DUMP again if there were not multiple HID reports.

That is often the command I use is:
Code:
kurt@kurt-UP-CHT01:~$ sudo usbhid-dump  -i0 | grep -v : | xxd -r -p | hidrd-convert -o spec
where the -i0 is only for the first index. you might also try -i1 and -i2... Or if you remove this parameter it will do it for all HID objects it finds...
 
@KurtE

Morning - since I just woke up from my nap :) Yep - redid the usage report and seeing 2 collections - one is vendor specific and the other is for mouse:
Code:
sudo usbhid-dump -i0 | grep -v : | xxd -r -p | hidrd-convert -o spec
Usage Page (FF0Dh),                                             ; FF0Dh, vendor-defined
Usage (01h),
Collection (Application),
    Report ID (2),
    Collection (Physical),
        Usage Page (FF00h),                                     ; FF00h, vendor-defined
        Usage (01h),
        Logical Minimum (0),
        Logical Maximum (255),
        Report Size (8),
        Report Count (9),
        Input (Variable),
    End Collection,
    Usage (01h),
    Report ID (2),
    Report Count (1),
    Feature (Variable),
    Usage (01h),
    Report ID (3),
    Report Count (1),
    Feature (Variable),
    Usage (01h),
    Report ID (4),
    Report Count (1),
    Feature (Variable),
    Usage (01h),
    Report ID (5),
    Report Count (1),
    Feature (Variable),
    Usage (01h),
    Report ID (16),
    Report Count (2),
    Feature (Variable),
    Usage (01h),
    Report ID (17),
    Report Count (16),
    Feature (Variable),
    Usage (01h),
    Report ID (19),
    Report Count (1),
    Feature (Variable),
    Usage (01h),
    Report ID (7),
    Report Count (9),
    Feature (Variable),
    Usage (01h),
    Report ID (32),
    Report Count (5),
    Feature (Variable),
    Usage (01h),
    Report ID (33),
    Report Count (1),
    Feature (Variable),
    Usage (01h),
    Report ID (34),
    Report Count (1),
    Feature (Variable),
    Usage (01h),
    Report ID (35),
    Report Count (14),
    Feature (Variable),
    Usage (01h),
    Report ID (20),
    Report Count (31),
    Feature (Variable),
    Usage (01h),
    Report ID (48),
    Report Count (2),
    Feature (Variable),
    Usage (01h),
    Report ID (49),
    Report Count (265),
    Feature (Variable),
    Usage (01h),
    Report ID (50),
    Report Count (264),
    Feature (Variable),
    Usage (01h),
    Report ID (51),
    Report Count (1),
    Feature (Variable),
    Usage (01h),
    Report ID (36),
    Report Count (31),
    Feature (Variable),
    Usage (01h),
    Report ID (37),
    Report Count (4),
    Feature (Constant, Variable, Relative, Wrap, Non Linear),
    Report ID (192),
    Usage (00h),
    Report Count (9),
    Input (Variable),
End Collection,
Usage Page (Desktop),                                           ; Generic desktop controls (01h)
Usage (Mouse),                                                  ; Mouse (02h, application collection)
Collection (Application),
    Usage (Pointer),                                            ; Pointer (01h, physical collection)
    Collection (Physical),
        Usage Page (Button),                                    ; Button (09h)
        Usage Minimum (01h),
        Usage Maximum (05h),
        Logical Minimum (0),
        Logical Maximum (1),
        Report Count (5),
        Report Size (1),
        Input (Variable),
        Report Count (1),
        Report Size (3),
        Input (Constant, Variable),
        Usage Page (Desktop),                                   ; Generic desktop controls (01h)
        Usage (Wheel),                                          ; Wheel (38h, dynamic value)
        Logical Minimum (-127),
        Logical Maximum (127),
        Report Size (8),
        Report Count (1),
        Input (Variable, Relative),
        Usage Page (Consumer),                                  ; Consumer (0Ch)
        Usage (AC Pan),                                         ; AC pan (0238h, linear control)
        Report Count (1),
        Input (Variable, Relative),
        Report Size (8),
        Report Count (1),
        Input (Constant, Variable),
        Usage Page (Desktop),                                   ; Generic desktop controls (01h)
        Usage (X),                                              ; X (30h, dynamic value)
        Usage (Y),                                              ; Y (31h, dynamic value)
        Logical Minimum (0),
        Logical Maximum (32767),
        Physical Minimum (0),
        Physical Maximum (32767),
        Report Size (16),
        Report Count (2),
        Input (Variable),
    End Collection,
End Collection
The intus I have has two modes of operation (1) to use like a mouse with your finger and (2) using the pen. The testing used the first mode - to use like a mouse.
 
@KurtE
Mine was sitting on the shelf for years just collecting dust :) that why I figured I would give it a try for the fun and was looking for something to work on until I decided to try Buddhabrots.
 
Morning @KurtE

Found something very interesting to help analyze USB Descriptors and Request. The link was buried in one of the cpp files:

http://eleccelerator.com/usbdescreqparser/

EDIT: Decided to play a little more today with the intuos to see if anything popped out at me, so attaching it again to the T3.6 since it keeps hanging my T4. I noticed that RawHid is claiming the claiming the device but not sure why... just talking out loud here.
 
Last edited:
@mjs513 - Good Morning to you as well,

Looks like a nice site.

I would be surprised if RawHid actually claimed it? Anything is possible.
Note: If debug printing is turned on, it will always show the claim message:
USBHDBGSerial.printf("Rawhid Claim: %x:%x usage: %x\n", dev->idVendor, dev->idProduct, topusage);
As this is the first line in the claim_collection member...

But then it decides if it will actually claim it and currently, this is setup like:
Code:
	if ((dev->idVendor != 0x16c0 || (dev->idProduct) != 0x486)) return CLAIM_NO;
	if (mydevice != NULL && dev != mydevice) return CLAIM_NO;
	if (usage_) return CLAIM_NO;			// Only claim one
	if (fixed_usage_  && (fixed_usage_ != topusage)) return CLAIM_NO; 	// See if we want specific one and if so is it this one
That is it will only say yes if PID VID is: 16c0:0486

Only claim one and if a fixed usage value is set, use it, ... Probably at some point may either need to relax more and or setup more specific tests. I think the two setup in the mouse.ino were to match the Teensy rawhid test program as well as the Serial USB raw hid emulation...
 
@KurtE

You are right - still learning the code. Anyway the problem as I see it is that while 0x10002 identifies it as a mouse the data for the pen comes out using 0xFF0D0001 top_usage not 0x10002. So it messes things up. Not sure where the finger data comes out. When I print out the top_usage I see three values:
Code:
FF0D0001
FF000080
10002
Almost easier to derive a new class for Intuos - Argh. Ok more debugging later.
 
@KurtE

I created a new class called DigitizerController so I could experiment with, without worrying about messing mouse up. Attaching in case you want to play. Getting data but it makes no sense so I am missing something. More debug time :)

View attachment USBHost_t36-WIP.zip
 
My android phone just updated and while walking the menus this Developer option stood out given current context:
Enable Bluetooth HCI snoop log: Sometimes, a developer (or security specialist) will need to capture and analyze Bluetooth HCI (Host Controller Interface) packets. Enabling this will place them in a file on the device storage (/sdcard/btsnoop_hci.log) for retrieval. You can then analyze them with a program like Wireshark.

Not sure how extensive or useful the log might be and for what devices?

KurtE doesn't have current Android? - though it looks like the support isn't just on newer version 9 but maybe back to Android 4.4 if there is one sitting around?
 
Sorry most of my stuff is IOS? Although I might still have an Amazon Fire HD around here somewhere that ran some form of Android...
 
Not sure what device it might help for - or that I have any of them ...

Was just a note - in case it might help if Mike does not use that (kr)aPPle stuff. I don't expect Fire's have the Developer exposed? Even activating on Android used to take a secret handshake:
Open Settings on your android phone.
Scroll down until see System sections , tap on About device.
Tap on Build number 7 times to enable developer options on your android lollipop (5.1.1) devices.
 
Back
Top