How to configure an InputDevice attached to the serial port? (Barcode Reader)
Loye Young
iycctech at yahoo.com
Sun Dec 17 15:05:07 PST 2006
I've been trying to figure this out for about a year
now. I've read my eyeballs off and I'm stumped.
In our parts rooms, we have barcode readers that plug
into the serial port (RS232). I need the scanned
characters to show up in the X server applications in
the same manner as a keyboard.
Essentially, I want the reader to work like another
keyboard. If I connect both a PS2 keyboard and a USB
keyboard to the box, I can type on either and the X
server dutifully puts the right text in the right
place. How do I get it to treat the barcode scanner
the same way?
The reader itself works. When I open Xterm, execute
"cat /dev/ttyS0", and then scan something, I get the
scanned ASCII alphanumeric characters precisely as I
expect. That tells me that the kernel's built-in
serial driver works just fine. Plain ASCII is coming
in the serial port, but the Xserver doesn't know what
to do with it.
My best guess right now is that a stanza in the
xorg.conf file should work. I've tried several
iterations, but either I get nothing or I get
gibberish.
The other possibility I can think of is to somehow
pipe the data from the serial port to the keyboard
input at the OS level. (We're running various flavors
of Debian/Linux [i.e., Kubuntu, Mepis, Debian].) I've
poked at it some, but trying to figure out how to
navigate the interactions among the kernel, udev,
hardware drivers, HAL, the procfs file system, the
event notifier, scan codes, and who-knows-what-else is
a daunting task.
I have tried serial-to-USB adapters and they didn't
work. And no, I can't go out and buy USB or PS2
scanners. It's not my call within the organization; I
get what I get, and that's what I get.
I am not alone, either. I've read posts of many people
asking the same question, but nobody gives an answer.
Every once in a while, a programmer will weigh in with
RTFM or "Google will give you a lot of examples of how
to do it." Well, I've tried. Ain't there.
I have had a thread going on the mepis distro's site
for about 10 months, but nobody over there knows
either. See http://www.mepis.org/node/9104
The higher-ups in the industry want us all to ditch
the serial port in favor of USB. But there are a LOT
of serial devices out here in the real world, and
they're merrily working just fine. Barcode scanners,
employee time clocks, factory instrumentation,
scientific instruments, automotive diagnostic
equipment . . . the list goes on and on. The humble
serial port may be slow, unglamourous, and cumbersome,
but it's been a reliable workhorse for a over half a
century. It ain't going away anytime soon.
I know everyone reading this post is very busy. Thank
you for your patience and any guidance you can render.
Happy Trails,
Loye Young
Laredo, Texas
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the xorg
mailing list