-
Notifications
You must be signed in to change notification settings - Fork 21
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
usb hid device barcode scanner can not use (IEC-98) #26
Comments
Hello @yel-best Could you please specify and elaborate what do you mean by a following quote:
Also, could you please specify all the changes, if any, you have made to the HID example code? |
Oh, I didn't modify the logic code, I just added some esp_log, and I printed out every function execution point that the program ran. Then I found that the content of my QR code was
The loop jump does not output the result character I don’t know the reason, but the result I understand from the code scanner is actually characters such as abcdefg in the keyboard. Do I need to modify anything? I think the driver and character set in hid_usage_keyboard can be applied to the code scanner. |
Hi @yel-best , To determine, where is the problem, is it possible to add the debug output for the raw report and share the log output? The regular barcode scanner works a keyboard, so during the scanning it emulates the keyboard key pressing. Then, example parses the data from scanner based on the default keyscan table, which is provided in the example hid_host_example.c#L90. To add the debug output, please add
Thanks. |
yes, you are right. The code scanner is actually simulating the keyboard for data output. I cannot recognize the USB HID device after running the example. I suspect that the code scanner I use is not standard enough. I will try to replace it with another one first. Scan code gun, and then add this code, I will update the log, please wait until I find a new code scanner, I will update again thank you for your help |
Hi @yel-best,
|
oh, thank you very much for sharing, you are so kind, this will bring me a solution, thank you very much 😄 |
Hey @yel-best,
Based on the debug output from hid example you had provided, it is a USB device that has one Keyboard interface. So the example found the "keyboard" and handle the key scan code. So, it should work. If there anything new, please feel free to report. |
Hi @yel-best, |
Thank you for your concern. After trying it, I suspected that the protocol of the scanner hardware may not be standard. I suspected that it was a hardware compatibility issue. Then we replaced two scanner devices for USB connection. It worked without any code changes. Correctly obtain the corresponding barcode or QR code value, so this is how I currently solve my problem. thanks 😄 |
@yel-best I will close the issue then. If there will be anything else, feel free to re-open that issue or create a new one. |
Answers checklist.
General issue report
After reading the barcode gun, 57 hungry key_code appears directly, and it enters a dead loop
I'm using this example
https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/hid
Please tell me some ways or reasons,thanks
Through another project, usb_host_lib, the parameters of the scanning gun I am currently using are read as follows:
The text was updated successfully, but these errors were encountered: