3

My problem is I have an embedded system normally headless.

It has a serial console I use for debugging, but will not be present in production.

It has no vga/graphics/monitor/whatever.

It doesn't have a proper keyboard or mouse.

So far, so good.

Now I need to connect a barcode scanner that works in "keyboard emulation" (i.e.: presents itself as an USB keyboard and acts accordingly).

I enabled several device drivers as modules:

  • usbhid
  • evdev
  • hid_generic
  • hid
  • input_core

Scanner somehow works, meaning it gets initialized and generates Key events I can get reading /dev/input/event0 (and they look OK).

What I'm missing is the complete decoding so that I can open a device and read characters (not scancodes). I expected the hid-generic module to pick up input_events and generate characters to console.

What am I missing?

2
  • Normally the keyboard module handles translation from scancodes for VTs (though I am not sure how it decides which input-layer event sources to process), and there's a special X driver that does the same for input-layer event sources. I am not sure if you can use keyboard without a VT, possibly you can create a dummy framebuffer.
    – dirkt
    Commented Dec 14, 2020 at 22:28
  • @dirkt: I have CONFIG_INPUT_KEYBOARD set, but no specific kbd selected as they do not seem to pertain to USB keyboards. I also have CONFIG_USB_HID (loaded as a module), CONFIG_TTY and CONFIG_VT (compiled in), but keys from USB kbd show up only as events and don't get decoded. Any hint welcome.
    – ZioByte
    Commented Dec 15, 2020 at 11:48

1 Answer 1

2

It turns out I have all I need.

Problem is keystrokes will not be sent to /dev/console (connected to serial line); they are however correctly decoded and available reading /dev/tt0 (current virtual terminal).

I have no idea (and neither interest, truly) if and how to redirect them to /dev/console so they get merged together as it happens on a desktop PC.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .