Mouse in OpenWrt

Now let’s connect the input-device: a mouse.

The connecting procedure is the same as of the keyboard connecting. Therefore on the stage of configuration OpenWrt the following modules are to be selected:
Base system:
<*> busybox:
Linux System Utilities:
<*> lsusb
Kernel modules:
USB Support:
<M> kmod-usb-hid

Let’s connect a mouse and check the output dmesg:

root@OpenWrt:/# dmesg
usb 1-1: new low speed USB device using ohci_hcd and address 2
input: USB Optical Mouse as /devices/ssb0:1/usb1/1-1/1-1:1.0/input/input0
generic-usb 0003:15CA:00C3.0001: input: USB HID v1.10 Mouse [USB Optical Mouse] on usb-ssb0:1-1/input0

A new device has to be created in the directory /dev:

root@OpenWrt:/# ls /dev/input/ -l
crw-r--r-- 1 root root 13, 64 Jan 1 00:01 event0

My output lsusb looks like this:

root@OpenWrt:/# lsusb
Bus 001 Device 001: ID 1d6b:0001
Bus 002 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 0a05:7211
Bus 001 Device 003: ID 0951:1603
Bus 001 Device 004: ID 15ca:00c3

The device with ID 15ca:00c3 Textech International Ltd. Mini Optical Mouse is the mouse.

Let’s check the existence of the device’s file in the directory /proc:

root@OpenWrt:/# cat /proc/bus/input/devices
I: Bus=0003 Vendor=15ca Product=00c3 Version=0110
N: Name="USB Optical Mouse"
P: Phys=usb-ssb0:1-1/input0
S: Sysfs=/devices/ssb0:1/usb1/1-1/1-1:1.0/input/input0
U: Uniq=
H: Handlers=event0
B: EV=17
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103
B: MSC=10

Let’s check the response to a mouse movement:

root@OpenWrt:/# cat /dev/input/event0 |hexdump
0000000 00d7 0000 bfa2 0005 0002 0000 0002 0000
0000010 00d7 0000 bfef 0005 0000 0000 0000 0000
0000020 00d7 0000 fe0d 0005 0002 0000 0002 0000
0000030 00d7 0000 fe5d 0005 0000 0000 0000 0000
0000040 00d7 0000 1d41 0006 0002 0000 0002 0000
0000050 00d7 0000 1d90 0006 0000 0000 0000 0000
0000060 00d7 0000 3c7e 0006 0002 0000 0002 0000
0000070 00d7 0000 3ccd 0006 0000 0000 0000 0000
0000080 00d7 0000 5bb9 0006 0002 0000 0002 0000
0000090 00d7 0000 5c08 0006 0000 0000 0000 0000
00000a0 00d7 0000 7af8 0006 0002 0000 0002 0000
00000b0 00d7 0000 7b2f 0006 0002 0001 ffff ffff
00000c0 00d7 0000 7b52 0006 0000 0000 0000 0000
00000d0 00d7 0000 b973 0006 0002 0000 fffe ffff
00000e0 00d7 0000 b9c3 0006 0000 0000 0000 0000

Buy an usb–mouse from us:

usb–mouse