Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add MK321U support #93

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

feat: add MK321U support #93

wants to merge 1 commit into from

Conversation

drlkf
Copy link
Contributor

@drlkf drlkf commented May 19, 2024

I've recently bought a PCsensor 3-key mini-keyboard from Amazon (ASIN: B0BDRPQLW1), which back sticker indicates MK321U. The device appears as follows in lsusb:

Bus 001 Device 013: ID 3553:c010 PCsensor DIY keyboard

and dmesg:

[ 4565.182868] usb 1-10: new full-speed USB device number 14 using xhci_hcd
[ 4565.464589] usb 1-10: New USB device found, idVendor=3553, idProduct=c010, bcdDevice= 1.00
[ 4565.464594] usb 1-10: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 4565.464596] usb 1-10: Product: DIY keyboard
[ 4565.464597] usb 1-10: Manufacturer: PCsensor
[ 4565.514834] input: PCsensor DIY keyboard Keyboard as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-10/1-10:1.0/0003:3553:C010.001B/input/input64
[ 4565.570990] input: PCsensor DIY keyboard Mouse as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-10/1-10:1.0/0003:3553:C010.001B/input/input65
[ 4565.571054] hid-generic 0003:3553:C010.001B: input,hidraw11: USB HID v1.11 Keyboard [PCsensor DIY keyboard] on usb-0000:02:00.0-10/input0
[ 4565.579692] input: PCsensor DIY keyboard as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-10/1-10:1.1/0003:3553:C010.001C/input/input66
[ 4565.579744] hid-generic 0003:3553:C010.001C: input,hidraw12: USB HID v1.10 Device [PCsensor DIY keyboard] on usb-0000:02:00.0-10/input1
[ 4565.607758] input: PCsensor DIY keyboard Keyboard as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-10/1-10:1.2/0003:3553:C010.001D/input/input67
[ 4565.670933] input: PCsensor DIY keyboard as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-10/1-10:1.2/0003:3553:C010.001D/input/input69
[ 4565.671006] hid-multitouch 0003:3553:C010.001D: input,hidraw13: USB HID v1.10 Keyboard [PCsensor DIY keyboard] on usb-0000:02:00.0-10/input2

I've tried adding the VID:PID combination to the appropriate source files, but the output hangs indefinitely on footswitch -r, and succeeds on write operation such as (I uncommented debug output in write_pedals):

> footswitch -1 -k s -2 -k x -3 -k e
start: 01 80 08 00 00 00 00 00
pedal 1 header: 01 81 08 01 00 00 00 00
pedal 1 data: 08 01 00 16 00 00 00 00
pedal 2 header: 01 81 08 02 00 00 00 00
pedal 2 data: 08 01 00 1b 00 00 00 00
pedal 3 header: 01 81 08 03 00 00 00 00
pedal 3 data: 08 01 00 08 00 00 00 00

The values are correctly written, however, it seems to have no effect, as the keys are still producing the default output. I suspect the data structure is different from older models, but I'm not well-versed in HID interfaces to explore to find out what is wrong. Would you have any pointers?

Thanks!

@rgerganov
Copy link
Owner

I suspect the data structure is different from older models, but I'm not well-versed in HID interfaces to explore to find out what is wrong.

You can try to capture the USB traffic when using the PCsensor software with something like this. You can also try to reverse their app with Ghidra. This is basically what I have been using so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants