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

use esp32-s3-usb-otg board as USB/IP hid device #6

Open
HeadHodge opened this issue Apr 14, 2023 · 6 comments
Open

use esp32-s3-usb-otg board as USB/IP hid device #6

HeadHodge opened this issue Apr 14, 2023 · 6 comments

Comments

@HeadHodge
Copy link

HeadHodge commented Apr 14, 2023

hi chegewara,

I see your work everywhere and am impressed with all your work. It has helped me greatly.

There are at least 2 ways to connect a virtual keyboard to a laptop. 1) connect to a physical usb interface using hid class protocol, or 2) connect to laptop using Bluetooth and GATT protocol as hid device. I have both working fine with my board emulating a keyboard device.

I now have USP/IP host servers running on windows10 and linux ubuntu. I believe USB/IP is at least a de facto standard for using remote usb devices over wifi/ip.

Now I would like my board to act as a virtual USB hid keyboard that can be connected by my USP/IP host servers.

How do you recommend I do that all great one?
THANKS! 🤓👍

(Note: to be clear i'm NOT trying to get the USB/IP servers to connect to a physical usb interface on my board)

I

@chegewara
Copy link
Owner

Hi.
Thanks for kind words.

It is probably possible what you want to achieve, if i understand it correctly, but it requires advanced knowledge about USB and HID.
What you would have to do is to intercept all USB requests and instead of sending to physical device connected to USB port you would have to response on each request with correct response. It includes all requests on control endpoint with device, config and some other requests and on interrupt endpoint.

With this library it may be actually easier, because all requests to control endpoint are already separated from other endpoints (which on HID usually is 1 additional endpoint).
It is interesting idea actually, because it lets to emulate not only HID, but also some serial devices (and probably other, like MSC) over USB/IP.

@HeadHodge
Copy link
Author

HeadHodge commented Apr 15, 2023

It is interesting idea actually, because it lets to emulate not only HID, but also some serial devices (and probably other, like MSC) over USB/IP.

Thanks for reply chegewara...

Yes!, You understand exactly what I want to do.

I think maybe a good approach is to monitor the data you pass back and forth, then next step would try to mimic sending same data to USB/IP server.

@pwqw
Copy link

pwqw commented Apr 15, 2023

I understand the offtopic of this message, but:

Both @HeadHodge and @chegewara, could you write a more entertaining readme?

  1. Compilation and installation steps.
  2. Scheme of use or example photo.
  3. Description of the basic commands.
  4. Whatever operating system or platform you currently use.

or you could throw me the basic steps and then I polish the readme.

@chegewara
Copy link
Owner

I assume USB/IP is more advanced topic, not for beginners, so it requires at least basic knowledge about esp-idf and using esp32-S2/3 with USB. As i am no longer using windows (at least not for development) there is basic info as a reminder how to use usbip on linux.
Here you can find few links, but uncle google can help you more:
https://usbip.sourceforge.net/
https://docs.kernel.org/usb/usbip_protocol.html
https://github.com/torvalds/linux/tree/master/drivers/usb/usbip

@HeadHodge
Copy link
Author

🤓👍

Sounds challenging, but I think I'll see how far I can get before reaching “seppuku” 😲

@pwqw pwqw mentioned this issue Apr 19, 2023
@Daedilus
Copy link

USB/IP is easy, installing this into an ESP32 using Arduino IDE, difficult.

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

No branches or pull requests

4 participants