Just to make sure, you say that you’re experiencing the same behavior as the user on this case https://communities.intel.com/thread/101913, so by that you mean that the USB keyboard works only when choosing boot option, right?
Also, you’re getting those errors when booting with the USB keyboard already connected, but what happens when you connect the USB keyboard after the Galileo has finished booting?
You might also want to take a look at this thread: http://cateee.net/lkddb/web-lkddb/USB_KBD.html.
Yes, my keyboard works fine until the boot process finishes.(this happpened even before I made those modifications on menuconfig)
If I connect the keyboard after the boot process, I get an output saying that the HID device was found. But when a type nothing happens on the terminal.
I believe your configuration in the menuconfig is correct because your device is being recognized as an HID. However, it seems like it’s necessary to tell Linux how to handle these keyboard inputs by using the event triggered by the keyboard connection.
Could you please let me know what files you have under /dev/input?
I'm not so sure about my menuconfig, because before I changed those files my keyboard was already recognized as an HID device.
My /dev/input before connecting the keyboard
After plugging in the keyboard:
root@quark:~# [ 295.150233] usb 2-1: new low-speed USB device number 2 using ohci-pci
[ 295.427954] input: USB USB Keyboard as /devices/pci0000:00/0000:00:14.4/usb2/2-1/2-1:1.0/0003:1A2C:0C21.0001/input/input2
[ 295.441914] hid-generic 0003:1A2C:0C21.0001: input: USB HID v1.10 Keyboard [USB USB Keyboard] on usb-0000:00:14.4-1/input0
[ 295.526981] input: USB USB Keyboard as /devices/pci0000:00/0000:00:14.4/usb2/2-1/2-1:1.1/0003:1A2C:0C21.0002/input/input3
[ 295.541135] hid-generic 0003:1A2C:0C21.0002: input: USB HID v1.10 Mouse [USB USB Keyboard] on usb-0000:00:14.4-1/input1
by-id by-path event0 event1 event2 event3
I'm really intrigued by this. :/
Did you run those commands with your modified image (with the HID changes in menuconfig) or with the standard image?
Regarding your configuration, it is strange that your Galileo is still detecting the keyboard as an HID device even without making the changes in the kernel. My guess is that even if recognized it won’t work until you change the menuconfig values.
Now, I don’t know if you have been searching about what I told you in my last reply (that you need to tell Linux how to handle the inputs from your keyboard), I kept doing some research and found this link which explains briefly that information,
They use the keyboard “events” and pass this information to a code that then handles the input. You can check their code snippet.
I run those commands with my modified image and the original provided by Intel, the results are the same.
I tried editing my menuconfig similar to the suggested on website, but our menuconfig don't provide the following option Device Drivers --> HID Devices –> USB Human Interface Device (full HID) support. So I really don't know which files I have to modify on menuconfig in order to make my USB keyboard working.
Could you get a USB keyboard working on Intel Galileo Gen 2 ?
Thanks and sorry for the late reply.
I haven’t tried yet, but I could run some tests. I’m not sure if I have access to a USB keyboard that’s not being used but I will look for one. I’ll let you know if I have updates.
Using the latest MicroSD* card image found on the Downloads website https://software.intel.com/en-us/iot/hardware/galileo/downloads, together with SKeylogger, we were able to get data from the keyboard. The keyboards we used were a Logitech K120 and a Kensington, both of them seem to work with the Galileo board. You could attempt to use SKeylogger in your custom image build and see if that works, just make sure your board has access to the internet to be able to clone the repository.
Also make sure the keyboard is connected to the Galileo.
Here are the steps we followed using the latest image:
1. Make sure the Galileo is booting up from the SDCard, to do so the latest image version should be the following:
root@galileo:~# cat /etc/version
2. Check your network connection, the easiest way would be to connect an Ethernet cable to the Galileo board. Also you can connect the board via WiFi following this guide https://software.intel.com/en-us/node/519955
We checked the Galileo connection using ping:
root@galileo:~# ping google.com
PING google.com (220.127.116.11): 56 data bytes
64 bytes from 18.104.22.168: seq=0 ttl=52 time=7.381 ms
64 bytes from 22.214.171.124: seq=1 ttl=52 time=7.027 ms
64 bytes from 126.96.36.199: seq=2 ttl=52 time=7.173 ms
64 bytes from 188.8.131.52: seq=3 ttl=52 time=7.070 ms
--- google.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 7.027/7.162/7.381 ms
3. Now that you have internet access, proceed to clone the SKeylogger repository (steps and information can be found here https://github.com/gsingh93/simple-key-logger)
root@galileo:~# git clone https://github.com/gsingh93/simple-key-logger.git
Cloning into 'simple-key-logger'...
remote: Counting objects: 48, done.
remote: Total 48 (delta 0), reused 0 (delta 0), pack-reused 48
Unpacking objects: 100% (48/48), done.
Checking connectivity... done.
4. Change directories to the cloned repository and run the "make" command:
root@galileo:~# cd simple-key-logger/
gcc -g -Wall -c -o skeylogger.o skeylogger.c
gcc -g -Wall -c -o key_util.o key_util.c
In file included from key_util.c:3:0:
key_util.c: In function 'getKeyText':
util.h:6:46: warning: typedef '__C_ASSERT__' locally defined but not used [-Wunused-local-typedefs]
#define ASSERT_ON_COMPILE(expn) typedef char __C_ASSERT__[(expn) ? 1 : -1]
key_util.c:86:4: note: in expansion of macro 'ASSERT_ON_COMPILE'
ASSERT_ON_COMPILE(ARRAY_SIZE(key_names) == ARRAY_SIZE(shift_key_names));
https://github.com/gsingh93/simple-key-logger.gitgcc -g -Wall -c -o options.o options.c
gcc -g -Wall -c -o config.o config.c
gcc -g -Wall skeylogger.o key_util.o options.o config.o -o skeylogger
5. Simply just run the skeylogger binary. Make sure the keyboard is connected to the Galileo board, otherwise the terminal may throw some error messages.
6. You can print the keystrokes found on the log file in the following directory:
root@galileo:~/simple-key-logger# cat /var/log/skeylogger.log
<RShift>This is a test entering characters from a keyboard to the <RShift>Galileo board.<Enter><ESC><LCtrl><LAlt><LShift>
Let us know if this helps,
Sorry for taking so long to reply.
Thanks for the detailed tutorial, I was able to read the entries from my keyboard, but that wasn't quite what I was aiming for. What I had in mind was to connect any USB keyboard and be able to send commands to the terminal, as a regular keyboard. That's why I thought in kernel editing, because it seems like the USB host is not configured to accept "external" input devices.
Nevertheless thank you for suggestion, I really appreciate your effort.
You’re more than welcome and I’m sorry this is not what you were hoping for. But maybe you can use our work or at least part of it to try to get the behavior you expect. Hopefully, you’ll find a better way to implement it.