Looking at VUSB which is the bases of all the atmega32a and 328p mcus the above 2 features are missing.
Console is especially vital for debugging.
With the help of @fauxpark we have concluded that we need more than the 2 endpoints V-USB shows in all its examples.
This is because 1 endpoint is used to the keyboard HID and the second endpoint for extrakeys and mouse.
A further endpoint would be needed for Console and another for RAW HID.
Any ideas or experiences how to implement this are welcome.
Good timing! I implemented this feature on plaid and keycapsss/plaid_pad.
https://github.com/hsgw/qmk_firmware/tree/VUSB_HIDRAW
I try to choose mouse/extrakeys or hid_raw for now.
I had done to recognize it as a composite device from OS and send data from the device to the host.
I succeed to send data from the host to the device on plaid_pad. but I fail it on plaid and tartan.
~I think that usb polling rate is not enough to keep correct USB connection, because keyboard_task() and matrix_scan() takes time.~
I looked up a bit more this issue, I found strange behavior.
On plaid, interrupt transfer from host uses EP3 and fail, but, on plaid_pad, control transfer (setup-data stage) uses EP1 and success.
I think both keyboards use same config and host code 馃
(edited)
Finally, I got it working correctly on plaid. I tested with this.
https://hsgw.github.io/webhid_qmk/
When use webhid on chrome, please set chrome flag to enable.
https://bugs.chromium.org/p/chromium/issues/detail?id=890096#c38
But I can't do on plaid_pad. Can anyone test with my code?
https://github.com/hsgw/qmk_firmware/tree/VUSB_HIDRAW~~
See latest comment
Ill give it a look later tonight
:) even tho I think a lot of people would want extrakeys as a minimum
extrakeys support
I will try same method as KEYBOARD_SHARED_EP.
I have added you on discord, Have a few questions:)
I read VUSB codes on QMK again, and I realized the following issues.
And
Therefore, I will try implemented following method.
First, I will make a PR to add hid_raw feature soon.
If you have any suggestion, please advise me!
Small update as well:
Looks like we have managed to get 32byte reports in and out! I will be testing this with VIA and see how it goes.
From a brief look on adding EP4 (and a very helpful email from the authors of V-USB) it looks like it can be done. However it will mean spinning our own version of the library, something that might harm future code maintenance.
Due to the above, I think that @hsgw proposal is a very reasonable compromise.
As boot keyboard was not there anyway, add an option to share EP1 with mouse/extrakeys. This opens up the route to hid_raw. If there is further time and will we can try opening up EP4.
However it will mean spinning our own version of the library, something that might harm future code maintenance.
That's why I'd like to get #8321 in before any of this work is done; we can then fork the V-USB repo to qmk/v-usb and apply our modifications there while still being able to pull down any updates from upstream.
Any idea when that will be done? We can keep testing in the meantime
It's ready to go, just needs more eyes on it. Will also need https://github.com/qmk/qmk_compiler/pull/62 merged & deployed at the same time so as to not break Configurator.
I made test keymap for plaid, plaid_pad and tartan.
~https://github.com/hsgw/qmk_firmware/tree/vusb_raw_hid_test~
https://github.com/hsgw/qmk_firmware/tree/vusb_raw_hid_test_rewrite
RAW_ENABLE = yes#define USB_CFG_IMPLEMENT_FN_WRITE 1
My small script with webhid on chrome.
https://hsgw.github.io/webhid_qmk/
And hidpytoy is useful too.
Please set send and receive data length to 32.
https://github.com/todbot/hidpytoy
This has been done and can be closed
Most helpful comment
Ill give it a look later tonight
:) even tho I think a lot of people would want extrakeys as a minimum