chegewara / esp32-usbip-poc

ESP32 S2/S3 USBIP proof of concept app
74 stars 8 forks source link

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

Open HeadHodge opened 1 year ago

HeadHodge commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

🤓👍

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

Daedilus commented 8 months ago

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