Reading USB input stream on linux

I am currently working on an embedded Linux machine. I am trying to read the input stream of USB devices, but for some reason I do not have such a thing in my / dev directory. I would suggest that it will be something like / dev / ttyUSB 01 or / dev / input / usb or something like that, but it is not. dmesg returns the following

[ 195.863911] input: GIT GIT USB READER as /class/input/input2 [ 195.864259] generic-usb 0003:1234:5678.0001: input: USB HID v1.00 Keyboard [GIT GIT USB READER] on usb-0000:00:0f.4-1/input0 

I looked through / sys / class / input / input 2 and I'm not quite sure what I'm looking for. Maybe someone can point me in the right direction?

+6
linux inputstream device usb
source share
3 answers

Check /dev/input/by-path and find usb-0000:00:0f.4-1 . In my Ubuntu field there is a symbolic link to the device.

0
source share

There was the same problem a few days ago, and we found this workaround.

You can do the following command on the terminal:

 cat /proc/bus/input/devices 

Your devices will be listed in this list, and your devices should be listed. For example, for me, one element appears:

 I: Bus=0011 Vendor=0002 Product=000a Version=0000 N: Name="TPPS/2 IBM TrackPoint" P: Phys=synaptics-pt/serio0/input0 S: Sysfs=/devices/platform/i8042/serio4/serio5/input/input15 U: Uniq= H: Handlers=mouse1 event15 B: PROP=0 B: EV=7 B: KEY=70000 0 0 0 0 B: REL=3 

In the "Handlers" section, you will notice that event15 appears. You can access the data stream by specifying / dev / input / event 15 in my case. You will need to find out what is in your case.

+6
source share

Have you tried using mdev? This is a lightweight alternative to udev, and it populates / dev. If hotplugging is not enabled, you may need to start it manually.

To scan / sys and create devices, try:

 mdev -s 
+2
source share

All Articles