ESP32 as USB keyboard: how to determine which devices can do it?

jumpjack
Posts: 7
Joined: Sat Mar 24, 2018 4:35 pm

ESP32 as USB keyboard: how to determine which devices can do it?

Postby jumpjack » Wed Apr 16, 2025 8:21 am

If I understand correctly, not all variants of ESP32 can be programmed to emulate an USB keyboard; but, how to determine if one variant can do it, by reading its specifications?

About the library https://github.com/chegewara/esp32-usb-v2 : does it need ONE or TWO usb cables to work? One for power and programming, and one for emualting keyboard?!?

Please not: I am not interested on bluetooth keyboards, and I need a solder-free solution, a plug-and-play solution, for basic users, just like I currently do with Arduino Pro Micro.

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 as USB keyboard: how to determine which devices can do it?

Postby chegewara » Wed Apr 16, 2025 8:11 pm

Only esp32-S2/S3 and P4 have USB phy.
You have 2 options to wire devkits:
- use USB cable with 4 wires to connect D+/D- and GND + Vcc; all 4 wires can be connected to devkit for flashing and operating as USB device with proper code (in this case you wont be able to see logs)
- use USB cable to connect devkit to PC with USB to UART on that devkit (flashing and logs); in addition you can connect another USB cable as mentioned above with optional GND and Vcc (on D+/D- are required)

I am suggesting to play with API bot on this forum (on top site, right corner icon) and try few questions:
- how to connect native usb on S2
- native usb keyboard wire
and more topics with native USB

Also google can show you pictures how to wire USB on esp32.

Who is online

Users browsing this forum: PerplexityBot and 4 guests