Wireless USB extension trough ESP32

I need to upload code from my desktop to esp I have mounted in my garage.
I don't want to remove it and I don't have laptop so I came up with idea to cut USB extencion cable in half conect each side to ESP32 and via cloud send the USB data. Like in the picture.

I tried setting up a codes for both ESPs

For the female side: (Only what i wrote, the conection to cloud is not here)

void setup() {
  pinMode(d_g, INPUT);
  pinMode(d_w, OUTPUT);
}

void loop() {
  d_green = digitalRead(d_g); 
  digitalWrite(d_w, d_white);
}

And for the male side:

void setup() {
  pinMode(d_g, OUTPUT);
  pinMode(d_w, INPUT);
}

void loop() {
  digitalWrite(d_g, d_green); 
  d_white = digitalRead(d_w);
}

When i plug usb thumb drive into the port the PC registrated it but that is it. Sometimes it just show an error mesage saying that the thing i conected canot be used.

I'm stuck here. I wasn't able to find anything helpfull online so Im asking here for some advice.

USB works at 5 Volts and you will need analog reads as it is using differential voltages to communicate. ESP32-USB-Soft-Host/examples/ESP32-S3-USB_Test/ESP32-S3-USB_Test.ino at main · tobozo/ESP32-USB-Soft-Host · GitHub can be a good starting point. The USB communication timings are critical. I would love to do the same as what you are trying but with printers and Im sure there are others who are interested.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.