How to make my Rock Pi 4B+ as a USB device?

I am working on a project where my rock pi needs to communicate with my computer via USB. Now it’s no simple communication because my rock pi is acting as a Head-Mounted Display (HMD) computer so it needs a specialized USB protocol to make SteamVR recognize it as an HMD device, now I just need a way to make my rock pi make the USB OTG port can communicate with my computer as an HMD and well make my Rust program that handles the operation able to interact with it like getting the frame buffer to show on the display, send back sensor data, etc.

Note that I just explaining the complex things for your understanding of what I am trying to achieve, what I am asking here is how to make my rock pi OTG USB port recognized as a USB device to my computer.

Couldn’t you just use the ethernet?

I tried using WiFi but due to well latency, it will affect communication between my computer and the rock pi, especially with the frame buffer which needs to be fast since who likes playing with a low frame rate display? and well it is just not convenient to have a thick Ethernet cable connected to the headset making it heavy

That is why I said Ethernet.

An Ethernet cable needn’t be (much) bulkier that a USB cable …

I currently only have heavy-duty Ethernet cables and I don’t want to only be able to use my headset when I am near my router because I need to connect the Ethernet cable. Connecting the rock pi GbE to my computer LAN could work somehow I guess but then I lose connection to the internet on my computer

You’re going to need to be near your computer anyhow to plug in a USB lead - the max length of a USB lead is a lot less than an Ethernet lead!

You could do a direct Ethernet connection - without LAN or router …

So after staring at this page and realized I’ve been missing a single sentence literally at the top of the page content area that solve my problem. Linux USB gadget driver. Now I feel so dumb but yea that’s the solution.

1 Like

So this: https://www.kernel.org/doc/html/v5.0/driver-api/usb/gadget.html ?