USB communication over any wireless protocol

Hey there! are there any ways to do anything to spoof that usb cable but still recieve and send data from usb? like how wireless keyboards work... one dongle and on other side; send the data. my mcu can be ESP32, STM32, RP2040

I think an ESP32 kan show up as a bluetooth device.

The thing is; i have an raspberry pi and a microcontroller, i want to transmit the data from the microcontroller to raspberry pi BUT without a cable. so maybe usbip or dongles etc

No "wireless usb", but there are plenty of other ways to transfer data wirelessly. Look for wireless UART serial dongles.

How does wireless mice, keebs work then?

trying to transfer from stm/rp/esp to raspberry pi

The mouse (or keyboard) itself does not use USB; it's the dongle that has USB. Communication between the device and dongle is done using (if not mistaken) Bluetooth.

1 Like

There are a lot ways to do it. Consider an UART radio modules as HC-12 or JDy-40

Most don't use BT, but "some" chinese protocol without license fee. Sometimes these are surprisingly well BT-compatible, sometimes not at all.

2 Likes

but its still detected as an device in lsusb, i have a d+ and d- if i use stm32 (thats my first priority) i want to transfer data between d+ and d- maybe something like usbip or flexihub?

Because im trying to use it with a software that needs usb communication, the stm is flashed with firmware and gives a serial output when connected to usb and sends data from there

The data are transmitted by proprietary radio protocol.

The mouse may say to the dongle "Hey, I'm a mouse"and next the dongle says to the PC, "Hey, here is a mouse".

USB uses a differential signal. D+ is the pos. side of the signal, D- is the neg. side of that signal. See e.g. Differential signalling - Wikipedia.

1 Like

Just to be clear: with 'it', you mean the STM32?

So in the original situation you have:
PC -- USB cable -- STM32
And you're trying to go to:
PC ---USB cable --- [some wireless transceiver] --- thin air ---- [another wireless transceiver] --- USB cable --- STM32
Is that right?

Also, I understand the STM32's USB interface is used as a UART bridge. What kind of data does it send to the PC? Is this unidirectional or bidirectional communication?
Do you have any influence on the firmware that runs on the STM32; i.e. can you modify it?

You are definitely right, and i know that i should explain the "software" better but that's what i can right now, sorry.

So, i did some research and found out that the "software" i'm using connects to the mcu with the serial located in /dev/serial/by-id or /dev/ttyUSB0 etc.. so here's the thing;
i'm guessing that i can do a wireless uart maybe using an ESP (radio would be better since less delay). so i connect RX/TX to the transmitter and on the raspberry side i connect to transmitter via socat (if the transmitter i use is ESP). wondering if this could work "directly" transferring the UART data.

Consider this: JDY-40

It would make things a whole lot simpler if you can just make the UART bit wireless so you don't have to worry about trying to somehow redirect USB over a wireless channel. Frankly, I'm not sure if that would even be feasible in the first place.

jdy-40 sounds really cool, though why do you think wireless uart is not feasible? i have an upper limit of 25ms delay, and i dont even have a long distance between receiver and senders, maximum of 30cm

I think you should invest some time doing research, and reading on how things work.

Wireless UART is, but USB seems far too tricky to 'convert' to wireless in a transparent way. Even sluggish USB1.1 speeds would require pretty darn fast wireless connection to make space for the inevitable error checking and redundancy for resending packets that failed. Really, I think it's not a sensible route to take.