-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
RawHID Expected to work? #133
Comments
RawHID support was always unstable. Also there were bugs introduced with the newer IDE versions which should be corrected now. But I've never retested it and its been quite a long time since I wrote the code. You can simply just try it yourself and find the bugs. I sadly have no time to do so. Multireport does not work with hidapi. It just confuses the API. But I am not using multireports, so nothing to do here. RawHID receives data on a dedicated endpoint and sends data on endpoint0. You could send it on its own endpoint, but this library is not implemented like that. |
Thanks. That's useful information. It's good to know that I haven't (maybe) done anything to break it. I've got a little more time and will attempt to contribute if I get it working. FWIW, Wireshark claims that the packets which RawHID receives were sent to endpoint 0, while the ones coming back are being sent to endpoint 4. |
Your wireshark observation is correct and expected. Good luck, please report back if you have any knowledge to share. Also checkout the wiki page, if there is more useful information for you. |
Nico, Martin, did you have any success with Raw HID? I just tried it with the basic rawhid_test.c with Arduino MKR Zero and had the same issue: Arduino can receive packets from PC but when Arduino sends packets the PC does not receive anything. I would love to help but I'm an amateur so I'm not sure if I can debug and fix it. |
I seem to have a similar situation. It appears that if I do a RawHID.write(buf,len) with len less than 64 nothing gets sent, no LED flash nothing. If however I use 64 or larger it does send, but looks like only the first 64 bytes. Looking at the code it appears to just be calling USB_Send so assuming this is a lower level USBCore issue. IDE 1.8.10 with Arduino library 1.8.1 the default in the 1.8.10 package. |
For anyone else running into this problem. Check the following
https://learn.sparkfun.com/tutorials/hid-control-of-a-web-page/all Set/Verify the
Update See cbattlegears comment here for an improved workaround. Instead of hardcoding a buffer of 64 bits, you can do the following workaround old workaround
new workaround
|
Signed-off-by: Norbert Takacs <[email protected]>
It seems to work reasonaby well based on my testing using the example here. There is a bug for the Feature report but the fix is simple. |
I've been trying to get raw HID. It's partially working but not quite. I'm wondering if it's expecting to work and if not, what I need to do to make it work? I've been looking through the source and there are quite a comments that suggest that it might not be complete. I don't understand many of them.
I have a genuine Arduino Uno with a 16u2. I've put Hoodloader2 on it and it works exactly as expected - I can upload programs to it and communicate with the other AVR on the same board.
I'm now trying to use RawHID to set up a bidirectional link between my Uno and the PC using my own vendor id and product id. I'm using hidapi on Windows 10 (from the main repo) on the PC.
When I enumerate devices on the PC, I see the 16u2 and I can connect to it. I can send bytes with hid_write() on the PC and receive them using RawHID.read() on the 16u2. This is great. (hidapi sends on the first OUT endpoint or the control endpoint is there isn't an OUT one. I'm not sure which it happening this case.)
However when I try to send from the 16u2 using RawHID.write() it is not received by the PC. Using Wireshark I can see that each character is arriving as the single payload byte in a URB_INTERRUPT packet but hid_read() does not return them.
Is this expected to work? Is there something else I need to do?
Also:
RawHID doesn't work in a multi-report interface. Because of the serial port that the 16u2 is implemented is this a multi-report system. Do I need to turn off the serial port somehow?
Can I induce RawHID to send on endpoint 0, the control endpoint?
Thanks,
Martin.
The text was updated successfully, but these errors were encountered: