I want to make a project with ESP32 in which I am using an ESP32 with a USB Keyboard. I require the ESP32 to read the input keystrokes from the keyboard which would be connected to it.
So does a USB Keyboard start to stream its data immediately when powered on, or does it verify that if a computer is listening to it?
If it doesn't check if there is a computer, then I can simply use some logic to identify the data from the stream. But if it does tries to check if there is a computer, then is there a way to fool the Keyboard into thinking that ESP32 is a computer? Or do I need a USB host controller?
I just want to get the live keystrokes data of the Keyboard on the ESP32 for some reason.
USB uses a quite complex protocol. Without proper device discovery and setup there is no data flow. I think you need a USB host controller (or an ESP32 variant with USB OTG or USB host functionallity).
BTW: Ben Eater put some videos about USB on youtube.
Actually Ben Eater tells that a Keyboard needs a computer connected to it in order to output the keystrokes. I am asking about how to fool the keyboard into thinking that the ESP32 is a computer.
See. I have tested it now. It starts outputting keystrokes when it is powered on, even when the data pins are not connected anywhere. (I connected them to LEDs to confirm the data communication).
So now I want to know that if there is a library or code to decode these keyboard data pulses, or do I need to make my own makeshift code to decode it?
Great Personality Ben Eater explained these data pulses very well in his video.
Ok. I will analyse the data protocol. (BTW Ben Eater has already used oscilloscope to identify the data protocol) But I just want to know if there is a library.
If not then I can make my own code based on the data protocol. (Library will just make it easy)......
Tell me if anybody knows some library to decode USB data.