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.

What kind of microcontroller?

1 Like

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

Those both have wifi capability. Juat use that. Why does it have to be a USB protocol?

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

Do you think it might help to spell out what you really want to do? This may not be an actual limitation. Perhaps the data can be delivered by a different method.

This is a classic example of an X-Y problem and you will do a lot better for yourself if you just come on out with it.

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.