[Solved] USB Keyboard is not working On Desktop running OpenWrt 18.06

I am upgrading my old pc that runs on 17 LEDE(using it for few months now) to openwrt 18.06. I have successfully installed Openwrt 18.06 on my desktop pc.with (no ps2 kb, ps2 mouse) only USB keyboard and mouse interface desktop. I have also successfully installed the Kmod-usb-hid to enable usb keyboard and mouse, still my keyboard attached to desktop does not work.
When I attached USB flash drive and USB CD drive it all works except for USB Keyboard?
Any Suggestion?

@habagat Greetings. Has your USB Keyboard been recognized by the Kernel?

I assume the keyboard has power > the LEDs blink > so the USB port is live.

Take a look in /sys/bus/usb/devices/ for the simlinks to the usb devices. There should be one for the keyboard.

You should also have all USB devices listed in /sys/kernel/debug/usb/devices

Thanks Geekuino for you promt response! Here's what i've done on my newly install Openwrt 18.06 on my other old desktop.

  1. During grub option keyboard(A4tech KRS-83) is alive because you can select between openwrt or failsafe and the light Led is on (num lock)
    on my keyboard

GNU GRub
OpenWrt
Openwrt(failsafe)

But once i have choosen "Openwrt" on Grub (using my keyboard arrow keys) The light LED(Num lock) turns off during the boot process. You wont be able to use keyboard on terminal access. The only way to access openwrt thru putty ssh.

  1. tried to cd /sys/bus/usb/devices/ and executed ls -la Openwr 18.06.1 and the symlinks were shown.

lrwxrwxrwx 1 root root 0 Oct 8 08:54 1-0:1.0 -> ../../../devices/pci0000:00/0000:00:1a.7/usb1/1-0:1.0
lrwxrwxrwx 1 root root 0 Oct 8 08:54 2-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.7/usb2/2-0:1.0
lrwxrwxrwx 1 root root 0 Oct 8 08:54 usb1 -> ../../../devices/pci0000:00/0000:00:1a.7/usb1
lrwxrwxrwx 1 root root 0 Oct 8 08:54 usb2 -> ../../../devices/pci0000:00/0000:00:1d.7/usb2

in comparison with my existing running LEDE 17.01.4 with working keyboard attached, the output below.

lrwxrwxrwx 1 root root 0 Oct 5 10:29 1-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.7/usb1/1-0:1.0
lrwxrwxrwx 1 root root 0 Oct 5 10:29 2-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2/2-0:1.0
lrwxrwxrwx 1 root root 0 Oct 5 10:29 3-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.1/usb3/3-0:1.0
lrwxrwxrwx 1 root root 0 Oct 5 10:29 4-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.2/usb4/4-0:1.0
lrwxrwxrwx 1 root root 0 Oct 5 10:29 5-0:1.0 -> ../../../devices/pci0000:00/0000:00:1d.3/usb5/5-0:1.0
lrwxrwxrwx 1 root root 0 Oct 5 10:29 usb1 -> ../../../devices/pci0000:00/0000:00:1d.7/usb1
lrwxrwxrwx 1 root root 0 Oct 5 10:29 usb2 -> ../../../devices/pci0000:00/0000:00:1d.0/usb2
lrwxrwxrwx 1 root root 0 Oct 5 10:29 usb3 -> ../../../devices/pci0000:00/0000:00:1d.1/usb3
lrwxrwxrwx 1 root root 0 Oct 5 10:29 usb4 -> ../../../devices/pci0000:00/0000:00:1d.2/usb4
lrwxrwxrwx 1 root root 0 Oct 5 10:29 usb5 -> ../../../devices/pci0000:00/0000:00:1d.3/usb5

  1. all USB devices listed in /sys/kernel/debug/usb/devices using tial -f command

(OpenWrt 18.06.1)
T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 6
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0002 Rev= 4.14
S: Manufacturer=Linux 4.14.63 ehci_hcd
S: Product=EHCI Host Controller
S: SerialNumber=0000:00:1d.7
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=256ms

(LEDE 17.01.04)
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=480 MxCh= 8
B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 2.00 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0002 Rev= 4.04
S: Manufacturer=Linux 4.4.92 ehci_hcd
S: Product=EHCI Host Controller
S: SerialNumber=0000:00:1d.7
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 4 Ivl=256ms

@habagat - other than stating the obvious, which is USB bus devices 3,4 and 5 are missing in 18.06, I've really nothing much to add.

Do have both the EHCI and OHCI usb drivers installed, as this may impact the assignment of PCI to USB bus numbers? You have 1a and 1b which suggests both drivers - or maybe niether? If your build has the lspci command, you should be able to which pci devices are on which usb bus.

Also, with usbutils installed, you can issue the lsusb command which, returns the ..debug/usb/devices info in pretty format.

Is there anything in the logs after connecting the keyboard?

@GeeKuino
I installed all the packages that contain EHCI and OHCI usb drivers. usbutils was installed also.
i reboot the desktop here are the result of the commands.

root@OpenWrt:~# lspci
-ash: lspci: not found

root@OpenWrt:~# lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

@vgaetera
There's no log when i checked the /var/log directory, lastlog and wtmp.

@habagat The lsusb shows you have two hubs in buses 1 and 2, but nothing else attached. Try attaching a pen drive to see if that is identified. I think what @vgaetera meant is, are there any entries for a keyboard in dmesg ?

For now, all that I can think of is to force rebind the hubs. This is not a fix but it would prove that OpenWRT is seeing your keyboard.

echo -n "1-0:1.0" > /sys/bus/usb/drivers/hub/unbind
echo -n "1-0:1.0" > /sys/bus/usb/drivers/hub/bind
echo -n "2-0:1.0" > /sys/bus/usb/drivers/hub/unbind
echo -n "2-0:1.0" > /sys/bus/usb/drivers/hub/bind
logread

I Installed the following packages to enable the keyboard on desktop powered by Openwrt 18.06.
kmod-usb-core
kmod-usb-hid
kmod-usb-uhci

reboot the system.