no key presses are seen from ultimarc keyboard using USBHost_t36 library (teensy4.1)

Status
Not open for further replies.

garymuhonen

New member
I'm using a ultimarc.com miniPAC arcade game controller (link) that acts like a USB keyboard to send keystrokes to a computer (when the connected switches are activated).

If I hook the miniPAC up to my MAC computer, it indeed acts like a keyboard, and keys that it sends to the MAC are displayed in a text editor as ascii characters.

I'm using a Teensy 4.1 with the CABLE_USB_HOST_T36 plugged into the 5 pins on top of the teensy.

I'm using the example program provided with the USBHOST_t36 libary: USBHost_t36/Serial/Mouse.ino which provides support for USB mice and keyboards.

If I hook up a USB apple keyboard to the Teensy, the program displays the keys that I press on the keyboard, just as one would expect.

If I hook up the ultimarc controller to the Teensy, the program sends the following to the serial monitor upon startup:

Code:
USB Host Testing
960
*** Device KB1 d209:440 - connected ***
  manufacturer: Ultimarc
  product: Mini-PAC
  Serial: 4
*** Device HID1 d209:440 - connected ***
  manufacturer: Ultimarc
  product: Mini-PAC
  Serial: 4
*** Device HID2 d209:440 - connected ***
  manufacturer: Ultimarc
  product: Mini-PAC
  Serial: 4
*** HID Device Mouse1 d209:440 - connected ***
  manufacturer: Ultimarc
  product: Mini-PAC
  Serial: 4

But any buttons that I push (connected to the ultimarc) do not seem to be detected by the example program (nothing is displayed on the serial monitor).

Any ideas of some things I can try to detect these keys?
Thanks!
 
There is a DEBUG enable flag in the one header IIRC - that will perhaps show the passing of other messages to be handled.
 
Yes, you might try turning on debug printing. Go into USBHost_t36.h file (in libraries\USBHost_t36 directory) and about line 62 un-comment the line:

Code:
//#define USBHOST_PRINT_DEBUG

It will be interesting to see what messages this one sends when you press a button. Hopefully the debug will show some of the details.

It may turn out it is not sending the data in what is known as Boot protocol, which is what our USB Keyboard stuff is doing. Wonder if telling it to go into boot mode will do anything?

Two ways of doing that:
We have a method you can call on the KBD object like: kbd.forceBootProtocol()
That tries to force it... It also is setup that you can hopefully do it before or after the keyboard object is found...

Second way: we have a table in the keyboard.cpp file that has a list of Vendor IDs(VID) and Product IDS(PID) that we automatically force. So far only one in this list:
keyboard.cpp about line 97, where one could try to add an item like {0xd209, 0} to the list and see if that helps or not...
Or could be more specific and replace the 0 with 0x440 which is the PID printed in your posting
 
Thank you both for your suggestions!

Yes, you might try turning on debug printing. Go into USBHost_t36.h file (in libraries\USBHost_t36 directory) and about line 62 un-comment the line:

I uncommented the debug line, and I now see the following upon startup of the Mouse.ino example program. Unfortunately, it does not show anything when I press a button on the ulltimarc board. Does this provide any clues?
Code:
USB Host Testing
960
USB2 PLL running
 reset waited 6
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 20009000
periodictable = 20009000
port change: 10001803
    connect
  begin reset
port change: 10001805
  port enabled
  end recovery
new_Device: 12 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 02 00 00 00 08 09 D2 40 04 55 00 03 02 01 01 
    VendorID = D209, ProductID = 0440, Version = 0055
    Class/Subclass/Protocol = 0 / 0 / 0
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: Ultimarc
enumeration:
Product: Mini-PAC
enumeration:
Serial Number: 4
enumeration:
Config data length = 84
enumeration:
Configuration Descriptor:
  09 02 54 00 03 01 02 A0 FA 
    NumInterfaces = 3
    ConfigurationValue = 1
  09 04 00 00 01 03 01 01 02 
    Interface = 0
    Number of endpoints = 1
    Class/Subclass/Protocol = 3(HID) / 1(Boot) / 1(Keyboard)
  09 21 11 01 00 01 22 3F 00 
    HID, 1 report descriptor
  07 05 81 03 20 00 05 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 32
    Polling Interval = 5
  09 04 01 00 01 03 01 02 02 
    Interface = 1
    Number of endpoints = 1
    Class/Subclass/Protocol = 3(HID) / 1(Boot) / 2(Mouse)
  09 21 11 01 00 01 22 79 00 
    HID, 1 report descriptor
  07 05 82 03 08 00 05 
    Endpoint = 2 IN
    Type = Interrupt
    Max Size = 8
    Polling Interval = 5
  09 04 02 00 01 03 00 00 02 
    Interface = 2
    Number of endpoints = 1
    Class/Subclass/Protocol = 3(HID) / 0 / 0
  09 21 11 01 00 01 22 3A 00 
    HID, 1 report descriptor
  07 05 84 03 40 00 0A 
    Endpoint = 4 IN
    Type = Interrupt
    Max Size = 64
    Polling Interval = 10
enumeration:
USBHub memory usage = 960
USBHub claim_device this=20005DA0
USBHub memory usage = 960
USBHub claim_device this=20004D60
KeyboardController claim this=20004800
KeyboardController claim this=20004AA0
HIDParser claim this=20006F20
HIDParser claim this=20005120
HIDParser claim this=20005760
HIDParser claim this=20007560
HIDParser claim this=20006160
JoystickController claim this=20007D20
BluetoothController claim this=20006800
Descriptor 4 = INTERFACE
KeyboardController claim this=20004800
09 04 00 00 01 03 01 01 02 09 21 11 01 00 01 22 3F 00 07 05 81 03 20 00 05 09 04 01 00 01 03 01 02 02 09 21 11 01 00 01 22 79 00 07 05 82 03 08 00 05 09 04 02 00 01 03 00 00 02 09 21 11 01 00 01 22 3A 00 07 05 84 03 40 00 0A 
ep = 81
packet size = 32
polling interval = 5
new_Pipe
allocate_interrupt_pipe_bandwidth
 best_bandwidth = 3, at offset = 0, shift= 0
Descriptor 33 = HID
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=20004AA0
09 04 01 00 01 03 01 02 02 09 21 11 01 00 01 22 79 00 07 05 82 03 08 00 05 09 04 02 00 01 03 00 00 02 09 21 11 01 00 01 22 3A 00 07 05 84 03 40 00 0A 
HIDParser claim this=20006F20
 bInterfaceNumber =   1
 bInterfaceClass =    3
 bInterfaceSubClass = 1
 bInterfaceProtocol = 2
HID Parser Claim: 09 04 01 00 01 03 01 02 02 09 21 11 01 00 01 22 79 00 07 05 82 03 08 00 05 09 04 02 00 01 03 00 00 02 09 21 11 01 00 01 22 3A 00 07 05 84 03 40 00 0A 
report descriptor size = 121
Single endpoint HID:
  endpoint = 82
   size = 8
   interval = 5
new_Pipe
allocate_interrupt_pipe_bandwidth
 best_bandwidth = 3, at offset = 1, shift= 0
Descriptor 33 = HID
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=20004AA0
09 04 02 00 01 03 00 00 02 09 21 11 01 00 01 22 3A 00 07 05 84 03 40 00 0A 
HIDParser claim this=20005120
 bInterfaceNumber =   2
 bInterfaceClass =    3
 bInterfaceSubClass = 0
 bInterfaceProtocol = 0
HID Parser Claim: 09 04 02 00 01 03 00 00 02 09 21 11 01 00 01 22 3A 00 07 05 84 03 40 00 0A 
report descriptor size = 58
Single endpoint HID:
  endpoint = 84
   size = 64
   interval = 10
new_Pipe
allocate_interrupt_pipe_bandwidth
 best_bandwidth = 5, at offset = 0, shift= 3
Descriptor 33 = HID
Descriptor 5 = ENDPOINT
control callback (keyboard)
  mesg = A21
*** Device KB1 d209:440 - connected ***
  manufacturer: Ultimarc
  product: Mini-PAC
  Serial: 4
*** Device HID1 d209:440 - connected ***
  manufacturer: Ultimarc
  product: Mini-PAC
  Serial: 4
*** Device HID2 d209:440 - connected ***
  manufacturer: Ultimarc
  product: Mini-PAC
  Serial: 4
control callback (hid)
95 03 75 01 81 02 95 01 75 05 81 01 95 03 75 08 81 01 C0 05 0C 09 01 A1 01 85 02 15 00 25 01 09 E9 09 EA 09 E2 09 CD 19 B5 29 B8 75 01 95 08 81 02 95 03 75 08 81 01 C0 05 01 09 02 A1 00 85 03 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 01 75 05 81 01 05 01 09 30 09 31 16 00 80 26 FF 7F 75 10 95 02 81 06 C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  mesg = 22000681
  got report descriptor
Found top level collection C0001
find_driver
  driver 2000480C
Found top level collection 10002
find_driver
  driver 2000480C
  driver 20004AAC
  driver 200067A0
*** HID Device Mouse1 d209:440 - connected ***
  manufacturer: Ultimarc
  product: Mini-PAC
  Serial: 4
control callback (hid)
05 01 09 00 A1 01 85 03 05 08 09 4B 95 04 75 08 81 02 05 08 09 4B 95 04 75 08 91 20 C0 05 06 09 00 A1 01 85 04 05 08 09 4B 95 60 75 08 81 02 05 08 09 4B 95 60 75 08 91 20 C0 
  mesg = 22000681
  got report descriptor
Found top level collection 10000
find_driver
  driver 2000480C
  driver 20004AAC
  driver 200067A0
  driver 20007D2C
  driver 20007BC0
Rawhid Claim: d209:440 usage: 10000
  driver 20007C60
Rawhid Claim: d209:440 usage: 10000
No Driver claimed topusage: 10000
Found top level collection 60000
find_driver
  driver 2000480C
  driver 20004AAC
  driver 200067A0
  driver 20007D2C
  driver 20007BC0
Rawhid Claim: d209:440 usage: 60000
  driver 20007C60
Rawhid Claim: d209:440 usage: 60000
No Driver claimed topusage: 60000
KeyboardController Callback (member)
  KB Data: 00 00 00 00 00 00 00 00 
ERROR Followup
Ruh Roh, unsupported tag, not a good thing Scoob 0
Ruh Roh, unsupported tag, not a good thing Scoob 0
Ruh Roh, unsupported tag, not a good thing Scoob 0

We have a method you can call on the KBD object like: kbd.forceBootProtocol()
That tries to force it... It also is setup that you can hopefully do it before or after the keyboard object is found...

I tried putting these two lines of code before and after myusb.begin(). This did not change the results printed to the serial monitor
Code:
keyboard1.forceBootProtocol(); 
keyboard2.forceBootProtocol();  
  
  myusb.begin();
  
keyboard1.forceBootProtocol(); 
keyboard2.forceBootProtocol();


Second way: we have a table in the keyboard.cpp file that has a list of Vendor IDs(VID) and Product IDS(PID) that we automatically force. So far only one in this list:
keyboard.cpp about line 97, where one could try to add an item like {0xd209, 0} to the list and see if that helps or not...
Or could be more specific and replace the 0 with 0x440 which is the PID printed in your posting

I tried these three changes (one at a time) to the keyboard.cpp file. No change in the serial monitor output.
Code:
// trial 1
static const keyboard_force_boot_protocol_t keyboard_forceBootMode[] = {
	{0x04D9, 0},
	{0xd209, 0}
};

// trial 2
static const keyboard_force_boot_protocol_t keyboard_forceBootMode[] = {
	{0x04D9, 0},
	{0xd209, 0x0440}
};

// trial 3
static const keyboard_force_boot_protocol_t keyboard_forceBootMode[] = {
	{0x04D9, 0},
	{0x0440, 0}
};

Any other things I might try?
Thanks!
 
Status
Not open for further replies.
Back
Top