redirecting the output of a USB barcode scanner (= USB keyboard)
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
redirecting the output of a USB barcode scanner (= USB keyboard)
Hi
I have a USB barcode scanner that acts like a keyboard: whenever a
barcode is read it sends the code where the keyboard would normally write.
I would like to redirect the output to /dev/rtfX (RTAI FIFO).
What I do know is to read from the USB barcode scanner using libhid and
write to the FIFO using dedicated API. However, it's a bit complicated,
and I have the feeling that the result could be obtained with very few
lines of code.
MardukKurios suggested this:
They normally configure as a keyboard, though in Linux, by default, some
of the COM ports may not be accessible. Add "8250.nr_uarts=8" to the end
of your kernel line to have it configure past COM4. I.E.:
kernel /boot/vmlinuz-2.6.15-1.2054_FC5 ro root=LABEL=/ 8250.nr_uarts=8
If you cat /dev/ttySX (X is the number of the COM port you want to listen
to) and scan something, you should see input.
This seems like a good idea, but unfortunately 8250.nr_uarts is not an
option recognized by my kernel. However, this suggests that what I want to
do should be possible.
Does anybody have an idea?
Thanks,
Brice
PS: dmesg shows this
usb 2-1: new full speed USB device using uhci_hcd and address 3 input: �
Symbol Technologies, Inc, 2000 Symbol Bar Code Scanner as
/class/input/input3 input: USB HID v1.10 Keyboard [� Symbol
Technologies, Inc, 2000 Symbol Bar Code Scanner ] on usb-0000:00:1d.0-1
I have a USB barcode scanner that acts like a keyboard: whenever a
barcode is read it sends the code where the keyboard would normally write.
I would like to redirect the output to /dev/rtfX (RTAI FIFO).
What I do know is to read from the USB barcode scanner using libhid and
write to the FIFO using dedicated API. However, it's a bit complicated,
and I have the feeling that the result could be obtained with very few
lines of code.
MardukKurios suggested this:
They normally configure as a keyboard, though in Linux, by default, some
of the COM ports may not be accessible. Add "8250.nr_uarts=8" to the end
of your kernel line to have it configure past COM4. I.E.:
kernel /boot/vmlinuz-2.6.15-1.2054_FC5 ro root=LABEL=/ 8250.nr_uarts=8
If you cat /dev/ttySX (X is the number of the COM port you want to listen
to) and scan something, you should see input.
This seems like a good idea, but unfortunately 8250.nr_uarts is not an
option recognized by my kernel. However, this suggests that what I want to
do should be possible.
Does anybody have an idea?
Thanks,
Brice
PS: dmesg shows this
usb 2-1: new full speed USB device using uhci_hcd and address 3 input: �
Symbol Technologies, Inc, 2000 Symbol Bar Code Scanner as
/class/input/input3 input: USB HID v1.10 Keyboard [� Symbol
Technologies, Inc, 2000 Symbol Bar Code Scanner ] on usb-0000:00:1d.0-1
Hi...
I also want to read from barcode reader. I tried to read from it is device descriptor at /dev/input/by-id/kbd. But I am receiving scan code with the original input. Please can you help me to read barcode scanner using hid lib? ...Thanks in advance it will really help me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.