Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading USB input stream on linux

I'm working on an embedded linux machine and trying to read a USB devices input stream, but for some reason I don't have any such thing in my /dev directory. I would assume it would be something like /dev/ttyUSB01 or /dev/input/usb or something similar, but it's not there. 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've scanned through /sys/class/input/input2 and I am not really sure what I'm looking for. Maybe someone could point me in the right direction?

like image 348
Dalton Conley Avatar asked Sep 17 '10 17:09

Dalton Conley


People also ask

How do I open a USB port in Ubuntu?

rules file. If you want to allow global access to all usb devices, make this change: Change this: SUBSYSTEM=="usb_device", MODE="0664" To this: SUBSYSTEM=="usb_device", MODE="0664", GROUP="usb" After you reboot, all usb devices will inherit the mode and group specified.

How do I find USB devices on Ubuntu?

Ubuntu list USB devices – Lsusb. What is this? The number one way an Ubuntu user can view all connected USB devices is with the lsusb command. This command literally means “list USB,” and it does exactly that — it lists all of your USB devices, their IDs, names, etc.


1 Answers

Had the same problem a few days ago and we discovered this workaround.

You could do the following command at the terminal:

cat /proc/bus/input/devices

This will list your devices connected, and your devices should be on the list. For instance, one item on there appears this way for me:

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

Under Handlers, you'll notice that event15 shows up. You can access the data stream by referencing /dev/input/event15 in my case. You'll have to figure out what it is in your case

like image 104
Lee Torres Avatar answered Sep 21 '22 05:09

Lee Torres